Skip to content
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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vatsalparekh
Copy link
Contributor

@vatsalparekh vatsalparekh commented Oct 28, 2024

What this PR does / why we need it:

Which issue(s) this PR fixes
Issue #667

Special notes for your reviewer:

Checklist:

  • squashed commits into logical changes
  • includes documentation
  • adds unit tests
  • adds or updates e2e tests
  • backport needed

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)
Copy link
Contributor

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.

Copy link
Contributor Author

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

Copy link
Contributor

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)
Copy link
Contributor

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.

@yiannistri
Copy link
Contributor

After testing this a couple of times, the behaviour described in #667 is still present:

  1. Created a cluster with 1 system node pool and 3 additional user node pools, each with 1 node.
  2. Once active, I removed one of the user node pools while also enabling the HTTP application routing.
  3. After a few minutes, the node pool was removed but the HTTP application routing remains disabled.

@kkaempf kkaempf added this to the v2.10.1 milestone Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

4 participants