r-darwish / topgrade

Upgrade everything
GNU General Public License v3.0
3.36k stars 160 forks source link

Upgrade podman/docker containers #850

Closed Funky185540 closed 2 years ago

Funky185540 commented 2 years ago

This PR implements automatic updates for all available podmanpodman/docker containers in the user installation (not roots containers). I'm aware of the discussion in #214, so I made the code respect the tags that the containers were initially pulled with to ensure that no semver-breaking changes are performed when a specific tag was checked out initially (Like rust does with Cargo.toml).

The code is still very rough in a lot of places, but I wanted to put it up for discussion before finishing it entirely. If your opinion from #214 still holds, feel free to close the issue immediately.

Standards checklist:

If you developed a feature or a bug fix for someone else and you do not have the means to test it, please tag this person here.

r-darwish commented 2 years ago

@Funky185540 docker support has been requested in #853. Can you make this PR support both docker and podman?

Funky185540 commented 2 years ago

@Funky185540 docker support has been requested in #853. Can you make this PR support both docker and podman?

Can't make any promises, but that was the idea for the long run anyways. I'll look into it!

Funky185540 commented 2 years ago

Theoretically it should now work with both podman and docker. Once I know what to do about the use of debug!/warning!/error! and I have the feedback from #853 this is good to go from my point of view. :)

Edit:

And we'll have to discuss whether this should update roots containers as well, which would require sudo access, of course.

Funky185540 commented 2 years ago

I think it can be made much simpler if no error will cause the function to quit. This is similar to what we do when pulling git repositories. If any repo fails updating then success will be made false and the step will eventually be marked as failed, but I don't think we should stop trying the rest of the repos in any case.

That's absolutely right, and it was the initial idea in any case, hence I introduced the success variable. I just ignored that while working out the error handling... Additional benefit: This makes the whole error handling routine much more compact