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

Docker image Module Id is incorrect #665

Closed
gangefors opened this issue Sep 12, 2022 · 3 comments · Fixed by #666
Closed

Docker image Module Id is incorrect #665

gangefors opened this issue Sep 12, 2022 · 3 comments · Fixed by #666
Assignees
Labels
bug Create a report to help us improve

Comments

@gangefors
Copy link

Describe the bug
When using the Jenkins Artifactory plugin v3.16.0+ collecting build information about a Docker image it will set the module id incorrectly, keeping only the last part of the image name. In short, any namespace or other prefix is stripped except for the string after the last / (slash).

To Reproduce
Use Build info extractor v2.36.0 or later and collect build info about a docker image build containing more than one slash in its name. Example: <docker.registry>/mynamespace/part1/part2:tag.
The module id should be mynamespace/part1/part2:tag but becomes part2:tag

Expected behavior
I would expect the module id in the build info be the complete image name, i.e. mynamespace/part1/part2:tag so that I can use the module id as a reference to the image. This was the behaviour prior to v2.36.0 and I can't find any note about breaking changes in the release log.

Versions

  • Extractor version: v2.36.0
  • Operating system: Linux
  • Artifactory Version: 7.41.7

Additional context
This is the commit and line that broke the working implementation.
9a38bce#diff-a2a11f1de8fbc6155e4bd1bb32af64fd6ff9443e29b1b0b781a7e56324709ad4R231

@gangefors gangefors added the bug Create a report to help us improve label Sep 12, 2022
@yahavi
Copy link
Member

yahavi commented Sep 13, 2022

Thanks for reporting this issue, @gangefors!
First, please accept our apologies for this change.
The root cause of the original bug fix is - including the repository in the build-info. The repository of an artifact is mutable and can be changed, for example, by promotion. On the other hand, build-info is immutable and can't be changed. As a result, the module ID can't contain the repository name.

We created #666 to fix the issue with the slash in the image name.

Please let me know what you think.
We'll also keep you posted about this fix.

@yahavi yahavi self-assigned this Sep 13, 2022
@gangefors
Copy link
Author

Thanks for the very fast response on this. The implementation in #666 looks as good as it possibly can be, stripping the targetRepo prefix if found. Thanks again for the fix.

@Or-Geva
Copy link
Collaborator

Or-Geva commented Sep 29, 2022

@gangefors, Jenkins Artifactory plugin v3.17.1 includes a fix for your issue.
Feel free to upgrade and share your feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Create a report to help us improve
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants