-
Notifications
You must be signed in to change notification settings - Fork 123
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 healthcheck override without test option #847
Allow healthcheck override without test option #847
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution! Unfortunately this is a breaking change.
Maybe this could be done instead by adding a new option keep_image_test
(type boolean, default false
), which when set to true
ignores the test
value?
Thanks to you for maintaining this module! Indeed, I realised that few moment later after creating this PR... I like this way to keep closest to docker cli behavior and this allow to do both keeping original test image by default or explicitly set ["NONE"] to unset it. Moreover, I saw there is only one rarely case to get the breaking change.
=> "Healthcheck" {"Test": ["NONE"]}
=> "Healthcheck" {"Test": ["NONE"]} (actual) This makes no sense to me because why adding test options like To handle this, maybe first reduce the breaking area to the omit case only, like I try in this commit by forwarding the real test value. (not 100% sure of potential side effect) And if it's not enougth, maybe a What do you think ? |
This seems to have unexpected side effect based on some failing tests, I'll wait your feedback on my previous comment before going deep on it. |
I agree that it doesn't make sense, but it's still a breaking change of a behavior that has been this way for quite a few years. Someone might rely on this, and suddenly their deployments change (potentially in a fatal way). Such changes need to come with a longer deprecation period where warnings are shown to the users. Since nobody wants to wait years to be able to use the new behavior, the best course of action is usually to add a new option to control this behavior which defaults to the current behavior, then eventually deprecate the default behavior (showing deprecation warnings in situation this results in a change), and eventually change the default.
Such an option would be best. A general Having something inside the |
Thanks for taking the time to explain why this way is still not possible and I understand better when you immediately suggested adding a new option. I thought there were special cases especially when this one seems to me very closer to a bugfix, even the documentation example may suggest that you absolutely should set ["NONE"] to the test option to remove the container healthcheck and that omitting this value should not have any effect.
In reality, all of these unset the healtcheck:
However I'm not doing this for myself but for the community and you know better than me what's best for the project so I'm totally fine to add a Last question before making the changes, should I keep only the initial commit behavior or it's better to reduce to the omit case only like my second commit did ?
=> "Healthcheck" {"Test": None}
=> "Healthcheck" {"Test": ["NONE"]} (still keep the actual behavior)
=> "Healthcheck" {"Test": None} |
I would use the second commit's behavior. If the user explicitly provides a value for |
600c99c
to
23ed74e
Compare
Seems good for me but not sure about some failing tests, could you review this again please. Thanks in advance for your time. |
afeacf2
to
c75f346
Compare
c75f346
to
ab409fd
Compare
Co-authored-by: Felix Fontein <[email protected]>
Co-authored-by: Felix Fontein <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want you can also add a similar change to the docker_swarm_service
module. But maybe let's get this merged first so it's definitely part of the next release (which happens this weekend) :)
5016a96
into
ansible-collections:main
@x4rd0o1Vtx thank you very much for your contribution! |
My pleasure and thanks for your time again ! |
SUMMARY
Change healthcheck container options while keeping original image test.
ex:
ISSUE TYPE
COMPONENT NAME
docker_api