-
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
Changes from all commits
6584df3
53833ac
8b45d2c
9257166
8208671
931e7a2
d5802b3
a820099
16f04c8
24bbb1a
e79ab0f
34c6f06
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -241,7 +241,7 @@ 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 commentThe 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 commentThe 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 commentThe 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 |
||
expect.stringContaining("Bootstrap stack version '5' is required, found version '1'. To get rid of this error, please upgrade to bootstrap version >= 5"), | ||
])); | ||
expect(requestedParameterName!).toEqual('/bootstrap/parameter'); | ||
expect(mockForEnvironment.mock.calls.length).toEqual(3); | ||
|
@@ -276,7 +276,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/), | ||
])); | ||
expect(mockForEnvironment.mock.calls.length).toEqual(3); | ||
expect(mockForEnvironment.mock.calls[0][2]).toEqual({ | ||
|
@@ -315,7 +314,6 @@ describe('readCurrentTemplate', () => { | |
expect(mockCloudExecutable.sdkProvider.sdk.ssm).not.toHaveBeenCalled(); | ||
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/), | ||
])); | ||
expect(mockForEnvironment.mock.calls.length).toEqual(3); | ||
expect(mockForEnvironment.mock.calls[0][2]).toEqual({ | ||
|
@@ -350,7 +348,7 @@ describe('readCurrentTemplate', () => { | |
|
||
// THEN | ||
expect(flatten(stderrMock.mock.calls)).toEqual(expect.arrayContaining([ | ||
expect.stringMatching(/please upgrade to bootstrap version >= 5/), | ||
expect.stringMatching(/Lookup role exists but was not assumed. Proceeding with default credentials./), | ||
])); | ||
expect(mockCloudExecutable.sdkProvider.sdk.ssm).not.toHaveBeenCalled(); | ||
expect(mockForEnvironment.mock.calls.length).toEqual(3); | ||
|
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.