-
Notifications
You must be signed in to change notification settings - Fork 394
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
🌱 Add --labels to kubectl kcp workload sync #2815
🌱 Add --labels to kubectl kcp workload sync #2815
Conversation
Hi @fabriziopandini. Thanks for your PR. I'm waiting for a kcp-dev member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this PR !
Just a few minor comments
@@ -140,6 +142,7 @@ func (o *SyncOptions) BindFlags(cmd *cobra.Command) { | |||
"Options are:\n"+strings.Join(kcpfeatures.KnownFeatures(), "\n")) // hide kube-only gates | |||
cmd.Flags().DurationVar(&o.APIImportPollInterval, "api-import-poll-interval", o.APIImportPollInterval, "Polling interval for API import.") | |||
cmd.Flags().DurationVar(&o.DownstreamNamespaceCleanDelay, "downstream-namespace-clean-delay", o.DownstreamNamespaceCleanDelay, "Time to wait before deleting a downstream namespaces.") | |||
cmd.Flags().StringVar(&o.SyncTargetLabels, "labels", o.SyncTargetLabels, "A set of key=value pairs to be used as a labels for the sync target in kcp") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cmd.Flags().StringVar(&o.SyncTargetLabels, "labels", o.SyncTargetLabels, "A set of key=value pairs to be used as a labels for the sync target in kcp") | |
cmd.Flags().StringVar(&o.SyncTargetLabels, "labels", o.SyncTargetLabels, "A set of key=value pairs to be used as labels on the SyncTarget created in kcp") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also mention the fact that they would be comma-separated ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also why not use a StringSliceVar
as for apiexports
or resources
arguments ?
This would take care of the comma-separated part of it, as the doc mentions
--ss="v1,v2" --ss="v3" will result in []string{"v1", "v2", "v3"}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good suggestion, done!
now you can do
kubectl kcp workload sync west --replicas=0 --syncer-image=syncer --output-file=west-syncer.yaml \
--labels=region=east,foo=bar \
--labels=bar=baz
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice
/ok-to-test |
comment addressed, test errors seem a flake but I will check again after tests for this latest commit completes |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: davidfestal The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/hold |
/unhold |
Summary
This PR adds a --labels flag to be used for setting labels in the SyncTarget created by
kcp workload sync
, thus allowing to easier to test scenarios like the east/west workload placement described in this PR (it is not required anymore to patch SyncTarget after they are created).The same capability is added to the
syncerFixture
in the test framework