Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check crds chart is aligned with the main operator chart version #787

Merged
merged 1 commit into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 }}'
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 }}'
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 }}'
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 }}'
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 }}'
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 }}'
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 }}'
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 }}'
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 }}'
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." "" -}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

{{- 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 }}'

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