-
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
cdk context --reset <number>
does not work
#3033
Comments
still true as of version CDK CLI Version: 1.44.0 |
I have just come across this bug using 1.54.0. |
*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* Fixes #3033
|
This [commit](#10619), while fixed the problem mentioned, broke the simplest functionally of: ``` cdk context ``` Now throws: ``` Cannot read property 'sort' of undefined ``` This PR reverts that change, and adds a simple unit test that will allow detecting this kind of breakage in unit tests. We still need to fix the issue in the PR, opening the orginal [issue](#3033). ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
This [commit](aws#10619), while fixed the problem mentioned, broke the simplest functionally of: ``` cdk context ``` Now throws: ``` Cannot read property 'sort' of undefined ``` This PR reverts that change, and adds a simple unit test that will allow detecting this kind of breakage in unit tests. We still need to fix the issue in the PR, opening the orginal [issue](aws#3033). ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
I'm submitting a ...
What is the current behavior?
Running
cdk context
outputs a table with indices for the current context entries. On the bottom of the output there's a textRun cdk context --reset KEY_OR_NUMBER to remove a context key. It will be refreshed on the next CDK synthesis run.
. However, runningcdk context --reset 1
will error with:What is the expected behavior?
Resetting a context entry works when passed a number.
Please tell us about your environment:
Other information
I debugged this a bit and it seems that regardless of the amount of context entries, the index to key mapping will always be
[[1, 'bags']]
; I'm guessing the context is now wrapped in a distinctContext
structure which the reset functionality does not take into account.The text was updated successfully, but these errors were encountered: