Remove unneeded lookup function from upgrade hook (#104)
Those upgrading to 0.17.0 should no longer need the code to check for the old webhook. Signed-off-by: Kevin Fox <[email protected]> Co-authored-by: Faisal Memon <[email protected]>
This commit is contained in:
@@ -1,9 +1,4 @@
|
|||||||
{{- if eq ((dig "installAndUpgradeHooks" "enabled" .Values.controllerManager.installAndUpgradeHook.enabled .Values.global) | toString) "true" }}
|
{{- if eq ((dig "installAndUpgradeHooks" "enabled" .Values.controllerManager.installAndUpgradeHook.enabled .Values.global) | toString) "true" }}
|
||||||
{{- $webhookname := printf "%s-%s-webhook" .Release.Namespace (include "spire-controller-manager.fullname" .) }}
|
|
||||||
{{- $oldwebhookname := printf "%s-webhook" (include "spire-controller-manager.fullname" .) }}
|
|
||||||
{{- if not (lookup "admissionregistration.k8s.io/v1" "ValidatingWebhookConfiguration" "" $webhookname) }}
|
|
||||||
{{- $webhookname = $oldwebhookname }}
|
|
||||||
{{- end }}
|
|
||||||
{{- if eq (.Values.controllerManager.enabled | toString) "true" }}
|
{{- if eq (.Values.controllerManager.enabled | toString) "true" }}
|
||||||
{{- if eq .Values.controllerManager.validatingWebhookConfiguration.failurePolicy "Fail" }}
|
{{- if eq .Values.controllerManager.validatingWebhookConfiguration.failurePolicy "Fail" }}
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
@@ -27,7 +22,7 @@ metadata:
|
|||||||
rules:
|
rules:
|
||||||
- apiGroups: ["admissionregistration.k8s.io"]
|
- apiGroups: ["admissionregistration.k8s.io"]
|
||||||
resources: ["validatingwebhookconfigurations"]
|
resources: ["validatingwebhookconfigurations"]
|
||||||
resourceNames: [{{ $webhookname | quote }}]
|
resourceNames: [{{ printf "%s-%s-webhook" .Release.Namespace (include "spire-controller-manager.fullname" .) | quote }}]
|
||||||
verbs: ["get", "patch"]
|
verbs: ["get", "patch"]
|
||||||
---
|
---
|
||||||
kind: ClusterRoleBinding
|
kind: ClusterRoleBinding
|
||||||
@@ -73,7 +68,7 @@ spec:
|
|||||||
args:
|
args:
|
||||||
- patch
|
- patch
|
||||||
- validatingwebhookconfiguration
|
- validatingwebhookconfiguration
|
||||||
- {{ $webhookname }}
|
- {{ printf "%s-%s-webhook" .Release.Namespace (include "spire-controller-manager.fullname" .) }}
|
||||||
- --type=strategic
|
- --type=strategic
|
||||||
- -p
|
- -p
|
||||||
- |
|
- |
|
||||||
|
|||||||
Reference in New Issue
Block a user