From f95ee3c27c8a2ecdc679ec18d62e6a69167671c9 Mon Sep 17 00:00:00 2001 From: Daniel Fan Date: Fri, 7 Jun 2024 19:02:20 -0400 Subject: [PATCH] Add StatusMonitoredServices annotations to OperandRegistry (#2033) Signed-off-by: Daniel Fan --- api/v3/commonservice_types.go | 28 +++++++++++++++------------- controllers/bootstrap/init.go | 18 ++++++++++-------- controllers/constant/odlm.go | 32 +++++++++++++++++++++++--------- 3 files changed, 48 insertions(+), 30 deletions(-) diff --git a/api/v3/commonservice_types.go b/api/v3/commonservice_types.go index bbd30c24f..5c11f1521 100644 --- a/api/v3/commonservice_types.go +++ b/api/v3/commonservice_types.go @@ -31,19 +31,21 @@ import ( // NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. type CSData struct { - Channel string - Version string - CPFSNs string - ServicesNs string - OperatorNs string - CatalogSourceName string - CatalogSourceNs string - IsolatedModeEnable string - ApprovalMode string - OnPremMultiEnable string - WatchNamespaces string - CloudPakThemes string - CloudPakThemesVersion string + Channel string + Version string + CPFSNs string + ServicesNs string + OperatorNs string + CatalogSourceName string + CatalogSourceNs string + IsolatedModeEnable string + ApprovalMode string + OnPremMultiEnable string + WatchNamespaces string + CloudPakThemes string + CloudPakThemesVersion string + ExcludedCatalog string + StatusMonitoredServices string } // +kubebuilder:pruning:PreserveUnknownFields diff --git a/controllers/bootstrap/init.go b/controllers/bootstrap/init.go index 5717446d6..b680d3331 100644 --- a/controllers/bootstrap/init.go +++ b/controllers/bootstrap/init.go @@ -111,14 +111,16 @@ func NewBootstrap(mgr manager.Manager) (bs *Bootstrap, err error) { return } csData := apiv3.CSData{ - CPFSNs: cpfsNs, - ServicesNs: servicesNs, - OperatorNs: operatorNs, - CatalogSourceName: catalogSourceName, - CatalogSourceNs: catalogSourceNs, - ApprovalMode: approvalMode, - WatchNamespaces: util.GetWatchNamespace(), - OnPremMultiEnable: strconv.FormatBool(util.CheckMultiInstances(mgr.GetAPIReader())), + CPFSNs: cpfsNs, + ServicesNs: servicesNs, + OperatorNs: operatorNs, + CatalogSourceName: catalogSourceName, + CatalogSourceNs: catalogSourceNs, + ApprovalMode: approvalMode, + WatchNamespaces: util.GetWatchNamespace(), + OnPremMultiEnable: strconv.FormatBool(util.CheckMultiInstances(mgr.GetAPIReader())), + ExcludedCatalog: constant.ExcludedCatalog, + StatusMonitoredServices: constant.StatusMonitoredServices, } bs = &Bootstrap{ diff --git a/controllers/constant/odlm.go b/controllers/constant/odlm.go index 8a1f7dc1e..9cff9739e 100644 --- a/controllers/constant/odlm.go +++ b/controllers/constant/odlm.go @@ -33,6 +33,11 @@ var ( CSV4SaasOperandConfig string ) +const ( + ExcludedCatalog = "certified-operators,community-operators,redhat-marketplace,ibm-cp-automation-foundation-catalog,operatorhubio-catalog" + StatusMonitoredServices = "ibm-idp-config-ui-operator,ibm-mongodb-operator,ibm-im-operator" +) + const ( MongoDBOpReg = ` apiVersion: operator.ibm.com/v1alpha1 @@ -44,7 +49,8 @@ metadata: operator.ibm.com/managedByCsOperator: "true" annotations: version: {{ .Version }} - excluded-catalogsource: certified-operators,community-operators,redhat-marketplace,ibm-cp-automation-foundation-catalog,operatorhubio-catalog + excluded-catalogsource: {{ .ExcludedCatalog }} + status-monitored-services: {{ .StatusMonitoredServices }} spec: operators: - name: ibm-im-mongodb-operator-v4.0 @@ -74,7 +80,8 @@ metadata: operator.ibm.com/managedByCsOperator: "true" annotations: version: {{ .Version }} - excluded-catalogsource: certified-operators,community-operators,redhat-marketplace,ibm-cp-automation-foundation-catalog,operatorhubio-catalog + excluded-catalogsource: {{ .ExcludedCatalog }} + status-monitored-services: {{ .StatusMonitoredServices }} spec: operators: - name: ibm-im-operator-v4.0 @@ -131,7 +138,8 @@ metadata: operator.ibm.com/managedByCsOperator: "true" annotations: version: {{ .Version }} - excluded-catalogsource: certified-operators,community-operators,redhat-marketplace,ibm-cp-automation-foundation-catalog,operatorhubio-catalog + excluded-catalogsource: {{ .ExcludedCatalog }} + status-monitored-services: {{ .StatusMonitoredServices }} spec: operators: - name: ibm-idp-config-ui-operator-v4.0 @@ -182,7 +190,8 @@ metadata: operator.ibm.com/managedByCsOperator: "true" annotations: version: {{ .Version }} - excluded-catalogsource: certified-operators,community-operators,redhat-marketplace,ibm-cp-automation-foundation-catalog,operatorhubio-catalog + excluded-catalogsource: {{ .ExcludedCatalog }} + status-monitored-services: {{ .StatusMonitoredServices }} spec: operators: - name: ibm-platformui-operator-v4.0 @@ -235,7 +244,8 @@ metadata: operator.ibm.com/managedByCsOperator: "true" annotations: version: {{ .Version }} - excluded-catalogsource: certified-operators,community-operators,redhat-marketplace,ibm-cp-automation-foundation-catalog,operatorhubio-catalog + excluded-catalogsource: {{ .ExcludedCatalog }} + status-monitored-services: {{ .StatusMonitoredServices }} spec: operators: - channel: stable-v22 @@ -265,7 +275,8 @@ metadata: operator.ibm.com/managedByCsOperator: "true" annotations: version: {{ .Version }} - excluded-catalogsource: certified-operators,community-operators,redhat-marketplace,ibm-cp-automation-foundation-catalog,operatorhubio-catalog + excluded-catalogsource: {{ .ExcludedCatalog }} + status-monitored-services: {{ .StatusMonitoredServices }} spec: operators: - channel: stable @@ -1314,7 +1325,8 @@ metadata: operator.ibm.com/managedByCsOperator: "true" annotations: version: "{{ .Version }}" - excluded-catalogsource: certified-operators,community-operators,redhat-marketplace,ibm-cp-automation-foundation-catalog,operatorhubio-catalog + excluded-catalogsource: {{ .ExcludedCatalog }} + status-monitored-services: {{ .StatusMonitoredServices }} spec: operators: - name: ibm-licensing-operator @@ -1419,7 +1431,8 @@ metadata: operator.ibm.com/managedByCsOperator: "true" annotations: version: {{ .Version }} - excluded-catalogsource: certified-operators,community-operators,redhat-marketplace,ibm-cp-automation-foundation-catalog,operatorhubio-catalog + excluded-catalogsource: {{ .ExcludedCatalog }} + status-monitored-services: {{ .StatusMonitoredServices }} spec: operators: - name: ibm-im-operator @@ -1509,7 +1522,8 @@ metadata: operator.ibm.com/managedByCsOperator: "true" annotations: version: {{ .Version }} - excluded-catalogsource: certified-operators,community-operators,redhat-marketplace,ibm-cp-automation-foundation-catalog,operatorhubio-catalog + excluded-catalogsource: {{ .ExcludedCatalog }} + status-monitored-services: {{ .StatusMonitoredServices }} spec: operators: - name: ibm-licensing-operator