Skip to content

Commit

Permalink
Removes extraneous processing
Browse files Browse the repository at this point in the history
  • Loading branch information
bomoko committed Feb 25, 2024
1 parent 0c522ae commit 962e7f9
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions controllers/configmap_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 962e7f9

Please sign in to comment.