fix(kube): export container healthcheck as LivenessProbe in generate kube#28415
Closed
DeveshB-1 wants to merge 2 commits into
Closed
fix(kube): export container healthcheck as LivenessProbe in generate kube#28415DeveshB-1 wants to merge 2 commits into
DeveshB-1 wants to merge 2 commits into
Conversation
…kube Signed-off-by: Devesh B <98201065+DeveshB-1@users.noreply.github.com>
Signed-off-by: Devesh B <98201065+DeveshB-1@users.noreply.github.com>
Honny1
requested changes
Mar 31, 2026
Member
Honny1
left a comment
There was a problem hiding this comment.
I will do a review after CI is green, except for flakes.
+ ./bin/golangci-lint run --build-tags=apparmor,seccomp,selinux
test/e2e/generate_kube_test.go:2037:1: File is not properly formatted (gofumpt)
^
test/e2e/generate_kube_test.go:2038:1: File is not properly formatted (goimports)
})
^
mheon
reviewed
Mar 31, 2026
| return nil | ||
| } | ||
| // Test[0] is the type: NONE, CMD, or CMD-SHELL. NONE means disabled. | ||
| if hc.Test[0] == define.HealthConfigTestNone { |
Member
There was a problem hiding this comment.
Combine this with the first conditional
mheon
reviewed
Mar 31, 2026
| } | ||
| probe := &v1.Probe{ | ||
| Handler: v1.Handler{ | ||
| Exec: &v1.ExecAction{Command: hc.Test[1:]}, |
Member
There was a problem hiding this comment.
Shouldn't we be handling CMD and CMD-SHELL separately here? In CMD-SHELL we want to wrap this with a shell
mheon
reviewed
Mar 31, 2026
| Expect(probe.InitialDelaySeconds).To(Equal(int32(2))) | ||
| }) | ||
|
|
||
| }) No newline at end of file |
Contributor
|
Hello @DeveshB-1, I'd love to see this feature merged. Would you be alright with me taking over the issue? |
Member
|
Since the last activity was about a month ago, I think you can take this over, @givensuman. |
6 tasks
Member
|
Closing in favor of #28664 |
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.
When a container is created with
--health-cmd,podman kube generatedid not include the healthcheck in the generated YAML. The
LivenessProbefield in the output pod spec was always absent.
Fix: add
healthConfigToProbe()inlibpod/kube.gothat converts amanifest.Schema2HealthConfigto av1.Probe, and call it fromcontainerToV1Containerto populateLivenessProbe.The mapping is straightforward:
Test[1:]->exec.command(Test[0] is the type: CMD or CMD-SHELL)Interval->periodSecondsTimeout->timeoutSecondsRetries->failureThresholdStartPeriod->initialDelaySecondsContainers with
NONEhealthcheck (disabled) produce no probe.Fixes: #22095
Signed-off-by: Devesh B 98201065+DeveshB-1@users.noreply.github.com