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

AKS - fix tab component behavior when there are duplicate node pool names #11452

Merged

Conversation

mantis-toboggan-md
Copy link
Member

Summary

Fixes #11406

Occurred changes and/or fixed issues

This PR updates the AKS provisioning form to correct an issue with Tab props - duplicate pool names caused a problem due to tabs not having unique keys. This PR also adds validation for AKS pool name uniqueness.

It's pretty easy to wind up with duplicate pool names here. In an effort to avoid adding QA burden to the fast-approaching 2.9.0 release I've filed a separate issue to improve node pool/group default naming more generally in a later release (#11451), as technically, that is not a release-blocker (the workaround is immediately obvious: manually re-name any duplicate pools you've inadvertently created).

Technical notes summary

To clarify the Tab props in play here: in CruAKS Tab components need a key prop because they're part of a v-for loop...Tabs within the Tabbed are also part of a v-for loop and the key used there is the Tab name prop. Arguably Tabbed should re-use the key prop when it is defined but it felt outside the scope of this issue to mess with such a widely used component.

Areas or cases that should be tested

  1. Create a new AKS cluster, add and remove node pools and/or manually enter duplicate pool names - the tab components should work as expected
  2. There should be an error banner and the save button should be disabled if there are duplicate pool names
  3. Edit the AKS cluster - pool names and tab titles should all still work as expected

Checklist

  • The PR is linked to an issue and the linked issue has a Milestone, or no issue is needed
  • The PR has a Milestone
  • The PR template has been filled out
  • The PR has been self reviewed
  • The PR has a reviewer assigned
  • The PR has automated tests or clear instructions for manual tests and the linked issue has appropriate QA labels, or tests are not needed
  • The PR has reviewed with UX and tested in light and dark mode, or there are no UX changes

@@ -165,3 +165,15 @@ export const nodePoolNames = (ctx: any) => {
}
};
};

export const nodePoolNamesUnique = (ctx: any) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a good candidate for some unit tests.

@momesgin
Copy link
Member

momesgin commented Jul 16, 2024

I've tested this, and confirmed that the problem is fixed.

@nwmac nwmac requested a review from richard-cox July 17, 2024 07:55
@@ -165,3 +165,15 @@ export const nodePoolNames = (ctx: any) => {
}
};
};

export const nodePoolNamesUnique = (ctx: any) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe one for the future, but this is specific to AKS given typing and error message. Could either rename to akeNodePoolNamesUnique or make below generic (pool: { [key: string]: any, name: string } kinda thing, or with generics <T = { [key... >)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be tackled in #11451

@richard-cox richard-cox merged commit 3da1205 into rancher:master Jul 17, 2024
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[AKS] Nodepool management misbehaves if initial nodepool is named 'pool1'
3 participants