-
Notifications
You must be signed in to change notification settings - Fork 138
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
Allow multiple versions for a docker image. Fixes #2017. #2069
Allow multiple versions for a docker image. Fixes #2017. #2069
Conversation
… of rock-on JSON definition file. Add image tag to docker rmi command to ensure the correct image is deleted if two different image versions are present on the system.
I now just tested it in both Leap15.1 and Tumbleweed and confirmed it works as expected as well. |
@FroggyFlox Thanks, this looks like a neat fix. I'll have a better look shortly and hopefully we can get it merged soon. Thanks for testing all around. Much appreciated. |
Fixes #2017. |
@FroggyFlox Apologies for the delay on this one. I'm getting through my build infrastructure backlog and should be ready to merge / release this one soon. Thanks again for your effort on this one. Will be great to finally have it in place and released. |
Quick test of how this pull request behaves over an rpm update. storageadmin_dimage: 3.9.2-50
with:
rpm update 3.9.2-50 to 3.9.2-50.2069
But stop, uninstall, re-install exmple json and we have our expected full complement:
|
@FroggyFlox This is an excellent pull request and well done on finding and fixing this bug. And thanks for providing your proof of fix. Very helpful. Much appreciated. Happy to merge and again apologies for taking far too long to get around to this. |
Thanks a lot, @phillxnet, especially for providing testing of its behavior across rpm update... I should have included that as well in my report. |
Note: Although this pull-request (PR) is working as expected after testing of the underlying logic, I still need to test on openSUSE variants so I'm submitting this as Draft for now. I will update once done.
Building on #2014, this pull request proposes to consider the docker container image tag in combination to the image name when parsing a rock-on JSON definition file. This would thus allow the use of different versions (tag) for the same docker container within a given rock-on, or across rock-ons.
Aims & Logic
While both the image name and the tag is taken into account when parsing the information from the rock-on JSON definition file, only the image name is used to select the
DImage
object that needs to be created/updated. As a result, any image tag information from a given image will overwrite the image tag of any pre-existingDImage
object if it shares the same name (i.e. same docker project).This PR fixes this simply by also accounting for the image tag when selecting the
DImage
object to be created/updated.Demonstration
On a Rockstor install freshly updated to upstream master, the following custom rock-on was uploaded to the local
rockons-metastore
:As you can see above, this rock-on is simply designed to start 4 different containers of the same docker project (alpine) but each using a different image version. While only the last json entry was retained previously (as each new image entry was overwriting the previous one), the current PR allows all these containers to be started as intended:
Of note, the image tag information is also accounted for when using the
delete-rockon
script so that the correct image is removed from the system if the script is used.@phillxnet, please note that I also added a few
log=True
flags to somedocker run
commands, in the same "spirit" than your recent PR (#2014). feel free to remove them if you think it's not necessary. I do find it useful when debugging.Testing
Soon...