From dcd528e594c1b62aa817bf71945820e1ea6e9d0b Mon Sep 17 00:00:00 2001 From: smuu <18609909+smuu@users.noreply.github.com> Date: Wed, 20 Dec 2023 16:06:56 +0100 Subject: [PATCH] feat: only call detroy service when service was deployed (#221) Signed-off-by: Smuu <18609909+Smuu@users.noreply.github.com> --- pkg/knuu/instance_helper.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkg/knuu/instance_helper.go b/pkg/knuu/instance_helper.go index 926cc78..02b545a 100644 --- a/pkg/knuu/instance_helper.go +++ b/pkg/knuu/instance_helper.go @@ -288,9 +288,11 @@ func (i *Instance) destroyResources() error { return fmt.Errorf("error destroying files for instance '%s': %w", i.k8sName, err) } } - err := i.destroyService() - if err != nil { - return fmt.Errorf("error destroying service for instance '%s': %w", i.k8sName, err) + if i.kubernetesService != nil { + err := i.destroyService() + if err != nil { + return fmt.Errorf("error destroying service for instance '%s': %w", i.k8sName, err) + } } // disable network only for non-sidecar instances