mirror of
https://github.com/FairwindsOps/polaris.git
synced 2026-05-09 10:47:05 +00:00
Fix helm for webhook (#129)
* Log all validation attempts * add app selector for helm deployments
This commit is contained in:
@@ -35,9 +35,8 @@ Create chart name and version as used by the chart label.
|
||||
Standard labels
|
||||
*/}}
|
||||
{{- define "polaris.labels" -}}
|
||||
{{- if .Values.templateOnly -}}
|
||||
app: {{ include "polaris.name" . }}
|
||||
{{- else -}}
|
||||
{{- if not .Values.templateOnly }}
|
||||
app.kubernetes.io/name: {{ include "polaris.name" . }}
|
||||
helm.sh/chart: {{ include "polaris.chart" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
@@ -49,9 +48,8 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
Standard selector
|
||||
*/}}
|
||||
{{- define "polaris.selectors" -}}
|
||||
{{- if .Values.templateOnly -}}
|
||||
app: {{ include "polaris.name" . }}
|
||||
{{- else -}}
|
||||
{{- if not .Values.templateOnly }}
|
||||
app.kubernetes.io/name: {{ include "polaris.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- end -}}
|
||||
|
||||
@@ -109,11 +109,9 @@ func (v *Validator) Handle(ctx context.Context, req types.Request) types.Respons
|
||||
|
||||
if podResult.Summary.Totals.Errors > 0 {
|
||||
allowed = false
|
||||
logrus.Infof("%d validation errors found when validating %s", podResult.Summary.Totals.Errors, podResult.Name)
|
||||
|
||||
reason = getFailureReason(podResult)
|
||||
}
|
||||
|
||||
logrus.Infof("%d validation errors found when validating %s", podResult.Summary.Totals.Errors, podResult.Name)
|
||||
return admission.ValidationResponse(allowed, reason)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user