From 40c811e2d9173eb2c3c2af2bfb324d115db71d05 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 Kubernetes-commit: 7c764c8550121b48a6e2678700b6a80fa7d3e2f0 --- pkg/drain/drain.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/pkg/drain/drain.go b/pkg/drain/drain.go index 8738df0d0..524850dee 100644 --- a/pkg/drain/drain.go +++ b/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