From 7c764c8550121b48a6e2678700b6a80fa7d3e2f0 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Mon, 23 Nov 2020 17:46:14 +0000 Subject: [PATCH] Comment default behaviour of GracePeriodSeconds It took me a while to spot this subtlety. Signed-off-by: Bryan Boreham --- staging/src/k8s.io/kubectl/pkg/drain/drain.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/staging/src/k8s.io/kubectl/pkg/drain/drain.go b/staging/src/k8s.io/kubectl/pkg/drain/drain.go index 8738df0d0980..524850dee86f 100644 --- a/staging/src/k8s.io/kubectl/pkg/drain/drain.go +++ b/staging/src/k8s.io/kubectl/pkg/drain/drain.go @@ -46,10 +46,15 @@ const ( // Helper contains the parameters to control the behaviour of drainer type Helper struct { - Ctx context.Context - Client kubernetes.Interface - Force bool - GracePeriodSeconds int + Ctx context.Context + Client kubernetes.Interface + Force bool + + // GracePeriodSeconds is how long to wait for a pod to terminate. + // IMPORTANT: 0 means "delete immediately"; set to a negative value + // to use the pod's terminationGracePeriodSeconds. + GracePeriodSeconds int + IgnoreAllDaemonSets bool Timeout time.Duration DeleteEmptyDirData bool