-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Fix #3153 - Validate tag before build using OCI regex #3191
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! I just kicked off CI and there's some failures - once those are taken care of, I'll get this merged:
- Lint errors -
make ruff
(will run inside Docker container) - Unit tests (need to update example tag) -
make unit-test-py3
(will run inside Docker container)
Let me know if you have any trouble
Signed-off-by: Daniel Lombardi <lombardi.daniel.o@gmail.com>
Signed-off-by: Daniel Lombardi <lombardi.daniel.o@gmail.com>
…l.com> Signed-off-by: Daniel Lombardi <lombardi.daniel.o@gmail.com>
…di.daniel.o@gmail.com> Signed-off-by: Daniel Lombardi <lombardi.daniel.o@gmail.com>
@milas Done! the error was due to me changing the exception type and not updating the test! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏻
Out of curiosity, was it you or the linter that reformatted the test file? (Not a big deal, just surprised)
No no, i had made a change to better represent the error, before it was |
I opened #3240 related to this PR |
Fix #3153, but guarantees that it woud raise the appropriate error.
The regex expression is:
^[a-z0-9]+((\.|_|__|-+)[a-z0-9]+)*(\/[a-z0-9]+((\.|_|__|-+)[a-z0-9]+)*)*(:[a-zA-Z0-9_][a-zA-Z0-9._-]{0,127})?$
I made it by combining
^[a-z0-9]+((\.|_|__|-+)[a-z0-9]+)*(\/[a-z0-9]+((\.|_|__|-+)[a-z0-9]+)*)*
and the(:[a-zA-Z0-9_][a-zA-Z0-9._-]{0,127})?
group. Both expressions are from the opencontainers/distribution-spec repo, as cited in the docker docs.I also wrote a test for testing a build function call with erroneous tag value.