Skip to content

Commit

Permalink
feat: only call detroy service when service was deployed (#221)
Browse files Browse the repository at this point in the history
Signed-off-by: Smuu <[email protected]>
  • Loading branch information
smuu authored Dec 20, 2023
1 parent 1f4d050 commit dcd528e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkg/knuu/instance_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit dcd528e

Please sign in to comment.