From 5dd5adfdbb4f91e1f5106e590546cb80d318e726 Mon Sep 17 00:00:00 2001 From: "Joe Talerico (rook)" Date: Wed, 6 Dec 2023 15:57:52 -0500 Subject: [PATCH] Incresae timeout (#123) CI is seeing failures destroying deployments due to the timeout. Increasing the timeout and setting the delete gracePeriod to zero. fixes #122 Signed-off-by: Joe Talerico Co-authored-by: Joe Talerico --- pkg/k8s/kubernetes.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/k8s/kubernetes.go b/pkg/k8s/kubernetes.go index 71ae4f6e..681a9a7b 100644 --- a/pkg/k8s/kubernetes.go +++ b/pkg/k8s/kubernetes.go @@ -423,7 +423,7 @@ func WaitForReady(c *kubernetes.Clientset, dp DeploymentParams) (bool, error) { func WaitForDelete(c *kubernetes.Clientset, dp appsv1.Deployment) (bool, error) { log.Infof("⏰ Waiting for %s Deployment to deleted...", dp.Name) // Timeout in seconds - timeout := int64(180) + timeout := int64(300) dw, err := c.AppsV1().Deployments(dp.Namespace).Watch(context.TODO(), metav1.ListOptions{TimeoutSeconds: &timeout}) if err != nil { return false, err @@ -666,7 +666,9 @@ func DestroyService(client *kubernetes.Clientset, serv apiv1.Service) error { // DestroyDeployment cleans up a specific deployment from a namespace func DestroyDeployment(client *kubernetes.Clientset, dp appsv1.Deployment) error { deletePolicy := metav1.DeletePropagationForeground + gracePeriod := int64(0) return client.AppsV1().Deployments(dp.Namespace).Delete(context.TODO(), dp.Name, metav1.DeleteOptions{ - PropagationPolicy: &deletePolicy, + PropagationPolicy: &deletePolicy, + GracePeriodSeconds: &gracePeriod, }) }