From 962e7f95886918959406e891392b8af5b56f8714 Mon Sep 17 00:00:00 2001 From: Blaize M Kaye Date: Mon, 26 Feb 2024 10:24:03 +1300 Subject: [PATCH] Removes extraneous processing --- controllers/configmap_controller.go | 7 ------- 1 file changed, 7 deletions(-) diff --git a/controllers/configmap_controller.go b/controllers/configmap_controller.go index 7505368..4fedbde 100644 --- a/controllers/configmap_controller.go +++ b/controllers/configmap_controller.go @@ -37,7 +37,6 @@ import ( const InsightsLabel = "lagoon.sh/insightsType" const InsightsUpdatedAnnotationLabel = "lagoon.sh/insightsProcessed" const InsightsWriteDeferred = "lagoon.sh/insightsWriteDeferred" -const InsightsCMErrorLabel = "insights.lagoon.sh/error" type LagoonInsightsMessage struct { Payload map[string]string `json:"payload"` @@ -115,11 +114,6 @@ func (r *ConfigMapReconciler) Reconcile(ctx context.Context, req ctrl.Request) ( if insightsType != "sbom" && insightsType != "inspect" { //// we mark this configMap as bad, and log an error log.Error(nil, fmt.Sprintf("insightsType '%v' unrecognized - rejecting configMap", insightsType)) - err := cmlib.LabelCM(ctx, r.Client, configMap, InsightsCMErrorLabel, "invalid-type") - if err != nil { - log.Error(err, "Unable to update configmap") - return ctrl.Result{}, err - } } else { // Here we attempt to process types using the new name structure @@ -183,7 +177,6 @@ func insightLabelsOnlyPredicate() predicate.Predicate { UpdateFunc: func(event event.UpdateEvent) bool { if labelExists(InsightsLabel, event.ObjectNew) && !labelExists(InsightsWriteDeferred, event.ObjectNew) && - !labelExists(InsightsCMErrorLabel, event.ObjectNew) && // We don't want to respond to errored out CMs !insightsProcessedAnnotationExists(event.ObjectNew) { return true }