-
-
Notifications
You must be signed in to change notification settings - Fork 108
fix: switch dockerfile matching to exact match instead of prefix #6437
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
Conversation
|
If I understand correctly, this will be a breaking change with the declarative pipeline but a bug fix for the autodiscovery plugin. Which we do now. TBH, I don't understand how this change would introduce a breaking change for the autodiscovery plugin, normally it should handle every image independently. In fact, using string comparison over checking prefix is even a bug fix for the autodiscovery because a multi-stage Dockerfile containing both To play extra safe, we could use regex over string comparison, but then we would always need to specify So my take on this would be to consider this as a bug and use string comparison To me |
|
Then we need to revisit the autodiscovery, at the moment to get all image in a dockerfile we check for all The way I expect this to work is:
Should find |
|
Sorry for the stupid question, but why do you want to ignore stage images? I don't understand |
|
The behaviour I see is FROM python:3.14 AS python-runtime
RUN apk add git
FROM python-runtime AS builder
...
FROM python-runtime AS dev
...So we have base runtime, that we call python-runtime, it's reused multiple time. When i run autodiscovery, I expect to only update the first one, the others are not docker images per se |
|
Haaa good point thanks for the clarification |
olblak
left a comment
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 fix
|
Re-triggering the unit tests, for some reason it's failing, but I don't seem to be able to reproduce locally :/ |
|
I could reproduce executing multiple time |
|
And the dockerfile e2e tests are not passing for the autodiscovery |
|
The e2e tests are not passing because they rely on docker images hosted on DockerHub, but pull request don't have access to DockerHub credentials for obvious security reason. I'll try to find some time to make the tests passing |
|
So for some reason, the changes introduce in this pull request would detect this Dockerfile with an image not available on DockerHub 🤷🏾 |
Fix #5954
Switch from
HasPrefixto==for DockerfileFROMmatchingTest
To test this pull request, you can run the following commands:
Additional Information
Checklist
Tradeoff
This is a behavioral breaking change
Potential improvement