Skip to content

Commit

Permalink
Add StatusMonitoredServices annotations to OperandRegistry (#2033)
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Fan <[email protected]>
  • Loading branch information
Daniel-Fan authored Jun 7, 2024
1 parent 324f865 commit f95ee3c
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 30 deletions.
28 changes: 15 additions & 13 deletions api/v3/commonservice_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 10 additions & 8 deletions controllers/bootstrap/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
32 changes: 23 additions & 9 deletions controllers/constant/odlm.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit f95ee3c

Please sign in to comment.