-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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: cdk diff prints upgrade bootstrap warning even when current version exceeds the recommended version #29938
Conversation
…ion exceeds the recommended version Signed-off-by: Vinayak Kukreja <vinakuk@amazon.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
A comment requesting an exemption should contain the text Exemption Request
. Additionally, if clarification is needed add Clarification Request
to a comment.
Signed-off-by: Vinayak Kukreja <vinakuk@amazon.com>
Signed-off-by: Vinayak Kukreja <vinakuk@amazon.com>
Signed-off-by: Vinayak Kukreja <vinakuk@amazon.com>
@@ -532,7 +532,7 @@ export class Deployments { | |||
|
|||
// try to assume the lookup role | |||
const warningMessage = `Could not assume ${arns.lookupRoleArn}, proceeding anyway.`; | |||
const upgradeMessage = `(To get rid of this warning, please upgrade to bootstrap version >= ${stack.lookupRole?.requiresBootstrapStackVersion})`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we are unable to assume the lookup role and are not looking for the bootstrap version in SSM of the user's account, then there is no way we are sure about this recommendation. And, we should not just be recommending this without knowing it for a fact that they are on an older version of bootstrap.
We already error out if the user is using an older version of bootstrap than the recommended version.
@@ -241,7 +241,6 @@ describe('readCurrentTemplate', () => { | |||
// THEN | |||
expect(flatten(stderrMock.mock.calls)).toEqual(expect.arrayContaining([ | |||
expect.stringMatching(/Could not assume bloop-lookup:here:123456789012/), | |||
expect.stringMatching(/please upgrade to bootstrap version >= 5/), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one has an invalid bootstrap version (1 when >= 5 was expected) and an upgrade message should be emitted here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is weird. Without successfully assuming the lookup role, how will we know what bootstrap version is in SSM. Maybe cached? Taking a look
But, if we are able to assume the role, we do throw in such scenario instead of a warning: https://github.com/aws/aws-cdk/blob/vkukreja/doc-update/packages/aws-cdk/lib/api/deployments.ts#L546-L549
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So it was throwing the expected error but since we catch it and do nothing, it will only show up if we have --debug
flag enabled. I believe it needs to be shown and hence adding it with error
Signed-off-by: Vinayak Kukreja <vinakuk@amazon.com>
Signed-off-by: Vinayak Kukreja <vinakuk@amazon.com>
Signed-off-by: Vinayak Kukreja <vinakuk@amazon.com>
Signed-off-by: Vinayak Kukreja <vinakuk@amazon.com>
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Comments on closed issues and PRs are hard for our team to see. If you need help, please open a new issue that references this one. |
Closes #28888
Reason for this change
Currently, we just check for if a minimum bootstrap version is needed for a functionality and give a warning. But, we do not check the bootstrap version of the stack itself. This gives a confusing warning for upgrading to a bootstrap version (example: version 8) when the stack bootstrap version is already higher than the recommended version.
Description of changes
We cannot know successfully what the bootstrap version is in the AWS account without the lookup role. We are getting this warning while trying to assume the lookup role and failing to assume it.
I am removing upgrade related warnings since we are emitting them without any confirmation of the user's account bootstrap version. This will lead to confusion. Instead, I am trying to make some of the existing error messages more clear.
Description of how you validated changes
Updated unit tests.
Will run this through test pipeline.
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license