diff --git a/Makefile b/Makefile index 878ba3a0..0e3223a6 100644 --- a/Makefile +++ b/Makefile @@ -63,7 +63,7 @@ manifests: controller-gen kustomize yq ## Generate WebhookConfiguration, Cluster mkdir -p charts/moco/templates/generated/crds/ $(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases $(KUSTOMIZE) build config/crd -o config/crd/tests # Outputs static CRDs for use with Envtest. - $(KUSTOMIZE) build config/kustomize-to-helm/overlays/templates | $(YQ) e "." - > charts/moco/templates/generated/generated.yaml + $(KUSTOMIZE) build config/kustomize-to-helm/overlays/templates | $(YQ) ". | del(select(.kind==\"ValidatingAdmissionPolicy\" or .kind==\"ValidatingAdmissionPolicyBinding\").metadata.namespace)" - > charts/moco/templates/generated/generated.yaml # Manually remove namespaces because the API version supported by kustomize is out of date. echo '{{- if .Values.crds.enabled }}' > charts/moco/templates/generated/crds/moco_crds.yaml $(KUSTOMIZE) build config/kustomize-to-helm/overlays/crds | $(YQ) e "." - >> charts/moco/templates/generated/crds/moco_crds.yaml echo '{{- end }}' >> charts/moco/templates/generated/crds/moco_crds.yaml diff --git a/charts/moco/templates/generated/generated.yaml b/charts/moco/templates/generated/generated.yaml index c37055d1..ac566b9b 100644 --- a/charts/moco/templates/generated/generated.yaml +++ b/charts/moco/templates/generated/generated.yaml @@ -381,7 +381,6 @@ metadata: app.kubernetes.io/version: '{{ .Chart.AppVersion }}' helm.sh/chart: '{{ include "moco.chart" . }}' name: moco-delete-validator - namespace: '{{ .Release.Namespace }}' spec: failurePolicy: Fail matchConstraints: @@ -410,7 +409,6 @@ metadata: app.kubernetes.io/version: '{{ .Chart.AppVersion }}' helm.sh/chart: '{{ include "moco.chart" . }}' name: moco-delete-validator - namespace: '{{ .Release.Namespace }}' spec: policyName: moco-delete-validator validationActions: