-
Notifications
You must be signed in to change notification settings - Fork 29
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
Correct code flow of node pools #703
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Vatsal Parekh <[email protected]>
clusterSpecCopy.NodePools = make([]aksv1.AKSNodePool, 0, len(config.Spec.NodePools)) | ||
for _, n := range config.Spec.NodePools { | ||
if _, ok := upstreamNodePools[*n.Name]; ok { | ||
clusterSpecCopy.NodePools = append(clusterSpecCopy.NodePools, n) |
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.
Why are you changing logic for provisioned clusters by Rancher? In results of this change non-imported clusters won't be updated.
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.
The loop iterating over config.NodePools checks if that NodePool is present in upstreamNodePools, which means that no new pool can be added or deleted. This logic seems confusing. Changing this only for Imported cluster seems logical
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.
Updates for NodePools need to work for both rancher managed clusters and imported one. Your change will break this and only imported cluster will be updated.
clusterSpecCopy.NodePools = make([]aksv1.AKSNodePool, 0, len(config.Spec.NodePools)) | ||
for _, n := range config.Spec.NodePools { | ||
if _, ok := upstreamNodePools[*n.Name]; ok { | ||
clusterSpecCopy.NodePools = append(clusterSpecCopy.NodePools, n) |
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.
Updates for NodePools need to work for both rancher managed clusters and imported one. Your change will break this and only imported cluster will be updated.
After testing this a couple of times, the behaviour described in #667 is still present:
|
What this PR does / why we need it:
Which issue(s) this PR fixes
Issue #667
Special notes for your reviewer:
Checklist: