From 845fa8127e16ccf55b31ee3137607bf7d4c628b7 Mon Sep 17 00:00:00 2001 From: Dawid Rusnak Date: Mon, 28 Oct 2024 15:50:37 +0100 Subject: [PATCH] fix: restarting pod --- cmd/tcl/kubectl-testkube/devbox/devutils/pods.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/tcl/kubectl-testkube/devbox/devutils/pods.go b/cmd/tcl/kubectl-testkube/devbox/devutils/pods.go index fdd2ce55c8..c923083d6c 100644 --- a/cmd/tcl/kubectl-testkube/devbox/devutils/pods.go +++ b/cmd/tcl/kubectl-testkube/devbox/devutils/pods.go @@ -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{})