Repository navigation
Fix docker_container.running not replacing the container when an explicitly set hostname is added, changed or removed - #14
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #14 +/- ##
==========================================
+ Coverage 42.88% 43.22% +0.34%
==========================================
Files 26 27 +1
Lines 6564 6665 +101
Branches 1122 1125 +3
==========================================
+ Hits 2815 2881 +66
- Misses 3494 3529 +35
Partials 255 255
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Is this a cherry-pick from Salt, or new commits? I saw you mentioned missing commits in one of the issues, but neither 3006.x [0] nor 3007.x has these changes. [0] https://github.com/saltstack/salt/blob/3006.x/salt/states/docker_container.py#L1859 |
|
These are new commits. They are from my fork where I was collecting fixes I made while this repo was not populated with docker code. Now that it is, I decided to propose those fixes upstream (i.e., here). The ones I listed as missing commits I didn't make PRs for. I can, but I thought that it is probably easier for you to just do those. |
|
Than you for the PR. I was thinking about this use case So you first let dockermod to set a hostname based on the container ID, later you actively rename it for some task and then you want to have back the default behaviour. I think in |
84ff343 to
46a62b9
Compare
e46e3ed to
6c19488
Compare
|
You are right. My fix fixed on part, but then opened another issue. I think it is all now addressed. |
When the user does not explicitly set a hostname, Docker auto-assigns one based on the container's ID, so the existing and temporary containers always disagree on Hostname even when nothing has actually changed. In that case we must ignore Hostname to avoid spurious recreations. When the user has set a hostname, we need to compare it so that changing the "hostname" argument triggers a container replacement.
Merge requirements satisfied?
[NOTICE] Bug fixes or new features require tests.
Commits signed with GPG?
No