Skip to content

Commit

Permalink
rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
mitalipaygude committed Dec 1, 2023
1 parent 74bd5d1 commit 6c61a0c
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 35 deletions.
70 changes: 35 additions & 35 deletions pkg/api/v1alpha1/cluster_webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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 {
Expand Down
29 changes: 29 additions & 0 deletions pkg/workflows/interfaces/mocks/clients.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6c61a0c

Please sign in to comment.