Fix helm for webhook (#129)

* Log all validation attempts

* add app selector for helm deployments
This commit is contained in:
Bobby Brennan
2019-05-24 10:21:38 -04:00
committed by GitHub
parent d5b3b6b4ae
commit f061e0e012
2 changed files with 3 additions and 7 deletions

View File

@@ -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 -}}

View File

@@ -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)
}