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

Make the ECR version tagging regular expression exactly match the image tag instead of containing #24

Merged
merged 2 commits into from
Jan 30, 2023

Conversation

dayuwang-wish
Copy link

@dayuwang-wish dayuwang-wish commented Jan 29, 2023

Problem:

Currently, the tag of 8 char length short commit SHA on git is expected to be matched as a potential target associated with the deployment environment. However, the current Regex [0-9a-f]{5,40} matches any qualified preceding tokens, thus having the logic of "match any". This would cause a problem with unexpected matches, e.g., when a branch name master and timestamp ensemble a tag master_1671212099 for example, this will be also matched with the regex, thus violating Wish internal naming convention.

So this PR is to make the regex exactly match the tag, instead of "match any".

Testing

Add unit test registry/ecr/provider_test.go

Local Docker build

docker build -t nearmap/kcd .

xxxx
xxxx

 => exporting to image                                                                                                                                                                                                                                                                                0.2s
 => => exporting layers                                                                                                                                                                                                                                                                               0.2s
 => => writing image sha256:5757f4b0f53810a8ee441893f3483a62ebfc376d90d60fd30f269a06e119e74e                                                                                                                                                                                                          0.0s
 => => naming to docker.io/nearmap/kcd  

@tlong-wish tlong-wish merged commit 9d70083 into wish:master Jan 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants