Export container healthcheck as LivenessProbe in generate kube#28664
Open
givensuman wants to merge 1 commit into
Open
Export container healthcheck as LivenessProbe in generate kube#28664givensuman wants to merge 1 commit into
givensuman wants to merge 1 commit into
Conversation
Member
|
@givensuman (not a review) rebase on main to get past Mac OS arm64 issue. |
Member
|
also, please consider squashing your commits and and running |
ae7241a to
b99948c
Compare
b99948c to
c821c01
Compare
mheon
reviewed
May 8, 2026
mheon
reviewed
May 8, 2026
c821c01 to
409d5c8
Compare
…kube Co-authored-by: givensuman <givensuman@duck.com> Signed-off-by: Devesh B <98201065+DeveshB-1@users.noreply.github.com> Signed-off-by: givensuman <givensuman@duck.com>
409d5c8 to
b7e885a
Compare
Honny1
requested changes
May 11, 2026
Member
Honny1
left a comment
There was a problem hiding this comment.
I have some comments. Also, don't forget to add a release note and Fixes: to commit msg.
| probe := pod.Spec.Containers[0].LivenessProbe | ||
| Expect(probe).ToNot(BeNil(), "LivenessProbe should be set when container has a healthcheck") | ||
| Expect(probe.Exec).ToNot(BeNil()) | ||
| Expect(probe.Exec.Command).To(ContainElement(ctr.healthCmdExpect)) |
Member
There was a problem hiding this comment.
Suggested change
| Expect(probe.Exec.Command).To(ContainElement(ctr.healthCmdExpect)) | |
| Expect(probe.Exec.Command).To(Equal([]string{"/bin/sh", "-c", "/bin/true"})) |
| testCases := []struct { | ||
| name string | ||
| healthCmd string | ||
| healthCmdExpect string |
Member
There was a problem hiding this comment.
The healthCmdExpect should be []string. See my suggestion of assert. (It is not correct.)
| FailureThreshold: int32(hc.Retries), | ||
| } | ||
|
|
||
| if hc.Test[0] == define.HealthConfigTestCmdShell { |
Member
There was a problem hiding this comment.
I would use switch something like this:
switch hc.Test[0] {
case define.HealthConfigTestCmd:
cmd = hc.Test[1:]
case define.HealthConfigTestCmdShell:
cmd = append([]string{"/bin/sh", "-c"}, hc.Test[1:]...)
default:
return nil
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist
Ensure you have completed the following checklist for your pull request to be reviewed:
commits. (
git commit -s). (If needed, usegit commit -s --amend). The author email must matchthe sign-off email address. See CONTRIBUTING.md
for more information.
Fixes: #00000in commit message (if applicable)make validatepr(format/lint checks)Noneif no user-facing changes)Does this PR introduce a user-facing change?
This PR aims to supersede stale PR #28415 and close #22095, implementing maintainer comments.
If approved I plan to squash down the commits and add myself as co-signer.