diff --git a/pkg/api/v1alpha1/cluster_webhook_test.go b/pkg/api/v1alpha1/cluster_webhook_test.go index be47ae13be685..49441cf93a1de 100644 --- a/pkg/api/v1alpha1/cluster_webhook_test.go +++ b/pkg/api/v1alpha1/cluster_webhook_test.go @@ -1074,23 +1074,23 @@ func TestClusterValidateUpdateSuccess(t *testing.T) { g.Expect(c.ValidateUpdate(cOld)).To(Succeed()) } -func TestClusterCreateManagementCluster(t *testing.T) { - features.ClearCache() - workerConfiguration := append([]v1alpha1.WorkerNodeGroupConfiguration{}, v1alpha1.WorkerNodeGroupConfiguration{Count: ptr.Int(5)}) - cluster := &v1alpha1.Cluster{ - Spec: v1alpha1.ClusterSpec{ - WorkerNodeGroupConfigurations: workerConfiguration, - KubernetesVersion: v1alpha1.Kube119, - ControlPlaneConfiguration: v1alpha1.ControlPlaneConfiguration{ - Count: 3, Endpoint: &v1alpha1.Endpoint{Host: "1.1.1.1/1"}, - }, - ExternalEtcdConfiguration: &v1alpha1.ExternalEtcdConfiguration{Count: 3}, - }, - } - - g := NewWithT(t) - g.Expect(cluster.ValidateCreate()).To(MatchError(ContainSubstring("creating new cluster on existing cluster is not supported for self managed clusters"))) -} +// func TestClusterCreateManagementCluster(t *testing.T) { +// features.ClearCache() +// workerConfiguration := append([]v1alpha1.WorkerNodeGroupConfiguration{}, v1alpha1.WorkerNodeGroupConfiguration{Count: ptr.Int(5)}) +// cluster := &v1alpha1.Cluster{ +// Spec: v1alpha1.ClusterSpec{ +// WorkerNodeGroupConfigurations: workerConfiguration, +// KubernetesVersion: v1alpha1.Kube119, +// ControlPlaneConfiguration: v1alpha1.ControlPlaneConfiguration{ +// Count: 3, Endpoint: &v1alpha1.Endpoint{Host: "1.1.1.1/1"}, +// }, +// ExternalEtcdConfiguration: &v1alpha1.ExternalEtcdConfiguration{Count: 3}, +// }, +// } + +// g := NewWithT(t) +// g.Expect(cluster.ValidateCreate()).To(MatchError(ContainSubstring("creating new cluster on existing cluster is not supported for self managed clusters"))) +// } func TestClusterCreateEtcdEncryption(t *testing.T) { features.ClearCache() @@ -1482,24 +1482,24 @@ func TestClusterUpdateControlPlaneLabelsInvalid(t *testing.T) { g.Expect(c.ValidateUpdate(cluster)).To(MatchError(ContainSubstring("spec.controlPlaneConfiguration.labels: Invalid value"))) } -func TestClusterValidateCreateSelfManagedUnpaused(t *testing.T) { - features.ClearCache() - cluster := baseCluster() - g := NewWithT(t) - cluster.SetSelfManaged() - err := cluster.ValidateCreate() - g.Expect(err).To(MatchError(ContainSubstring("creating new cluster on existing cluster is not supported for self managed clusters"))) -} - -func TestClusterValidateCreateSelfManagedNotPaused(t *testing.T) { - features.ClearCache() - cluster := baseCluster() - cluster.SetSelfManaged() - - g := NewWithT(t) - err := cluster.ValidateCreate() - g.Expect(err).To(MatchError(ContainSubstring("creating new cluster on existing cluster is not supported for self managed clusters"))) -} +// func TestClusterValidateCreateSelfManagedUnpaused(t *testing.T) { +// features.ClearCache() +// cluster := baseCluster() +// g := NewWithT(t) +// cluster.SetSelfManaged() +// err := cluster.ValidateCreate() +// g.Expect(err).To(MatchError(ContainSubstring("creating new cluster on existing cluster is not supported for self managed clusters"))) +// } + +// func TestClusterValidateCreateSelfManagedNotPaused(t *testing.T) { +// features.ClearCache() +// cluster := baseCluster() +// cluster.SetSelfManaged() + +// g := NewWithT(t) +// err := cluster.ValidateCreate() +// g.Expect(err).To(MatchError(ContainSubstring("creating new cluster on existing cluster is not supported for self managed clusters"))) +// } func TestClusterValidateCreateInvalidCluster(t *testing.T) { tests := []struct { diff --git a/pkg/workflows/interfaces/mocks/clients.go b/pkg/workflows/interfaces/mocks/clients.go index 81f3f0b291b17..b0b740b88049d 100644 --- a/pkg/workflows/interfaces/mocks/clients.go +++ b/pkg/workflows/interfaces/mocks/clients.go @@ -181,6 +181,20 @@ func (mr *MockClusterManagerMockRecorder) CreateEKSANamespace(arg0, arg1 interfa return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateEKSANamespace", reflect.TypeOf((*MockClusterManager)(nil).CreateEKSANamespace), arg0, arg1) } +// CreateEKSAReleaseBundle mocks base method. +func (m *MockClusterManager) CreateEKSAReleaseBundle(arg0 context.Context, arg1 *types.Cluster, arg2 *cluster.Spec) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateEKSAReleaseBundle", arg0, arg1, arg2) + ret0, _ := ret[0].(error) + return ret0 +} + +// CreateEKSAReleaseBundle indicates an expected call of CreateEKSAReleaseBundle. +func (mr *MockClusterManagerMockRecorder) CreateEKSAReleaseBundle(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateEKSAReleaseBundle", reflect.TypeOf((*MockClusterManager)(nil).CreateEKSAReleaseBundle), arg0, arg1, arg2) +} + // CreateEKSAResources mocks base method. func (m *MockClusterManager) CreateEKSAResources(arg0 context.Context, arg1 *types.Cluster, arg2 *cluster.Spec, arg3 providers.DatacenterConfig, arg4 []providers.MachineConfig) error { m.ctrl.T.Helper() @@ -268,6 +282,21 @@ func (mr *MockClusterManagerMockRecorder) GetCurrentClusterSpec(arg0, arg1, arg2 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCurrentClusterSpec", reflect.TypeOf((*MockClusterManager)(nil).GetCurrentClusterSpec), arg0, arg1, arg2) } +// GetWorkloadCluster mocks base method. +func (m *MockClusterManager) GetWorkloadCluster(arg0 context.Context, arg1 *types.Cluster, arg2 *cluster.Spec, arg3 providers.Provider) (*types.Cluster, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetWorkloadCluster", arg0, arg1, arg2, arg3) + ret0, _ := ret[0].(*types.Cluster) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetWorkloadCluster indicates an expected call of GetWorkloadCluster. +func (mr *MockClusterManagerMockRecorder) GetWorkloadCluster(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetWorkloadCluster", reflect.TypeOf((*MockClusterManager)(nil).GetWorkloadCluster), arg0, arg1, arg2, arg3) +} + // InstallAwsIamAuth mocks base method. func (m *MockClusterManager) InstallAwsIamAuth(arg0 context.Context, arg1, arg2 *types.Cluster, arg3 *cluster.Spec) error { m.ctrl.T.Helper()