Skip to content

Commit

Permalink
Check crds chart is aligned with the main operator chart version
Browse files Browse the repository at this point in the history
Signed-off-by: David Cassany <[email protected]>
  • Loading branch information
davidcassany committed Jun 27, 2024
1 parent d80c1ab commit 646b00d
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .obs/chartfile/crds/templates/crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
app.kubernetes.io/instance: '{{ .Release.Name }}'
app.kubernetes.io/part-of: Elemental Operator
app.kubernetes.io/version: '{{ .Chart.Version }}'
controller-gen.kubebuilder.io/version: v0.14.0
labels:
cluster.x-k8s.io/provider: infrastructure-elemental
cluster.x-k8s.io/v1beta1: v1beta1
helm.sh/chart: '{{ .Chart.Name }}-{{ .Chart.Version \| replace "+" "_" }}'
release-name: '{{ .Release.Name }}'
name: machineinventories.elemental.cattle.io
spec:
Expand Down Expand Up @@ -198,10 +202,14 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
app.kubernetes.io/instance: '{{ .Release.Name }}'
app.kubernetes.io/part-of: Elemental Operator
app.kubernetes.io/version: '{{ .Chart.Version }}'
controller-gen.kubebuilder.io/version: v0.14.0
labels:
cluster.x-k8s.io/provider: infrastructure-elemental
cluster.x-k8s.io/v1beta1: v1beta1
helm.sh/chart: '{{ .Chart.Name }}-{{ .Chart.Version \| replace "+" "_" }}'
release-name: '{{ .Release.Name }}'
name: machineinventoryselectors.elemental.cattle.io
spec:
Expand Down Expand Up @@ -405,10 +413,14 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
app.kubernetes.io/instance: '{{ .Release.Name }}'
app.kubernetes.io/part-of: Elemental Operator
app.kubernetes.io/version: '{{ .Chart.Version }}'
controller-gen.kubebuilder.io/version: v0.14.0
labels:
cluster.x-k8s.io/provider: infrastructure-elemental
cluster.x-k8s.io/v1beta1: v1beta1
helm.sh/chart: '{{ .Chart.Name }}-{{ .Chart.Version \| replace "+" "_" }}'
release-name: '{{ .Release.Name }}'
name: machineinventoryselectortemplates.elemental.cattle.io
spec:
Expand Down Expand Up @@ -640,10 +652,14 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
app.kubernetes.io/instance: '{{ .Release.Name }}'
app.kubernetes.io/part-of: Elemental Operator
app.kubernetes.io/version: '{{ .Chart.Version }}'
controller-gen.kubebuilder.io/version: v0.14.0
labels:
cluster.x-k8s.io/provider: infrastructure-elemental
cluster.x-k8s.io/v1beta1: v1beta1
helm.sh/chart: '{{ .Chart.Name }}-{{ .Chart.Version \| replace "+" "_" }}'
release-name: '{{ .Release.Name }}'
name: machineregistrations.elemental.cattle.io
spec:
Expand Down Expand Up @@ -964,10 +980,14 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
app.kubernetes.io/instance: '{{ .Release.Name }}'
app.kubernetes.io/part-of: Elemental Operator
app.kubernetes.io/version: '{{ .Chart.Version }}'
controller-gen.kubebuilder.io/version: v0.14.0
labels:
cluster.x-k8s.io/provider: infrastructure-elemental
cluster.x-k8s.io/v1beta1: v1beta1
helm.sh/chart: '{{ .Chart.Name }}-{{ .Chart.Version \| replace "+" "_" }}'
release-name: '{{ .Release.Name }}'
name: managedosimages.elemental.cattle.io
spec:
Expand Down Expand Up @@ -2502,10 +2522,14 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
app.kubernetes.io/instance: '{{ .Release.Name }}'
app.kubernetes.io/part-of: Elemental Operator
app.kubernetes.io/version: '{{ .Chart.Version }}'
controller-gen.kubebuilder.io/version: v0.14.0
labels:
cluster.x-k8s.io/provider: infrastructure-elemental
cluster.x-k8s.io/v1beta1: v1beta1
helm.sh/chart: '{{ .Chart.Name }}-{{ .Chart.Version \| replace "+" "_" }}'
release-name: '{{ .Release.Name }}'
name: managedosversionchannels.elemental.cattle.io
spec:
Expand Down Expand Up @@ -2998,10 +3022,14 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
app.kubernetes.io/instance: '{{ .Release.Name }}'
app.kubernetes.io/part-of: Elemental Operator
app.kubernetes.io/version: '{{ .Chart.Version }}'
controller-gen.kubebuilder.io/version: v0.14.0
labels:
cluster.x-k8s.io/provider: infrastructure-elemental
cluster.x-k8s.io/v1beta1: v1beta1
helm.sh/chart: '{{ .Chart.Name }}-{{ .Chart.Version \| replace "+" "_" }}'
release-name: '{{ .Release.Name }}'
name: managedosversions.elemental.cattle.io
spec:
Expand Down Expand Up @@ -3404,10 +3432,14 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
app.kubernetes.io/instance: '{{ .Release.Name }}'
app.kubernetes.io/part-of: Elemental Operator
app.kubernetes.io/version: '{{ .Chart.Version }}'
controller-gen.kubebuilder.io/version: v0.14.0
labels:
cluster.x-k8s.io/provider: infrastructure-elemental
cluster.x-k8s.io/v1beta1: v1beta1
helm.sh/chart: '{{ .Chart.Name }}-{{ .Chart.Version \| replace "+" "_" }}'
release-name: '{{ .Release.Name }}'
name: metadata.elemental.cattle.io
spec:
Expand Down Expand Up @@ -3461,10 +3493,14 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
app.kubernetes.io/instance: '{{ .Release.Name }}'
app.kubernetes.io/part-of: Elemental Operator
app.kubernetes.io/version: '{{ .Chart.Version }}'
controller-gen.kubebuilder.io/version: v0.14.0
labels:
cluster.x-k8s.io/provider: infrastructure-elemental
cluster.x-k8s.io/v1beta1: v1beta1
helm.sh/chart: '{{ .Chart.Name }}-{{ .Chart.Version \| replace "+" "_" }}'
release-name: '{{ .Release.Name }}'
name: seedimages.elemental.cattle.io
spec:
Expand Down
4 changes: 4 additions & 0 deletions .obs/chartfile/operator/templates/validate-install-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,9 @@
{{- if eq $crdrelease $.Release.Name -}}
{{- required "Elemental CRDs should be moved to the new elemental-operator-crds chart before upgrading this operator." "" -}}
{{- end -}}
{{- $crdversion: := index $crdobj.metadata.annotations "app.kubernetes.io/version" -}}
{{- if or (not $crdversion) (ne $crdversion $.Chart.Version) -}}
{{- required "Elemental Operator CRDs chart version must match the version of this chart. Please install the corresponding CRD chart before." "" -}}
{{- end -}}
{{- end -}}
{{- end -}}
6 changes: 6 additions & 0 deletions config/crd/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,9 @@ commonLabels:
release-name: '{{ .Release.Name }}'
cluster.x-k8s.io/provider: infrastructure-elemental
cluster.x-k8s.io/v1beta1: v1beta1
helm.sh/chart: '{{ .Chart.Name }}-{{ .Chart.Version \| replace "+" "_" }}'

commonAnnotations:
app.kubernetes.io/instance: '{{ .Release.Name }}'
app.kubernetes.io/version: '{{ .Chart.Version }}'
app.kubernetes.io/part-of: 'Elemental Operator'

0 comments on commit 646b00d

Please sign in to comment.