Skip to content

Commit

Permalink
fix: restarting pod
Browse files Browse the repository at this point in the history
  • Loading branch information
rangoo94 committed Oct 28, 2024
1 parent c953c53 commit 845fa81
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/tcl/kubectl-testkube/devbox/devutils/pods.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ func (p *PodObject) CreateService(ctx context.Context, ports ...corev1.ServicePo
svc, err := p.clientSet.CoreV1().Services(p.namespace).Create(ctx, request, metav1.CreateOptions{})
if errors.IsAlreadyExists(err) {
err = p.clientSet.CoreV1().Services(p.namespace).Delete(ctx, request.Name, metav1.DeleteOptions{})
if err != nil {
if err != nil && !errors.IsNotFound(err) {
return errors2.Wrap(err, "failed to delete existing service")
}
svc, err = p.clientSet.CoreV1().Services(p.namespace).Create(ctx, request, metav1.CreateOptions{})
Expand Down

0 comments on commit 845fa81

Please sign in to comment.