diff --git a/Makefile b/Makefile index d0a9ca2d..2f9c55ad 100644 --- a/Makefile +++ b/Makefile @@ -197,7 +197,7 @@ deploy-using-yaml: kubectl apply -f deploy/kubefledged-serviceaccount.yaml kubectl apply -f deploy/kubefledged-clusterrole.yaml kubectl apply -f deploy/kubefledged-clusterrolebinding.yaml - -kubectl delete validatingwebhookconfigurations -l app=kubefledged,component=kubefledged-webhook-server + -kubectl delete validatingwebhookconfigurations -l app=kubefledged kubectl apply -f deploy/kubefledged-validatingwebhook.yaml kubectl apply -f deploy/kubefledged-deployment-webhook-server.yaml kubectl apply -f deploy/kubefledged-service-webhook-server.yaml @@ -241,6 +241,7 @@ remove-kubefledged: remove-operator-and-kubefledged: # Remove kubefledged and the namespace -kubectl delete -f deploy/kubefledged-operator/deploy/crds/charts.helm.kubefledged.io_v1alpha2_kubefledged_cr.yaml + -kubectl delete validatingwebhookconfigurations -l app.kubernetes.io/name=kube-fledged -kubectl delete namespace ${KUBEFLEDGED_NAMESPACE} # Remove the kubefledged operator and the namespace -kubectl delete -f deploy/kubefledged-operator/deploy/operator.yaml diff --git a/deploy/kubefledged-operator/helm-charts/kubefledged/templates/_helpers.tpl b/deploy/kubefledged-operator/helm-charts/kubefledged/templates/_helpers.tpl index 262af0f8..5242d41c 100644 --- a/deploy/kubefledged-operator/helm-charts/kubefledged/templates/_helpers.tpl +++ b/deploy/kubefledged-operator/helm-charts/kubefledged/templates/_helpers.tpl @@ -49,6 +49,7 @@ Selector labels {{- define "kubefledged.selectorLabels" -}} app.kubernetes.io/name: {{ include "kubefledged.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} +app.kubernetes.io/part-of: {{ .Release.Name }} {{- end -}} {{/* diff --git a/deploy/kubefledged-operator/helm-charts/kubefledged/templates/validatingwebhook.yaml b/deploy/kubefledged-operator/helm-charts/kubefledged/templates/validatingwebhook.yaml index 0c1fe243..ab373487 100644 --- a/deploy/kubefledged-operator/helm-charts/kubefledged/templates/validatingwebhook.yaml +++ b/deploy/kubefledged-operator/helm-charts/kubefledged/templates/validatingwebhook.yaml @@ -3,8 +3,10 @@ apiVersion: admissionregistration.k8s.io/v1 kind: ValidatingWebhookConfiguration metadata: name: {{ include "kubefledged.validatingWebhookName" . }} + labels: + {{ include "kubefledged.labels" . | nindent 4 }} annotations: - helm.sh/hook: "pre-install" + helm.sh/hook: "pre-install,pre-upgrade" webhooks: - name: validate-image-cache.kubefledged.io admissionReviewVersions: ["v1beta1", "v1"]