Skip to content

Commit

Permalink
Add test showing swap from advanced to standard not allowed
Browse files Browse the repository at this point in the history
  • Loading branch information
fantapop committed Dec 5, 2024
1 parent 922139a commit 55d2b94
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions internal/provider/cluster_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1273,6 +1273,37 @@ func TestIntegrationServerlessClusterResource(t *testing.T) {
}
},
},
{
name: "attempt to update an advanced cluster to a standard cluster in place",
createStep: func() resource.TestStep {
return resource.TestStep{
Config: getTestDedicatedClusterResourceConfig(clusterName, latestClusterMajorVersion, false, 4, nil),
}
},
initialCluster: client.Cluster{
Id: uuid.Nil.String(),
Name: clusterName,
CloudProvider: "GCP",
CockroachVersion: latestClusterMajorVersion,
Config: client.ClusterConfig{
Dedicated: &client.DedicatedHardwareConfig{
NumVirtualCpus: 4,
StorageGib: 15,
},
},
Plan: client.PLANTYPE_ADVANCED,
State: client.CLUSTERSTATETYPE_CREATED,
CidrRange: "172.28.0.0/16",
Regions: []client.Region{ { Name: "us-central1", NodeCount: 1 } },
},
updateStep: func() resource.TestStep {
config := serverlessClusterStep(clusterName, client.PLANTYPE_STANDARD, slsConfig{vcpus: ptr(6), version: ptr(latestClusterMajorVersion)}).Config
return resource.TestStep{
Config: config,
ExpectError: regexp.MustCompile(`Cannot update cluster plan type`),
}
},
},
}

for _, c := range cases {
Expand Down

0 comments on commit 55d2b94

Please sign in to comment.