-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Running "cdk diff" returns error code 1 #5885
Comments
@nicklaw5 - can you provide some additional information? what version of the CDK was your project created with? I'm trying to reproduce your error but can't seem to get there. Steps I've tried:
what does your |
@shivlaks Thanks for taking a look. I will put together a small repro tomorrow. |
Doesn't appear I can reproduce using the sample app: npm install -g aws-cdk
cdk version # 1.21.1 (build 842cc5f)
cdk init sample-app --language=typescript
cdk diff # exits with 0 This may having something to do with how we extend and wrap |
I've managed to create a repro: https://github.com/nicklaw5/aws-cdk-5885-repro. Please follow the steps in the readme to reproduce yourself. |
Confirming this, I'm experiencing the same problem.
CDK Version: 1.31.0 (build 8f3ac79)
No, my |
I can also reproduce this from our CI environment (codebuild) running 1.22.0 (diff --fail supported since 1.19). $? will return 1 instead of 0 in case of any diff, without the --fail flag. |
+1 this is an issue for me as well, running cdk version 1.32.2, python 3.8.2, as well as python 3.8 |
workaround @angusfz mentioned works for me locally, but not amenable for a cicd system since cdk.context.json isn't supposed to be checked into a vcs |
@angusfz - as mentioned in the changelog, it's under a @xycodex - runtime context can be set in a few locations. Your alternatives to committing it would include setting the key in |
OK, so you HAVE to set that manually in the context. I missed that, I assumed it is the default. Thanks for clarification @shivlaks |
@udondan Yes, we flipped it to being the default for projects initialized through I also amended the changelog entry to include the details from the initial commit (#7401) |
ah, that all makes sense now. I did try adding the flag to cdk.json, but was wrong about the format. However, my cdk.json gets overwritten to just |
Yeah I noticed this as well. I first added it to |
thanks for the update! added this to the cdk.json files and it works as expected through codebuild. |
Shouldn't the --fail option be removed if it doesn't actually work? Seems like it needs to be spelled |
+1. |
@metametadata - does the context have The reason the option is not removed is because the context can be established in multiple ways. Perhaps the wording can still clarify that fail requires the context key |
Thank you for the explanation. I set no context in my cases. I agree that the wording should be improved. |
Despite the fix introduced in #4650. I'm still experiencing
cdk diff
exiting with status code 1.Reproduction Steps
Run the following shell script:
Environment
Other
Relates to #2111
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: