From d586a18605817f77b92515e0483d4e06061e207d Mon Sep 17 00:00:00 2001 From: Andrew Lavery Date: Thu, 2 May 2024 00:02:55 +0800 Subject: [PATCH] add hardcoded disaster recovery labels to CRDs (#160) --- .../charts/crds/templates/resources.yaml | 6 ++++++ config/crd/kustomization.yaml | 2 ++ config/crd/patches/labels_in_configs.yaml | 8 ++++++++ config/crd/patches/labels_in_installations.yaml | 8 ++++++++ 4 files changed, 24 insertions(+) create mode 100644 config/crd/patches/labels_in_configs.yaml create mode 100644 config/crd/patches/labels_in_installations.yaml diff --git a/charts/embedded-cluster-operator/charts/crds/templates/resources.yaml b/charts/embedded-cluster-operator/charts/crds/templates/resources.yaml index fe771d762..f250c77c3 100644 --- a/charts/embedded-cluster-operator/charts/crds/templates/resources.yaml +++ b/charts/embedded-cluster-operator/charts/crds/templates/resources.yaml @@ -3,6 +3,9 @@ kind: CustomResourceDefinition metadata: annotations: controller-gen.kubebuilder.io/version: v0.14.0 + labels: + replicated.com/disaster-recovery: infra + replicated.com/disaster-recovery-chart: embedded-cluster-operator name: configs.embeddedcluster.replicated.com spec: group: embeddedcluster.replicated.com @@ -220,6 +223,9 @@ kind: CustomResourceDefinition metadata: annotations: controller-gen.kubebuilder.io/version: v0.14.0 + labels: + replicated.com/disaster-recovery: infra + replicated.com/disaster-recovery-chart: embedded-cluster-operator name: installations.embeddedcluster.replicated.com spec: group: embeddedcluster.replicated.com diff --git a/config/crd/kustomization.yaml b/config/crd/kustomization.yaml index b8a11ea52..2718ff546 100644 --- a/config/crd/kustomization.yaml +++ b/config/crd/kustomization.yaml @@ -7,6 +7,8 @@ resources: #+kubebuilder:scaffold:crdkustomizeresource patchesStrategicMerge: +- patches/labels_in_installations.yaml +- patches/labels_in_configs.yaml # [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix. # patches here are for enabling the conversion webhook for each CRD #- patches/webhook_in_installations.yaml diff --git a/config/crd/patches/labels_in_configs.yaml b/config/crd/patches/labels_in_configs.yaml new file mode 100644 index 000000000..8c648bf16 --- /dev/null +++ b/config/crd/patches/labels_in_configs.yaml @@ -0,0 +1,8 @@ +# The following patch adds backup and restore labels to the CRD +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + labels: + replicated.com/disaster-recovery: "infra" + replicated.com/disaster-recovery-chart: "embedded-cluster-operator" + name: configs.embeddedcluster.replicated.com diff --git a/config/crd/patches/labels_in_installations.yaml b/config/crd/patches/labels_in_installations.yaml new file mode 100644 index 000000000..a69dc0fd2 --- /dev/null +++ b/config/crd/patches/labels_in_installations.yaml @@ -0,0 +1,8 @@ +# The following patch adds backup and restore labels to the CRD +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + labels: + replicated.com/disaster-recovery: "infra" + replicated.com/disaster-recovery-chart: "embedded-cluster-operator" + name: installations.embeddedcluster.replicated.com