Correct usage of 'name' calling CheckEBSAddon, needs clusterState.Cluster.Name#2042
Open
sehorne wants to merge 1 commit intorancher:mainfrom
Open
Correct usage of 'name' calling CheckEBSAddon, needs clusterState.Cluster.Name#2042sehorne wants to merge 1 commit intorancher:mainfrom
sehorne wants to merge 1 commit intorancher:mainfrom
Conversation
…e.Cluster.Name Signed-off-by: Mark A. Sehorne <sehorne@lifeonacanal.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
Fixes incorrect usage of the
nameparameter inBuildUpstreamClusterState. The function was using the EKSClusterConfig resource name instead of the actual AWS cluster name when making AWS API calls, causing failures during cluster import when names differ. This was found in Rancher 2.13.2, but would have occurred much earler.The bug occurs when importing/migrating EKS clusters where the Rancher resource name differs from the AWS cluster name. The fix ensures:
CheckEBSAddon) receive the actual AWS cluster name fromclusterState.Cluster.NameDisplayNameis set correctly to the AWS cluster nameChanges made:
controller/external.go: Useaws.ToString(clusterState.Cluster.Name)for AWS API calls and DisplayNamecontroller/external_test.go: Added comprehensive test coverageWhich issue(s) this PR fixes
Issue #2041
Special notes for your reviewer:
For clusters where the display name in Rancher is the same as the cluster name in AWS, this is a backwards compatible change.
This is a variable naming confusion bug where
name(the Kubernetes resource name) was being used instead ofclusterState.Cluster.Name(the actual AWS cluster name) for AWS API calls. The fix uses the correct variable in each context:The new tests verify correct behavior and would have caught this bug.
Checklist:
Signed-off-by: Mark A. Sehorne sehorne@lifeonacanal.com