diff --git a/internal/operators/api/api.go b/internal/operators/api/api.go index f93cc801f01..fd1a7861599 100644 --- a/internal/operators/api/api.go +++ b/internal/operators/api/api.go @@ -3,6 +3,7 @@ package api import ( "context" + "github.com/lib/pq" "github.com/openshift/assisted-service/internal/common" "github.com/openshift/assisted-service/models" ) @@ -55,6 +56,8 @@ type Operator interface { GetPreflightRequirements(ctx context.Context, cluster *common.Cluster) (*models.OperatorHardwareRequirements, error) // GetFeatureSupportID returns the operator unique feature-support ID GetFeatureSupportID() models.FeatureSupportLevelID + // GetBundleLabels returns the bundles associated with the operator + GetBundleLabels() pq.StringArray } // Storage Operator provide a generic API for storage operators diff --git a/internal/operators/api/mock_operator_api.go b/internal/operators/api/mock_operator_api.go index 691a9d9d564..772161de365 100644 --- a/internal/operators/api/mock_operator_api.go +++ b/internal/operators/api/mock_operator_api.go @@ -9,6 +9,7 @@ import ( reflect "reflect" gomock "github.com/golang/mock/gomock" + pq "github.com/lib/pq" common "github.com/openshift/assisted-service/internal/common" models "github.com/openshift/assisted-service/models" ) @@ -52,6 +53,20 @@ func (mr *MockOperatorMockRecorder) GenerateManifests(arg0 interface{}) *gomock. return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GenerateManifests", reflect.TypeOf((*MockOperator)(nil).GenerateManifests), arg0) } +// GetBundleLabels mocks base method. +func (m *MockOperator) GetBundleLabels() pq.StringArray { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetBundleLabels") + ret0, _ := ret[0].(pq.StringArray) + return ret0 +} + +// GetBundleLabels indicates an expected call of GetBundleLabels. +func (mr *MockOperatorMockRecorder) GetBundleLabels() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBundleLabels", reflect.TypeOf((*MockOperator)(nil).GetBundleLabels)) +} + // GetClusterValidationID mocks base method. func (m *MockOperator) GetClusterValidationID() string { m.ctrl.T.Helper() diff --git a/internal/operators/authorino/authorino_operator.go b/internal/operators/authorino/authorino_operator.go index b3d8d5e9dfb..f7924f62b98 100644 --- a/internal/operators/authorino/authorino_operator.go +++ b/internal/operators/authorino/authorino_operator.go @@ -4,6 +4,7 @@ import ( "context" "text/template" + "github.com/lib/pq" "github.com/openshift/assisted-service/internal/common" "github.com/openshift/assisted-service/internal/operators/api" "github.com/openshift/assisted-service/internal/templating" @@ -17,6 +18,7 @@ var Operator = models.MonitoredOperator{ OperatorType: models.OperatorTypeOlm, SubscriptionName: "authorino-operator", TimeoutSeconds: 30 * 60, + Bundles: pq.StringArray{string(models.BundleOpenshiftai)}, } // operator is an Authorino AI OLM operator plugin. @@ -124,3 +126,8 @@ func (o *operator) GetPreflightRequirements(context context.Context, func (o *operator) GetFeatureSupportID() models.FeatureSupportLevelID { return models.FeatureSupportLevelIDAUTHORINO } + +// GetBundleLabels returns the bundle labels for the Authorino operator +func (o *operator) GetBundleLabels() pq.StringArray { + return Operator.Bundles +} diff --git a/internal/operators/cnv/cnv_operator.go b/internal/operators/cnv/cnv_operator.go index 7337b9e78a9..b7714bee94e 100644 --- a/internal/operators/cnv/cnv_operator.go +++ b/internal/operators/cnv/cnv_operator.go @@ -5,6 +5,7 @@ import ( "fmt" "strings" + "github.com/lib/pq" "github.com/openshift/assisted-service/internal/common" "github.com/openshift/assisted-service/internal/featuresupport" "github.com/openshift/assisted-service/internal/hardware/virt" @@ -37,6 +38,7 @@ var Operator = models.MonitoredOperator{ OperatorType: models.OperatorTypeOlm, SubscriptionName: "hco-operatorhub", TimeoutSeconds: 60 * 60, + Bundles: pq.StringArray{string(models.BundleVirtualization)}, } // NewCNVOperator creates new instance of a Container Native Virtualization installation plugin @@ -333,3 +335,7 @@ func validDiscoverableSNODisk(disks []*models.Disk, installationDiskID string, d func (o *operator) GetFeatureSupportID() models.FeatureSupportLevelID { return models.FeatureSupportLevelIDCNV } + +func (o *operator) GetBundleLabels() pq.StringArray { + return Operator.Bundles +} diff --git a/internal/operators/handler/handler_v2.go b/internal/operators/handler/handler_v2.go index fe7e507ede3..1bddd0343d0 100644 --- a/internal/operators/handler/handler_v2.go +++ b/internal/operators/handler/handler_v2.go @@ -5,6 +5,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/openshift/assisted-service/internal/common" + "github.com/openshift/assisted-service/models" logutil "github.com/openshift/assisted-service/pkg/log" restoperators "github.com/openshift/assisted-service/restapi/operations/operators" ) @@ -36,3 +37,19 @@ func (h *Handler) V2ListSupportedOperators(_ context.Context, _ restoperators.V2 return restoperators.NewV2ListSupportedOperatorsOK(). WithPayload(h.operatorsAPI.GetSupportedOperators()) } + +// V2GetBundles Retrieves the list of supported bundles. +func (h *Handler) V2GetBundles(_ context.Context, _ restoperators.V2GetBundlesParams) middleware.Responder { + return restoperators.NewV2GetBundlesOK().WithPayload(h.operatorsAPI.GetBundles()) +} + +// V2GetBundleOperators Retrieves the list of operators for a specific bundle. +func (h *Handler) V2GetBundleOperators(ctx context.Context, params restoperators.V2GetBundleOperatorsParams) middleware.Responder { + log := logutil.FromContext(ctx, h.log) + operators, err := h.operatorsAPI.GetOperatorsByBundle(models.Bundle(params.BundleName)) + if err != nil { + log.Errorf("Failed to get operators for bundle %s: %v", params.BundleName, err) + return common.GenerateErrorResponder(err) + } + return restoperators.NewV2GetBundleOperatorsOK().WithPayload(operators) +} diff --git a/internal/operators/lso/ls_operator.go b/internal/operators/lso/ls_operator.go index 8248fac7c5b..bfcec166ac4 100644 --- a/internal/operators/lso/ls_operator.go +++ b/internal/operators/lso/ls_operator.go @@ -3,6 +3,7 @@ package lso import ( "context" + "github.com/lib/pq" "github.com/openshift/assisted-service/internal/common" "github.com/openshift/assisted-service/internal/operators/api" "github.com/openshift/assisted-service/models" @@ -103,3 +104,8 @@ func (l *lsOperator) GetPreflightRequirements(context context.Context, cluster * func (l *lsOperator) GetFeatureSupportID() models.FeatureSupportLevelID { return models.FeatureSupportLevelIDLSO } + +// GetBundleLabels returns the bundle labels for the LSO operator +func (l *lsOperator) GetBundleLabels() pq.StringArray { + return Operator.Bundles +} diff --git a/internal/operators/lvm/lvm_operator.go b/internal/operators/lvm/lvm_operator.go index 159a5ff20c8..818c2916ef7 100644 --- a/internal/operators/lvm/lvm_operator.go +++ b/internal/operators/lvm/lvm_operator.go @@ -6,6 +6,7 @@ import ( "github.com/go-openapi/swag" "github.com/kelseyhightower/envconfig" + "github.com/lib/pq" "github.com/openshift/assisted-service/internal/common" "github.com/openshift/assisted-service/internal/operators/api" operatorscommon "github.com/openshift/assisted-service/internal/operators/common" @@ -215,3 +216,8 @@ func (o *operator) GetPreflightRequirements(context context.Context, cluster *co func (o *operator) GetFeatureSupportID() models.FeatureSupportLevelID { return models.FeatureSupportLevelIDLVM } + +// GetBundleLabels returns the bundle labels for the LVM operator +func (o *operator) GetBundleLabels() pq.StringArray { + return Operator.Bundles +} diff --git a/internal/operators/manager.go b/internal/operators/manager.go index 0c4e392761d..2e6cd6a6a2b 100644 --- a/internal/operators/manager.go +++ b/internal/operators/manager.go @@ -79,6 +79,10 @@ type API interface { GetPreflightRequirementsBreakdownForCluster(ctx context.Context, cluster *common.Cluster) ([]*models.OperatorHardwareRequirements, error) // EnsureOperatorPrerequisite Ensure that for the given operators has the base prerequisite for installation EnsureOperatorPrerequisite(cluster *common.Cluster, openshiftVersion string, cpuArchitecture string, operators []*models.MonitoredOperator) error + // GetBundles returns the list of available bundles + GetBundles() []models.Bundle + // GetOperatorsByBundle returns the operators associated with a specific bundle + GetOperatorsByBundle(bundleName models.Bundle) ([]string, error) } // GetPreflightRequirementsBreakdownForCluster provides host requirements breakdown for each supported OLM operator @@ -514,3 +518,38 @@ func (mgr *Manager) EnsureOperatorPrerequisite(cluster *common.Cluster, openshif return nil } + +// GetBundles returns a list of available bundles. +func (mgr *Manager) GetBundles() []models.Bundle { + return []models.Bundle{ + models.BundleVirtualization, + models.BundleOpenshiftai, + } +} + +// GetOperatorsByBundle returns the operators associated with a specific bundle +func (mgr *Manager) GetOperatorsByBundle(bundleName models.Bundle) ([]string, error) { + var operators []string + if !mgr.isBundleValid(bundleName) { + return operators, fmt.Errorf("bundle '%s' is not supported", bundleName) + } + for _, operator := range mgr.olmOperators { + for _, bundleStr := range operator.GetBundleLabels() { + bundle := models.Bundle(bundleStr) + if bundle == bundleName { + operators = append(operators, operator.GetName()) + break + } + } + } + return operators, nil +} + +func (mgr *Manager) isBundleValid(bundleName models.Bundle) bool { + for _, bundle := range mgr.GetBundles() { + if bundle == bundleName { + return true + } + } + return false +} diff --git a/internal/operators/manager_test.go b/internal/operators/manager_test.go index afb4a74516a..90c778e5a79 100644 --- a/internal/operators/manager_test.go +++ b/internal/operators/manager_test.go @@ -24,6 +24,8 @@ import ( "github.com/openshift/assisted-service/internal/operators/lvm" "github.com/openshift/assisted-service/internal/operators/mce" "github.com/openshift/assisted-service/internal/operators/odf" + "github.com/openshift/assisted-service/internal/operators/openshiftai" + "github.com/openshift/assisted-service/internal/operators/serverless" "github.com/openshift/assisted-service/models" "github.com/openshift/assisted-service/pkg/conversions" "github.com/openshift/assisted-service/pkg/s3wrapper" @@ -796,6 +798,51 @@ var _ = Describe("Operators manager", func() { Expect(err).To(BeEquivalentTo(theError)) }) }) + + Context("Bundles", func() { + // we use the real operators here, as we want to test the manager's ability to group them into bundles + var ( + manager *operators.Manager + cnvOperator, odfOperator, oaiOperator, serverlessOperator, lsoOperator api.Operator + ) + BeforeEach(func() { + cfg := cnv.Config{} + cnvOperator = cnv.NewCNVOperator(log, cfg) + // note that odf belongs to both Virtualization and Openshiftai bundles + odfOperator = odf.NewOdfOperator(log) + oaiOperator = openshiftai.NewOpenShiftAIOperator(log) + serverlessOperator = serverless.NewServerLessOperator(log) + // note that lso doesn't belongs to any bundle + lsoOperator = lso.NewLSOperator() + + manager = operators.NewManagerWithOperators(log, manifestsAPI, operators.Options{}, nil, cnvOperator, odfOperator, oaiOperator, serverlessOperator, lsoOperator) + }) + + It("GetBundles should return the list of available bundles", func() { + bundles := manager.GetBundles() + Expect(bundles).To(ConsistOf( + models.BundleVirtualization, + models.BundleOpenshiftai, + )) + }) + + It("GetOperatorsByBundle should return the operators associated with a specific bundle", func() { + + operators, err := manager.GetOperatorsByBundle("invalid bundle") + Expect(err).To(HaveOccurred()) + Expect(err).To(MatchError("bundle 'invalid bundle' is not supported")) + Expect(operators).To(HaveLen(0)) + operators, err = manager.GetOperatorsByBundle(models.BundleVirtualization) + Expect(err).ToNot(HaveOccurred()) + Expect(operators).To(HaveLen(3)) + Expect(operators).To(ContainElements(cnvOperator.GetName(), odfOperator.GetName())) + + operators, err = manager.GetOperatorsByBundle(models.BundleOpenshiftai) + Expect(err).ToNot(HaveOccurred()) + Expect(operators).To(HaveLen(2)) + Expect(operators).To(ContainElements(oaiOperator.GetName(), serverlessOperator.GetName(), odfOperator.GetName())) + }) + }) }) func mockOperatorBase(operatorName string) *api.MockOperator { diff --git a/internal/operators/mce/mce_operator.go b/internal/operators/mce/mce_operator.go index 1eb826e9d54..9503db467f2 100644 --- a/internal/operators/mce/mce_operator.go +++ b/internal/operators/mce/mce_operator.go @@ -6,6 +6,7 @@ import ( "github.com/hashicorp/go-version" "github.com/kelseyhightower/envconfig" + "github.com/lib/pq" "github.com/openshift/assisted-service/internal/common" "github.com/openshift/assisted-service/internal/operators/api" "github.com/openshift/assisted-service/models" @@ -53,6 +54,7 @@ func (o *operator) GetName() string { return Operator.Name } +// GetFullName reports the full name of the Operator. func (o *operator) GetFullName() string { return "multicluster engine" } @@ -215,3 +217,8 @@ func GetMinDiskSizeGB(cluster *models.Cluster) int64 { } return lo.Max(lo.Values(storageSizeGi)) } + +// GetBundleLabels returns the bundle labels for the MCE operator +func (o *operator) GetBundleLabels() pq.StringArray { + return Operator.Bundles +} diff --git a/internal/operators/mock_operators_api.go b/internal/operators/mock_operators_api.go index b41d4f59baf..9d9a0f736e5 100644 --- a/internal/operators/mock_operators_api.go +++ b/internal/operators/mock_operators_api.go @@ -79,6 +79,20 @@ func (mr *MockAPIMockRecorder) GenerateManifests(arg0, arg1 interface{}) *gomock return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GenerateManifests", reflect.TypeOf((*MockAPI)(nil).GenerateManifests), arg0, arg1) } +// GetBundles mocks base method. +func (m *MockAPI) GetBundles() []models.Bundle { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetBundles") + ret0, _ := ret[0].([]models.Bundle) + return ret0 +} + +// GetBundles indicates an expected call of GetBundles. +func (mr *MockAPIMockRecorder) GetBundles() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBundles", reflect.TypeOf((*MockAPI)(nil).GetBundles)) +} + // GetMonitoredOperatorsList mocks base method. func (m *MockAPI) GetMonitoredOperatorsList() map[string]*models.MonitoredOperator { m.ctrl.T.Helper() @@ -123,6 +137,21 @@ func (mr *MockAPIMockRecorder) GetOperatorProperties(arg0 interface{}) *gomock.C return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOperatorProperties", reflect.TypeOf((*MockAPI)(nil).GetOperatorProperties), arg0) } +// GetOperatorsByBundle mocks base method. +func (m *MockAPI) GetOperatorsByBundle(arg0 models.Bundle) ([]string, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetOperatorsByBundle", arg0) + ret0, _ := ret[0].([]string) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetOperatorsByBundle indicates an expected call of GetOperatorsByBundle. +func (mr *MockAPIMockRecorder) GetOperatorsByBundle(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOperatorsByBundle", reflect.TypeOf((*MockAPI)(nil).GetOperatorsByBundle), arg0) +} + // GetPreflightRequirementsBreakdownForCluster mocks base method. func (m *MockAPI) GetPreflightRequirementsBreakdownForCluster(arg0 context.Context, arg1 *common.Cluster) ([]*models.OperatorHardwareRequirements, error) { m.ctrl.T.Helper() diff --git a/internal/operators/mtv/operator.go b/internal/operators/mtv/operator.go index 9092afc68a4..c99bada3272 100644 --- a/internal/operators/mtv/operator.go +++ b/internal/operators/mtv/operator.go @@ -5,6 +5,7 @@ import ( "fmt" "github.com/kelseyhightower/envconfig" + "github.com/lib/pq" "github.com/openshift/assisted-service/internal/common" "github.com/openshift/assisted-service/internal/featuresupport" "github.com/openshift/assisted-service/internal/operators/api" @@ -26,6 +27,7 @@ var Operator = models.MonitoredOperator{ OperatorType: models.OperatorTypeOlm, SubscriptionName: Subscription, TimeoutSeconds: 60 * 60, + Bundles: pq.StringArray{string(models.BundleVirtualization)}, } func NewMTVOperator(log logrus.FieldLogger) *operator { @@ -177,3 +179,8 @@ func (o *operator) GenerateManifests(cluster *common.Cluster) (map[string][]byte func (o *operator) GetFeatureSupportID() models.FeatureSupportLevelID { return models.FeatureSupportLevelIDMTV } + +// GetBundleLabels returns the bundle labels for the MTV operator +func (o *operator) GetBundleLabels() pq.StringArray { + return Operator.Bundles +} diff --git a/internal/operators/nodefeaturediscovery/node_feature_discovery_operator.go b/internal/operators/nodefeaturediscovery/node_feature_discovery_operator.go index 1364b30bace..29e8b6e58d0 100644 --- a/internal/operators/nodefeaturediscovery/node_feature_discovery_operator.go +++ b/internal/operators/nodefeaturediscovery/node_feature_discovery_operator.go @@ -5,6 +5,7 @@ import ( "text/template" "github.com/kelseyhightower/envconfig" + "github.com/lib/pq" "github.com/openshift/assisted-service/internal/common" "github.com/openshift/assisted-service/internal/operators/api" "github.com/openshift/assisted-service/internal/templating" @@ -137,3 +138,7 @@ func (o *operator) GetPreflightRequirements(context context.Context, func (o *operator) GetFeatureSupportID() models.FeatureSupportLevelID { return models.FeatureSupportLevelIDNODEFEATUREDISCOVERY } + +func (o *operator) GetBundleLabels() pq.StringArray { + return Operator.Bundles +} diff --git a/internal/operators/nvidiagpu/nvidia_gpu_operator.go b/internal/operators/nvidiagpu/nvidia_gpu_operator.go index c7044d177b9..630e3c912c3 100644 --- a/internal/operators/nvidiagpu/nvidia_gpu_operator.go +++ b/internal/operators/nvidiagpu/nvidia_gpu_operator.go @@ -5,6 +5,7 @@ import ( "text/template" "github.com/kelseyhightower/envconfig" + "github.com/lib/pq" "github.com/openshift/assisted-service/internal/common" "github.com/openshift/assisted-service/internal/operators/api" "github.com/openshift/assisted-service/internal/operators/nodefeaturediscovery" @@ -186,3 +187,7 @@ func (o *operator) GetPreflightRequirements(context context.Context, func (o *operator) GetFeatureSupportID() models.FeatureSupportLevelID { return models.FeatureSupportLevelIDNVIDIAGPU } + +func (o *operator) GetBundleLabels() pq.StringArray { + return Operator.Bundles +} diff --git a/internal/operators/odf/odf_operator.go b/internal/operators/odf/odf_operator.go index bcf1e8b2eb8..626f5c5dafe 100644 --- a/internal/operators/odf/odf_operator.go +++ b/internal/operators/odf/odf_operator.go @@ -7,6 +7,7 @@ import ( "unicode" "github.com/kelseyhightower/envconfig" + "github.com/lib/pq" "github.com/openshift/assisted-service/internal/common" "github.com/openshift/assisted-service/internal/operators/api" operatorscommon "github.com/openshift/assisted-service/internal/operators/common" @@ -45,6 +46,8 @@ var Operator = models.MonitoredOperator{ Namespace: "openshift-storage", SubscriptionName: "odf-operator", TimeoutSeconds: 30 * 60, + Bundles: pq.StringArray{string(models.BundleVirtualization), + string(models.BundleOpenshiftai)}, } // NewOdfOperator creates new ODFOperator @@ -312,6 +315,11 @@ func (o *operator) GetFeatureSupportID() models.FeatureSupportLevelID { return models.FeatureSupportLevelIDODF } +// GetBundleLabels returns the bundle labels for the ODF operator +func (o *operator) GetBundleLabels() pq.StringArray { + return Operator.Bundles +} + func capitalizeFirstLetter(s string) string { if len(s) == 0 { return s diff --git a/internal/operators/openshiftai/openshift_ai_operator.go b/internal/operators/openshiftai/openshift_ai_operator.go index 0c74ca65a8e..fbd7f0b8f77 100644 --- a/internal/operators/openshiftai/openshift_ai_operator.go +++ b/internal/operators/openshiftai/openshift_ai_operator.go @@ -7,6 +7,7 @@ import ( "text/template" "github.com/kelseyhightower/envconfig" + "github.com/lib/pq" "github.com/openshift/assisted-service/internal/common" "github.com/openshift/assisted-service/internal/operators/api" "github.com/openshift/assisted-service/internal/operators/authorino" @@ -27,6 +28,7 @@ var Operator = models.MonitoredOperator{ OperatorType: models.OperatorTypeOlm, SubscriptionName: "rhods-operator", TimeoutSeconds: 30 * 60, + Bundles: pq.StringArray{string(models.BundleOpenshiftai)}, } // operator is an OpenShift AI OLM operator plugin. @@ -313,3 +315,7 @@ func (o *operator) GetSupportedArchitectures() []string { func (o *operator) GetFeatureSupportID() models.FeatureSupportLevelID { return models.FeatureSupportLevelIDOPENSHIFTAI } + +func (o *operator) GetBundleLabels() pq.StringArray { + return Operator.Bundles +} diff --git a/internal/operators/osc/operator.go b/internal/operators/osc/operator.go index 53c5f975962..0ae4f83ad7c 100644 --- a/internal/operators/osc/operator.go +++ b/internal/operators/osc/operator.go @@ -5,6 +5,7 @@ import ( "fmt" "github.com/kelseyhightower/envconfig" + "github.com/lib/pq" "github.com/openshift/assisted-service/internal/common" "github.com/openshift/assisted-service/internal/featuresupport" "github.com/openshift/assisted-service/internal/operators/api" @@ -182,3 +183,8 @@ func (o *operator) GenerateManifests(cluster *common.Cluster) (map[string][]byte func (o *operator) GetFeatureSupportID() models.FeatureSupportLevelID { return models.FeatureSupportLevelIDOSC } + +// GetBundleLabels returns the bundle labels for the OSC operator +func (o *operator) GetBundleLabels() pq.StringArray { + return Operator.Bundles +} diff --git a/internal/operators/pipelines/pipelines_operator.go b/internal/operators/pipelines/pipelines_operator.go index e9ce3a1820c..788ead50f4f 100644 --- a/internal/operators/pipelines/pipelines_operator.go +++ b/internal/operators/pipelines/pipelines_operator.go @@ -5,6 +5,7 @@ import ( "text/template" "github.com/kelseyhightower/envconfig" + "github.com/lib/pq" "github.com/openshift/assisted-service/internal/common" "github.com/openshift/assisted-service/internal/operators/api" "github.com/openshift/assisted-service/internal/templating" @@ -18,6 +19,7 @@ var Operator = models.MonitoredOperator{ OperatorType: models.OperatorTypeOlm, SubscriptionName: "openshift-pipelines-operator-rh", TimeoutSeconds: 30 * 60, + Bundles: pq.StringArray{string(models.BundleOpenshiftai)}, } // operator is an pipelines OLM operator plugin. @@ -138,3 +140,7 @@ func (o *operator) GetPreflightRequirements(context context.Context, func (o *operator) GetFeatureSupportID() models.FeatureSupportLevelID { return models.FeatureSupportLevelIDPIPELINES } + +func (o *operator) GetBundleLabels() pq.StringArray { + return Operator.Bundles +} diff --git a/internal/operators/serverless/serverless_operator.go b/internal/operators/serverless/serverless_operator.go index f4de81af196..87ca1b2be50 100644 --- a/internal/operators/serverless/serverless_operator.go +++ b/internal/operators/serverless/serverless_operator.go @@ -5,6 +5,7 @@ import ( "text/template" "github.com/kelseyhightower/envconfig" + "github.com/lib/pq" "github.com/openshift/assisted-service/internal/common" "github.com/openshift/assisted-service/internal/operators/api" "github.com/openshift/assisted-service/internal/templating" @@ -18,6 +19,7 @@ var Operator = models.MonitoredOperator{ OperatorType: models.OperatorTypeOlm, SubscriptionName: "serverless-operator", TimeoutSeconds: 30 * 60, + Bundles: pq.StringArray{string(models.BundleOpenshiftai)}, } // operator is an serverless OLM operator plugin. @@ -138,3 +140,7 @@ func (o *operator) GetPreflightRequirements(context context.Context, func (o *operator) GetFeatureSupportID() models.FeatureSupportLevelID { return models.FeatureSupportLevelIDSERVERLESS } + +func (o *operator) GetBundleLabels() pq.StringArray { + return Operator.Bundles +} diff --git a/internal/operators/servicemesh/servicemesh_operator.go b/internal/operators/servicemesh/servicemesh_operator.go index 2d0f2edb4e4..2c23c0bb7d1 100644 --- a/internal/operators/servicemesh/servicemesh_operator.go +++ b/internal/operators/servicemesh/servicemesh_operator.go @@ -5,6 +5,7 @@ import ( "text/template" "github.com/kelseyhightower/envconfig" + "github.com/lib/pq" "github.com/openshift/assisted-service/internal/common" "github.com/openshift/assisted-service/internal/operators/api" "github.com/openshift/assisted-service/internal/templating" @@ -18,6 +19,7 @@ var Operator = models.MonitoredOperator{ OperatorType: models.OperatorTypeOlm, SubscriptionName: "servicemeshoperator", TimeoutSeconds: 30 * 60, + Bundles: pq.StringArray{string(models.BundleOpenshiftai)}, } // operator is an service mesh OLM operator plugin. @@ -137,3 +139,7 @@ func (o *operator) GetPreflightRequirements(context context.Context, func (o *operator) GetFeatureSupportID() models.FeatureSupportLevelID { return models.FeatureSupportLevelIDSERVICEMESH } + +func (o *operator) GetBundleLabels() pq.StringArray { + return Operator.Bundles +}