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

(Imagebuilder): cdk diff not detecting changes #13016

Closed
nigel-heaney opened this issue Feb 12, 2021 · 3 comments · Fixed by #13022
Closed

(Imagebuilder): cdk diff not detecting changes #13016

nigel-heaney opened this issue Feb 12, 2021 · 3 comments · Fixed by #13022
Assignees
Labels
@aws-cdk/aws-imagebuilder Related to EC2 Image Builder bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.

Comments

@nigel-heaney
Copy link

Updating a component or image recipe version is not reflected in cdk diff and will report no changes but a deploy will replace those resources with the new version.

Reproduction Steps

const exampleYumUpdate = new imagebuilder.CfnComponent(this, 'exampleYumUpdate', {
  name: "exampleYumUpdate",
  platform: "Linux",
  version: "0.0.1",
  uri: `s3://${s3bucket.bucketName}/components/yum_update.yml`,
})

const exampleRecipe = new imagebuilder.CfnImageRecipe(this, "exampleRecipe", {
  name: 'exampleRecipe',
  version: '0.0.1',
  components: [
    { "componentArn": exampleYumUpdate.attrArn }
  ],
  parentImage: "ami-0f82969826859fb14",
})

update the versions to 0.0.2 and cdk diff shows

cdk diff
Stack ExampleStack
There were no differences

# then deploy
cdk deploy
ExampleStack: deploying...
ExampleStack: creating CloudFormation changeset...
[█████████████████████████████·····························] (2/4)

 ✅  ExampleStack

What did you expect to happen?

It should report that those resources will be replaced.

Environment

  • CDK CLI Version : 1.89.0
  • Framework Version:
  • Node.js Version: v12.14.1
  • OS : macOS 10.15.7
  • Language (Version): typescript@3.9.8

Other


This is 🐛 Bug Report

@nigel-heaney nigel-heaney added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Feb 12, 2021
@github-actions github-actions bot added the @aws-cdk/aws-imagebuilder Related to EC2 Image Builder label Feb 12, 2021
@skinny85
Copy link
Contributor

Thanks for reporting @nigel-heaney . Confirming I was able to reproduce it. Digging into this further.

@skinny85
Copy link
Contributor

The problem is this line. Apparently, in JavaScript, parseFloat('0.0.1') === parseFloat('0.0.2') === 0.

skinny85 added a commit to skinny85/aws-cdk that referenced this issue Feb 12, 2021
Turns out, our cloudformation-diff interprets all version strings like '0.2.3' as just 0,
which means diff misses any changes to those kind of resources.

Make sure that returning the number 0 only happens for strings that are actually equal to '0'.

Fixes aws#13016
@mergify mergify bot closed this as completed in #13022 Feb 13, 2021
mergify bot pushed a commit that referenced this issue Feb 13, 2021
Turns out, our cloudformation-diff interprets all version strings like '0.2.3' as just 0,
which means diff misses any changes to those kind of resources.

Make sure that returning the number 0 only happens for strings that are actually equal to '0'.

Fixes #13016

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

NovakGu pushed a commit to NovakGu/aws-cdk that referenced this issue Feb 18, 2021
Turns out, our cloudformation-diff interprets all version strings like '0.2.3' as just 0,
which means diff misses any changes to those kind of resources.

Make sure that returning the number 0 only happens for strings that are actually equal to '0'.

Fixes aws#13016

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-imagebuilder Related to EC2 Image Builder bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants