Skip to content

Commit

Permalink
Add Helm annotation to CRDs to prevent accidental deletion. (elastic#…
Browse files Browse the repository at this point in the history
…7811)

* Add helm annotation to CRDs to prevent accidental deletion.
* Add annotation to template as well.
---------
Signed-off-by: Michael Montgomery <mmontg1@gmail.com>
(cherry picked from commit 54dbed4)
Signed-off-by: Michael Montgomery <mmontg1@gmail.com>
  • Loading branch information
naemono committed May 16, 2024
1 parent 6404bcb commit dae1d84
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
helm.sh/resource-policy: keep
labels:
app.kubernetes.io/instance: '{{ .Release.Name }}'
app.kubernetes.io/managed-by: '{{ .Release.Service }}'
Expand Down Expand Up @@ -1132,6 +1133,7 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
helm.sh/resource-policy: keep
labels:
app.kubernetes.io/instance: '{{ .Release.Name }}'
app.kubernetes.io/managed-by: '{{ .Release.Service }}'
Expand Down Expand Up @@ -2353,6 +2355,7 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
helm.sh/resource-policy: keep
labels:
app.kubernetes.io/instance: '{{ .Release.Name }}'
app.kubernetes.io/managed-by: '{{ .Release.Service }}'
Expand Down Expand Up @@ -2840,6 +2843,7 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
helm.sh/resource-policy: keep
labels:
app.kubernetes.io/instance: '{{ .Release.Name }}'
app.kubernetes.io/managed-by: '{{ .Release.Service }}'
Expand Down Expand Up @@ -3437,6 +3441,7 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
helm.sh/resource-policy: keep
labels:
app.kubernetes.io/instance: '{{ .Release.Name }}'
app.kubernetes.io/managed-by: '{{ .Release.Service }}'
Expand Down Expand Up @@ -3793,6 +3798,7 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
helm.sh/resource-policy: keep
labels:
app.kubernetes.io/instance: '{{ .Release.Name }}'
app.kubernetes.io/managed-by: '{{ .Release.Service }}'
Expand Down Expand Up @@ -6508,6 +6514,7 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
helm.sh/resource-policy: keep
labels:
app.kubernetes.io/instance: '{{ .Release.Name }}'
app.kubernetes.io/managed-by: '{{ .Release.Service }}'
Expand Down Expand Up @@ -7663,6 +7670,7 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
helm.sh/resource-policy: keep
labels:
app.kubernetes.io/instance: '{{ .Release.Name }}'
app.kubernetes.io/managed-by: '{{ .Release.Service }}'
Expand Down Expand Up @@ -8964,6 +8972,7 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
helm.sh/resource-policy: keep
labels:
app.kubernetes.io/instance: '{{ .Release.Name }}'
app.kubernetes.io/managed-by: '{{ .Release.Service }}'
Expand Down Expand Up @@ -10186,6 +10195,7 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
helm.sh/resource-policy: keep
labels:
app.kubernetes.io/instance: '{{ .Release.Name }}'
app.kubernetes.io/managed-by: '{{ .Release.Service }}'
Expand Down
2 changes: 2 additions & 0 deletions hack/manifest-gen/crd_patches/v1/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@ commonLabels:
app.kubernetes.io/managed-by: '{{ .Release.Service }}'
app.kubernetes.io/name: '{{ include "eck-operator-crds.name" . }}'
app.kubernetes.io/instance: '{{ .Release.Name }}'
commonAnnotations:
helm.sh/resource-policy: keep
resources:
- all-crds.yaml

0 comments on commit dae1d84

Please sign in to comment.