Skip to content

Commit

Permalink
CreateOrUpdateDeployment should use deployment to update (#1929)
Browse files Browse the repository at this point in the history
In CreateOrUpdateDeployment, the function will return when Create succeeds,
and call Update when create fails. But Create will return an empty deployment
object d, if we use d, Update will return error that resource name is empty.
  • Loading branch information
liu4480 authored Mar 3, 2021
1 parent 347de82 commit bb794d0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/e2e/k8s_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ func (k *KubernetesUtils) CreateOrUpdateDeployment(ns, deploymentName string, re
}

log.Debugf("Unable to create deployment %s in ns %s, let's try update instead", deployment.Name, ns)
d, err = k.clientset.AppsV1().Deployments(ns).Update(context.TODO(), d, metav1.UpdateOptions{})
d, err = k.clientset.AppsV1().Deployments(ns).Update(context.TODO(), deployment, metav1.UpdateOptions{})
if err != nil {
log.Debugf("Unable to update deployment %s in ns %s: %s", deployment.Name, ns, err)
}
Expand Down

0 comments on commit bb794d0

Please sign in to comment.