Skip to content

Commit

Permalink
Incresae timeout (#123)
Browse files Browse the repository at this point in the history
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 <[email protected]>
Co-authored-by: Joe Talerico <[email protected]>
  • Loading branch information
jtaleric and Joe Talerico authored Dec 6, 2023
1 parent 2d00766 commit 5dd5adf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/k8s/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
})
}

0 comments on commit 5dd5adf

Please sign in to comment.