diff --git a/pkg/controllers/canary_controller.go b/pkg/controllers/canary_controller.go index 97f1351be..004347f8e 100644 --- a/pkg/controllers/canary_controller.go +++ b/pkg/controllers/canary_controller.go @@ -229,7 +229,7 @@ func (r *CanaryReconciler) Report() { var canary v1.Canary err := r.Get(gocontext.Background(), payload.NamespacedName, &canary) if err != nil { - r.Log.Error(err, "failed to get canary", "canary", payload.NamespacedName) + r.Log.Error(err, "failed to get canary while reporting", "canary", payload.NamespacedName) continue } diff --git a/pkg/jobs/canary/status.go b/pkg/jobs/canary/status.go index dfb67f01a..f993690ea 100644 --- a/pkg/jobs/canary/status.go +++ b/pkg/jobs/canary/status.go @@ -2,6 +2,7 @@ package canary import ( "fmt" + "strings" "time" v1 "github.com/flanksource/canary-checker/api/v1" @@ -20,6 +21,11 @@ func updateCanaryStatusAndEvent(ctx context.Context, canary v1.Canary, results [ return } + // Skip function if canary is not sourced from Kubernetes CRD + if !strings.HasPrefix(canary.Annotations["source"], "kubernetes") { + return + } + var checkStatus = make(map[string]*v1.CheckStatus) var duration int64 var messages, errors []string