-
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
aws-codepipeline-actions: EcrSourceAction should trigger for all tags when imageTag is empty string #20594
Comments
Our docs might be incorrect - the CodePipeline API states that no tag will default to |
I believe this is (mostly) a doc fix on the aws-cdk side. It does however demonstrate that the CodePipeline EcrSourceAction is totally unusable with the ECR ImmutableTags feature. |
Check out this PR #17270. It explains what the expected functionality is |
@sparten11740 could you help us out with this? |
So, I've been looking into this issue and I think that it isn't actually a documentation issue. We do intend to allow you to trigger on all tags when you provide an empty string, so if that isn't working, it is a bug. One question, though. You mentioned that when you provide the empty string, it's just absent in the template. Did you deploy the pipeline itself and find that it wasn't triggering on all tags or is this issue submitted as a result of what the template is showing? Doing something directly in the console isn't always analogous to doing it in code. There is typically default functionality built into the console. In this case, the We don't have any changes that should have stopped this from working on our end, and it was working on our end, so I'm trying to track down if/where something may have changed to make this no longer work. Can you confirm that you deployed the cdk app and that the pipeline was only triggering on |
@TheRealAmazonKendra I deployed the stack. The pipeline didn't work as expected. I dug into it in an AWS Support ticket. We discovered that it was filtering on latest. I tried the hacks I mentioned above to get it to work as documented. They didn't work either. |
@TheRealAmazonKendra I... really wish I was the kind of guy who is diligent and thorough enough to read the templates, but... I never do unless I'm trying to debug something. :) |
The docs for CodePipeline seem to indicate that triggering on all tags is not an option. If the tag is omitted (which we currently do) then it defaults to |
Had a look at the ECR Source Action source code and I'm pretty sure triggering on all tags is not a feature. Now trying to understand what the original contributor in #17270 thought he was changing, because it looks to not be exactly what was advertised. |
The current ECR source action docs seem to indicate you can make it trigger on more than one tag at a time (or even all tags). This is not true, so stop advertising that feature. Fixes #20594.
The current ECR source action docs seem to indicate you can make it trigger on more than one tag at a time (or even all tags). This is not true, so stop advertising that feature. Fixes #20594. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
The current ECR source action docs seem to indicate you can make it trigger on more than one tag at a time (or even all tags). This is not true, so stop advertising that feature. Fixes aws#20594. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Describe the bug
Per aws-cdk documentation, https://github.com/aws/aws-cdk/blob/main/packages/%40aws-cdk/aws-codepipeline-actions/lib/ecr/source-action.ts#L39 I should be able to provide an empty string to the EcrSourceAction to have it trigger on any push to any tag.
However, when I write that, CDK omits the ImageTag from the rendered CloudFormation. When I force the issue with
CloudFormation refuses to actually deploy with
When I went into the console and attempted to produce the desired behaviour (CodePipeline triggers on ECR pushes to any docker tag), it instead defaulted to
latest
. It does not appear to be possible to configure it to trigger for pushed to any docker tag.ECR has immutable tags as a feature. We'd like to leverage that to ensure that the tags we are deploying can be deterministically mapped back to the code the were built with.
Expected Behavior
It should do what it says.
Current Behavior
Silently defaults to
latest
.Reproduction Steps
I've already wasted 2 days on this false trail. Here's what I was using.
Possible Solution
Initially, you should probably just update the comment to reflect the unfortunate reality of CodePipeline sucking.
Additional Information/Context
No response
CDK CLI Version
2.26.0 (build a409d63)
Framework Version
No response
Node.js Version
v16.13.1
OS
Mac
Language
Typescript
Language Version
4.7.2
Other information
No response
The text was updated successfully, but these errors were encountered: