Skip to content

Commit 07930a5

Browse files
committed
Add terminationGracePeriodSeconds support to user and sidecar container probes (#15823)
1 parent f3a653f commit 07930a5

File tree

3 files changed

+258
-196
lines changed

3 files changed

+258
-196
lines changed

pkg/apis/serving/fieldmask.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import (
2424
"slices"
2525

2626
corev1 "k8s.io/api/core/v1"
27+
2728
"knative.dev/serving/pkg/apis/config"
2829
)
2930

@@ -384,6 +385,7 @@ func ProbeMask(in *corev1.Probe) *corev1.Probe {
384385
out.PeriodSeconds = in.PeriodSeconds
385386
out.SuccessThreshold = in.SuccessThreshold
386387
out.FailureThreshold = in.FailureThreshold
388+
out.TerminationGracePeriodSeconds = in.TerminationGracePeriodSeconds
387389

388390
return out
389391
}

pkg/apis/serving/fieldmask_test.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import (
2424
"k8s.io/apimachinery/pkg/util/intstr"
2525
"knative.dev/pkg/kmp"
2626
"knative.dev/pkg/ptr"
27+
2728
"knative.dev/serving/pkg/apis/config"
2829
)
2930

@@ -395,12 +396,13 @@ func TestVolumeMountMask_FeatMountPropagation(t *testing.T) {
395396

396397
func TestProbeMask(t *testing.T) {
397398
want := &corev1.Probe{
398-
ProbeHandler: corev1.ProbeHandler{},
399-
InitialDelaySeconds: 42,
400-
TimeoutSeconds: 42,
401-
PeriodSeconds: 42,
402-
SuccessThreshold: 42,
403-
FailureThreshold: 42,
399+
ProbeHandler: corev1.ProbeHandler{},
400+
InitialDelaySeconds: 42,
401+
TimeoutSeconds: 42,
402+
PeriodSeconds: 42,
403+
SuccessThreshold: 42,
404+
FailureThreshold: 42,
405+
TerminationGracePeriodSeconds: ptr.Int64(30),
404406
}
405407
in := want
406408

0 commit comments

Comments
 (0)