diff --git a/pkg/kubernetes/client/kubeclient_interface.go b/pkg/kubernetes/client/kubeclient_interface.go index 7eadd8fd..9965cc26 100644 --- a/pkg/kubernetes/client/kubeclient_interface.go +++ b/pkg/kubernetes/client/kubeclient_interface.go @@ -91,6 +91,8 @@ type KubeClientConnector interface { CreateOperatorGroup(ctx context.Context, namespace, name string, targetNamespaces []string) (*v1.OperatorGroup, error) // CreateSubscription creates an OLM subscription. CreateSubscription(ctx context.Context, namespace string, subscription *v1alpha1.Subscription) (*v1alpha1.Subscription, error) + // UpdateSubscription updates an OLM subscription. + UpdateSubscription(ctx context.Context, namespace string, subscription *v1alpha1.Subscription) (*v1alpha1.Subscription, error) // CreateSubscriptionForCatalog creates an OLM subscription. CreateSubscriptionForCatalog(ctx context.Context, namespace, name, catalogNamespace, catalog, packageName, channel, startingCSV string, approval v1alpha1.Approval) (*v1alpha1.Subscription, error) // GetSubscription retrieves an OLM subscription by namespace and name. diff --git a/pkg/kubernetes/client/mock_kube_client_connector.go b/pkg/kubernetes/client/mock_kube_client_connector.go index d1b24962..9bf06ae9 100644 --- a/pkg/kubernetes/client/mock_kube_client_connector.go +++ b/pkg/kubernetes/client/mock_kube_client_connector.go @@ -1267,6 +1267,36 @@ func (_m *MockKubeClientConnector) UpdateInstallPlan(ctx context.Context, namesp return r0, r1 } +// UpdateSubscription provides a mock function with given fields: ctx, namespace, subscription +func (_m *MockKubeClientConnector) UpdateSubscription(ctx context.Context, namespace string, subscription *v1alpha1.Subscription) (*v1alpha1.Subscription, error) { + ret := _m.Called(ctx, namespace, subscription) + + if len(ret) == 0 { + panic("no return value specified for UpdateSubscription") + } + + var r0 *v1alpha1.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, *v1alpha1.Subscription) (*v1alpha1.Subscription, error)); ok { + return rf(ctx, namespace, subscription) + } + if rf, ok := ret.Get(0).(func(context.Context, string, *v1alpha1.Subscription) *v1alpha1.Subscription); ok { + r0 = rf(ctx, namespace, subscription) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*v1alpha1.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, *v1alpha1.Subscription) error); ok { + r1 = rf(ctx, namespace, subscription) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + // NewMockKubeClientConnector creates a new instance of MockKubeClientConnector. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockKubeClientConnector(t interface {