Skip to content

Commit

Permalink
test: don't add owner ref if canary object doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
adityathebe authored and moshloop committed Nov 15, 2024
1 parent 28ff18d commit 7bb826f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions api/v1/checks.go
Original file line number Diff line number Diff line change
Expand Up @@ -979,6 +979,11 @@ type KubernetesResourceCheck struct {
}

func (c *KubernetesResourceCheck) SetCanaryOwnerReference(id, name string) {
if id == "" || name == "" {
// if the canary isn't persisted
return
}

canaryOwnerRef := metav1.OwnerReference{
APIVersion: "canaries.flanksource.com/v1",
Kind: "Canary",
Expand Down

0 comments on commit 7bb826f

Please sign in to comment.