-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
podman wait: support healthy/unhealthy #18974
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vrothberg The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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.
Pushed too early. Will still fail on remote but reviews are appreciated nonetheless.
switch condition { | ||
case define.ContainerStateExited, define.ContainerStateStopped: | ||
waitForExit = true | ||
for _, rawCondition := range conditions { |
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.
Probably want to sanitize these (lowercase them) before this.
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.
That would be a change in behavior. Podman errors on --condition=Exited
for instance.
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.
I feel like fixing that would be more of a bugfix than anything, but I won't hold up this PR over it.
While reading the code I found the man page to be lacking some information that I found worth mentioning and clarifying. In particular, how the command behaves with respect to exit codes and when more than one condition is specified. Signed-off-by: Valentin Rothberg <[email protected]>
Massage the internal APIs to use a string slice instead of a state slice for passing wait conditions. This paves the way for waiting on non-state conditions such as "healthy". Signed-off-by: Valentin Rothberg <[email protected]>
Good to merge from my end |
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.
please update AutocompleteWaitCondition
to make sure the shell autocompletion shows the new values.
Support two new wait conditions, "healthy" and "unhealthy". This further paves the way for integrating sdnotify with health checks which is currently being tracked in containers#6160. Fixes: containers#13627 Signed-off-by: Valentin Rothberg <[email protected]>
✔️ |
LGTM |
/lgtm |
/hold cancel |
Broken into 3 commits as it required some massaging in the backend.
Does this PR introduce a user-facing change?