-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
🌱 sync defined machine labels to node #11650
base: main
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
df52d4f
to
cb79cc3
Compare
cb79cc3
to
2d97f8a
Compare
2d97f8a
to
5ff55f6
Compare
Thanks! let's please make sure to add a counter part issue and update the original proposal https://github.com/kubernetes-sigs/cluster-api/blob/12cd150d55330e04b2639396469786a6020a5b82/docs/proposals/20220927-label-sync-between-machine-and-nodes.md |
TODO:
|
Thanks for this! Something that would be useful here is some sort of wildcard support, in case administrators would like all labels propagated. |
This is supported by setting |
5ff55f6
to
804d45d
Compare
804d45d
to
0c12e60
Compare
docs/proposals/20220927-label-sync-between-machine-and-nodes.md
Outdated
Show resolved
Hide resolved
0c12e60
to
114bd3a
Compare
@ykakarap: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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-sigs/prow repository. I understand the commands that are listed here. |
/lgtm |
LGTM label has been added. Git tree hash: ed1927bdc916768f2a953ecfe84b99405eab3a2d
|
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 improvement!
/lgtm
@sbueringer @chrischdi for a final pass
return managedLabels | ||
} | ||
|
||
func (r *Reconciler) allowedDomainSync(domain string) bool { | ||
for _, v := range r.SyncMachineLabels { | ||
matched, _ := filepath.Match(v, domain) |
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.
What is the reason we're using filepath.Match that as per the documentation "matches shell file name patterns" to select labels to sync?
I would have expected something like regexp as it should be more intuitive to match regexp against the full labels keys instead of using file patc matching on a substring of the label key
@@ -254,11 +255,30 @@ func InitFlags(fs *pflag.FlagSet) { | |||
"Use deprecated infrastructure machine naming") | |||
_ = fs.MarkDeprecated("use-deprecated-infra-machine-naming", "This flag will be removed in v1.9.") | |||
|
|||
fs.StringArrayVar(&syncMachineLabels, "additional-sync-machine-labels", []string{}, `The list of additional domains used to sync labels from machines to nodes. | |||
The flag also supports standard glob processing: |
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.
How sure are we that this definition from the filepath.Match godoc is identical to glob patterns?
What this PR does / why we need it:
Add an flag to the CAPI manager to dictate the labels that should be synced form the Machine to the node. If the flag is not specified it defaults to:
Any value specified by the flag would be additional to the list to default values.
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #11657
/area machine