From f518ba36df6bf8991097449ab1603991ce22d900 Mon Sep 17 00:00:00 2001 From: James Hewitt Date: Mon, 17 Jun 2024 15:18:35 +0100 Subject: [PATCH] Label the CommonService CRD so it can be selected for backup To backup common services with velero we ask the user to add a label to the backup the CommonService CRD. This user added label will be reset after every operator upgrade, so lets add a label to the CRD ourselves that the user can select. Signed-off-by: James Hewitt --- api/v3/commonservice_types.go | 1 + bundle/manifests/operator.ibm.com_commonservices.yaml | 1 + config/crd/bases/operator.ibm.com_commonservices.yaml | 2 ++ 3 files changed, 4 insertions(+) diff --git a/api/v3/commonservice_types.go b/api/v3/commonservice_types.go index 5c11f1521..2f0cfc5fa 100644 --- a/api/v3/commonservice_types.go +++ b/api/v3/commonservice_types.go @@ -298,6 +298,7 @@ const ( // +kubebuilder:object:root=true // +kubebuilder:subresource:status +// +kubebuilder:metadata:labels="foundationservices.cloudpak.ibm.com=crd" // +operator-sdk:gen-csv:customresourcedefinitions.displayName="CommonService" // CommonService is the Schema for the commonservices API. This API is used to diff --git a/bundle/manifests/operator.ibm.com_commonservices.yaml b/bundle/manifests/operator.ibm.com_commonservices.yaml index e59c044aa..9218355a0 100644 --- a/bundle/manifests/operator.ibm.com_commonservices.yaml +++ b/bundle/manifests/operator.ibm.com_commonservices.yaml @@ -8,6 +8,7 @@ metadata: app.kubernetes.io/instance: ibm-common-service-operator app.kubernetes.io/managed-by: ibm-common-service-operator app.kubernetes.io/name: ibm-common-service-operator + foundationservices.cloudpak.ibm.com: crd name: commonservices.operator.ibm.com spec: group: operator.ibm.com diff --git a/config/crd/bases/operator.ibm.com_commonservices.yaml b/config/crd/bases/operator.ibm.com_commonservices.yaml index 2b9820c37..a8ff3337a 100644 --- a/config/crd/bases/operator.ibm.com_commonservices.yaml +++ b/config/crd/bases/operator.ibm.com_commonservices.yaml @@ -4,6 +4,8 @@ kind: CustomResourceDefinition metadata: annotations: controller-gen.kubebuilder.io/version: v0.14.0 + labels: + foundationservices.cloudpak.ibm.com: crd name: commonservices.operator.ibm.com spec: group: operator.ibm.com