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

fix(eks): can't update authMode with the same mode #31043

Merged
merged 5 commits into from
Aug 28, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,13 @@ export class ClusterResourceHandler extends ResourceHandler {
this.newProps.accessConfig?.authenticationMode === 'API') {
throw new Error('Cannot update from CONFIG_MAP to API');
}
// update-authmode will fail if we try to update to the same mode,
// so skip in this case.
const cluster = (await this.eks.describeCluster({ name: this.clusterName })).cluster;
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we try catch this API call to avoid network issues or any other issue that will fail customer handler code?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@GavinZZ just added the try/catch and manually re-validated it in us-east-1. It deployed with no error.

if (cluster?.accessConfig?.authenticationMode === this.newProps.accessConfig?.authenticationMode) {
console.log(`cluster already at ${cluster?.accessConfig?.authenticationMode}, skipping authMode update`);
return;
}
config.accessConfig = this.newProps.accessConfig;
};

Expand Down
Loading