Skip to content

Comments

Correct usage of 'name' calling CheckEBSAddon, needs clusterState.Cluster.Name#2042

Open
sehorne wants to merge 1 commit intorancher:mainfrom
sehorne:bug-53778-fix
Open

Correct usage of 'name' calling CheckEBSAddon, needs clusterState.Cluster.Name#2042
sehorne wants to merge 1 commit intorancher:mainfrom
sehorne:bug-53778-fix

Conversation

@sehorne
Copy link

@sehorne sehorne commented Feb 17, 2026

What this PR does / why we need it:

Fixes incorrect usage of the name parameter in BuildUpstreamClusterState. 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:

  • AWS API calls (like CheckEBSAddon) receive the actual AWS cluster name from clusterState.Cluster.Name
  • Error messages contain the resource name for operator debugging context
  • DisplayName is set correctly to the AWS cluster name

Changes made:

  • controller/external.go: Use aws.ToString(clusterState.Cluster.Name) for AWS API calls and DisplayName
  • controller/external_test.go: Added comprehensive test coverage

Which 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 of clusterState.Cluster.Name (the actual AWS cluster name) for AWS API calls. The fix uses the correct variable in each context:

  • AWS API calls → use AWS cluster name
  • Error messages → use resource name for operator debugging

The new tests verify correct behavior and would have caught this bug.

Checklist:

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

Signed-off-by: Mark A. Sehorne sehorne@lifeonacanal.com

…e.Cluster.Name

Signed-off-by: Mark A. Sehorne <sehorne@lifeonacanal.com>
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.

1 participant