Skip to content

Commit

Permalink
fix: unused variable failure warning in webhooks file (#916)
Browse files Browse the repository at this point in the history
Signed-off-by: amitamrutiya2210 <amitamrutiya2210@gmail.com>
Co-authored-by: Alex Jones <alexsimonjones@gmail.com>
  • Loading branch information
amitamrutiya and AlexsJones committed Feb 13, 2024
1 parent 3c8d9d4 commit 3f0964a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/analyzer/mutating_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ func (MutatingWebhookAnalyzer) Analyze(a common.Analyzer) ([]common.Result, erro
},
},
})
preAnalysis[fmt.Sprintf("%s/%s", webhookConfig.Namespace, webhook.Name)] = common.PreAnalysis{
MutatingWebhook: webhookConfig,
FailureDetails: failures,
}
AnalyzerErrorsMetric.WithLabelValues(kind, webhook.Name, webhookConfig.Namespace).Set(float64(len(failures)))
continue
}

Expand Down
5 changes: 5 additions & 0 deletions pkg/analyzer/validating_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ func (ValidatingWebhookAnalyzer) Analyze(a common.Analyzer) ([]common.Result, er
},
},
})
preAnalysis[fmt.Sprintf("%s/%s", webhookConfig.Namespace, webhook.Name)] = common.PreAnalysis{
ValidatingWebhook: webhookConfig,
FailureDetails: failures,
}
AnalyzerErrorsMetric.WithLabelValues(kind, webhook.Name, webhookConfig.Namespace).Set(float64(len(failures)))
continue
}

Expand Down

0 comments on commit 3f0964a

Please sign in to comment.