Repository navigation
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #17 +/- ##
==========================================
+ Coverage 42.88% 43.09% +0.21%
==========================================
Files 26 27 +1
Lines 6564 6641 +77
Branches 1122 1123 +1
==========================================
+ Hits 2815 2862 +47
- Misses 3494 3524 +30
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:
|
a17b27c to
b7b539c
Compare
There was a problem hiding this comment.
Overall the change looks ok to me, though saltstack/salt#68960 was merged only in master, which means it'll be available in 3009.
In that case I'd prefer to wait for 3009 release with this PR (it has no effect otherwise). If you backport it to 3008, then I've left two minor comments, after which we can merge this.
When the normal run produces only lightweight changes (such as a network reconnect) and does not recreate or restart the container, return `force_mod_watch: True` so the state system still invokes `mod_watch` for a watched trigger. Previously the watched-state trigger was silently dropped in this case - for example, a watched config-file change would not force-replace the container if `docker_container.running` happened to also reconnect a network during the same run. Heavy-change keys (`container_id`, `state`, `image`, `forced_update`) already indicate the container was recreated or restarted, so `mod_watch` is not needed in those cases. The `force_mod_watch` return key is handled by the state system since saltstack/salt#68960 (currently on Salt's master branch). Older Salt versions do not act on it. See: saltstack/salt#68958
Use an allow list instead of a block list: docker_container.running now returns force_mod_watch only when its only change was reconnecting networks, and never in test mode. This also stops a mod_watch run which sends a signal from returning the flag. The comment and the changelog now say that the flag has an effect only with Salt versions which include saltstack/salt#68960.
b7b539c to
19e1718
Compare
|
Thanks for the review! I applied both suggestions. About waiting for 3009: since the Docker code now lives in this extension, which is released independently of Salt and supports
The noxfile already supports I also rebased the branch onto current |
The functional test read force_mod_watch from the state's result, which works only while Salt leaves the key in results. saltstack/salt#70972 removes it from every result, so the test now checks the change which the flag depends on: connecting a network reports only network changes, and the container keeps its Id and its start time. The unit tests check the flag itself.
|
I pushed one more commit: the functional test no longer reads The reason is saltstack/salt#70972, which I opened while testing this PR against Salt master: it removes |
When the normal run produces only lightweight changes (such as a network reconnect) and does not recreate or restart the container, return
force_mod_watch: Trueso the state system still invokesmod_watchfor a watched trigger. Previously the watched-state trigger was silently dropped in this case - for example, a watched config-file change would not force-replace the container ifdocker_container.runninghappened to also reconnect a network during the same run.Heavy-change keys (
container_id,state,image,forced_update) already indicate the container was recreated or restarted, somod_watchis not needed in those cases.The
force_mod_watchreturn key is handled by the state system since saltstack/salt#68960 (currently on Salt's master branch). Older Salt versions do not act on it.See: saltstack/salt#68958
Merge requirements satisfied?
[NOTICE] Bug fixes or new features require tests.
Commits signed with GPG?
No