Skip to content

WIP: CORENET-5674: Add new field for UDN in oc #2002

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -206,3 +206,5 @@ require (
)

replace github.com/apcera/gssapi => github.com/openshift/gssapi v0.0.0-20161010215902-5fb4217df13b

replace github.com/openshift/api => github.com/miheer/api v0.0.0-20250409031450-327eb2166a3a
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,8 @@ github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJ
github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE=
github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/miheer/api v0.0.0-20250409031450-327eb2166a3a h1:2+vw6chPrZaiabIVy09raCr486+vD4XjXFyZwQ51yKA=
github.com/miheer/api v0.0.0-20250409031450-327eb2166a3a/go.mod h1:yk60tHAmHhtVpJQo3TwVYq2zpuP70iJIFDCmeKMIzPw=
github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0=
github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0=
github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
Expand Down Expand Up @@ -489,8 +491,6 @@ github.com/opencontainers/runtime-spec v1.2.0 h1:z97+pHb3uELt/yiAWD691HNHQIF07bE
github.com/opencontainers/runtime-spec v1.2.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
github.com/opencontainers/selinux v1.11.0 h1:+5Zbo97w3Lbmb3PeqQtpmTkMwsW5nRI3YaLpt7tQ7oU=
github.com/opencontainers/selinux v1.11.0/go.mod h1:E5dMC3VPuVvVHDYmi78qvhJp8+M586T4DlDRYpFkyec=
github.com/openshift/api v0.0.0-20250130025500-d9e1a2e1fe6b h1:6OdSvfIgEGZ4Oc4zmhcaCRGWeJHVvHc3fkoRckWYajQ=
github.com/openshift/api v0.0.0-20250130025500-d9e1a2e1fe6b/go.mod h1:yk60tHAmHhtVpJQo3TwVYq2zpuP70iJIFDCmeKMIzPw=
github.com/openshift/build-machinery-go v0.0.0-20250102153059-e85a1a7ecb5c h1:6XcszPFZpan4qll5XbdLll7n1So3IsPn28aw2j1obMo=
github.com/openshift/build-machinery-go v0.0.0-20250102153059-e85a1a7ecb5c/go.mod h1:8jcm8UPtg2mCAsxfqKil1xrmRMI3a+XU2TZ9fF8A7TE=
github.com/openshift/client-go v0.0.0-20250125113824-8e1f0b8fa9a7 h1:4iliLcvr1P9EUMZgIaSNEKNQQzBn+L6PSequlFOuB6Q=
Expand Down
3 changes: 3 additions & 0 deletions pkg/cli/admin/project/new_project.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ type NewProjectOptions struct {
ProjectName string
DisplayName string
Description string
UDNName string
NodeSelector string

UseNodeSelector bool
Expand Down Expand Up @@ -82,6 +83,7 @@ func NewCmdNewProject(f kcmdutil.Factory, streams genericiooptions.IOStreams) *c
cmd.Flags().StringVar(&o.AdminUser, "admin", o.AdminUser, "Project admin username")
cmd.Flags().StringVar(&o.DisplayName, "display-name", o.DisplayName, "Project display name")
cmd.Flags().StringVar(&o.Description, "description", o.Description, "Project description")
cmd.Flags().StringVar(&o.UDNName, "udn-name", o.UDNName, "UserDefinedNetwork Name")
cmd.Flags().StringVar(&o.NodeSelector, "node-selector", o.NodeSelector, "Restrict pods onto nodes matching given label selector. Format: '<key1>=<value1>, <key2>=<value2>...'. Specifying \"\" means any node, not default. If unspecified, cluster default node selector will be used.")

return cmd
Expand Down Expand Up @@ -133,6 +135,7 @@ func (o *NewProjectOptions) Run() error {
project.Annotations = make(map[string]string)
project.Annotations[annotations.OpenShiftDescription] = o.Description
project.Annotations[annotations.OpenShiftDisplayName] = o.DisplayName
project.Labels[projectv1.ProjectUDNName] = o.UDNName
if o.UseNodeSelector {
project.Annotations[projectv1.ProjectNodeSelector] = o.NodeSelector
}
Expand Down
3 changes: 3 additions & 0 deletions pkg/cli/requestproject/request_project.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ type RequestProjectOptions struct {
ProjectName string
DisplayName string
Description string
UDNName string

Server string

Expand Down Expand Up @@ -92,6 +93,7 @@ func NewCmdRequestProject(f kcmdutil.Factory, streams genericiooptions.IOStreams
}
cmd.Flags().StringVar(&o.DisplayName, "display-name", o.DisplayName, "Project display name")
cmd.Flags().StringVar(&o.Description, "description", o.Description, "Project description")
cmd.Flags().StringVar(&o.UDNName, "udn-name", o.UDNName, "UserDefinedNetwork Name")
cmd.Flags().BoolVar(&o.SkipConfigWrite, "skip-config-write", o.SkipConfigWrite, "If true, the project will not be set as a cluster entry in kubeconfig after being created")

return cmd
Expand Down Expand Up @@ -140,6 +142,7 @@ func (o *RequestProjectOptions) Run() error {
projectRequest.Name = o.ProjectName
projectRequest.DisplayName = o.DisplayName
projectRequest.Description = o.Description
projectRequest.UDNName = o.UDNName
projectRequest.Annotations = make(map[string]string)

project, err := o.Client.ProjectRequests().Create(context.TODO(), projectRequest, metav1.CreateOptions{})
Expand Down
6 changes: 5 additions & 1 deletion pkg/helpers/describe/describer.go
Original file line number Diff line number Diff line change
Expand Up @@ -2110,11 +2110,15 @@ func (d *InsightsDataGatherDescriber) Describe(namespace, name string, s describ
}

func describeInsightsDataGathers(idg *configv1alpha1.InsightsDataGather) (string, error) {
var disabledGatherers []string
return tabbedString(func(out *tabwriter.Writer) error {
fmt.Fprintf(out, "Name:\t%s\n", idg.Name)
fmt.Fprintf(out, "GatherConfig:\t\n")
fmt.Fprintf(out, " DataPolicy:\t%s\n", stringOrNone(string(idg.Spec.GatherConfig.DataPolicy)))
fmt.Fprintf(out, " DisabledGatherers:\t%s\n", stringOrNone(strings.Join(idg.Spec.GatherConfig.DisabledGatherers, ",")))
for _, stringGatherer := range idg.Spec.GatherConfig.DisabledGatherers {
disabledGatherers = append(disabledGatherers, toString(stringGatherer))
}
fmt.Fprintf(out, " DisabledGatherers:\t%s\n", stringOrNone(strings.Join(disabledGatherers, ",")))

return nil
})
Expand Down
1 change: 1 addition & 0 deletions vendor/github.com/openshift/api/.golangci.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 1 addition & 13 deletions vendor/github.com/openshift/api/OWNERS

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion vendor/github.com/openshift/api/cloudnetwork/v1/types.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion vendor/github.com/openshift/api/config/install.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 26 additions & 1 deletion vendor/github.com/openshift/api/config/v1/types_apiserver.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions vendor/github.com/openshift/api/config/v1/types_feature.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions vendor/github.com/openshift/api/config/v1/types_image.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading