From 16df6d4bdcf9b9404c758846edd94c307a3b5f8c Mon Sep 17 00:00:00 2001 From: Blaize M Kaye Date: Mon, 26 Feb 2024 11:36:27 +1300 Subject: [PATCH] Fixes thinko and gets the labels from the right place --- controllers/configmap_controller.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/controllers/configmap_controller.go b/controllers/configmap_controller.go index b9a5c59..211b1d4 100644 --- a/controllers/configmap_controller.go +++ b/controllers/configmap_controller.go @@ -97,13 +97,13 @@ func (r *ConfigMapReconciler) Reconcile(ctx context.Context, req ctrl.Request) ( // insightsType is a way for us to classify incoming insights data, passing insightsType := "unclassified" - if _, ok := labels["insights.lagoon.sh/type"]; ok { - insightsType = labels["insights.lagoon.sh/type"] + if _, ok := configMap.Labels["insights.lagoon.sh/type"]; ok { + insightsType = configMap.Labels["insights.lagoon.sh/type"] log.Info(fmt.Sprintf("Found insights.lagoon.sh/type:%v", insightsType)) } else { // insightsType can be determined by the incoming data if _, ok := labels["lagoon.sh/insightsType"]; ok { - switch labels["lagoon.sh/insightsType"] { + switch configMap.Labels["lagoon.sh/insightsType"] { case ("sbom-gz"): log.Info("Inferring insights type of sbom") insightsType = "sbom"