@@ -3332,20 +3332,63 @@ func TestAccContainerCluster_withDNSConfig(t *testing.T) {
33323332
33333333func TestAccContainerCluster_withGatewayApiConfig(t *testing.T) {
33343334 t.Parallel()
3335-
33363335 clusterName := fmt.Sprintf("tf-test-cluster-%s", randString(t, 10))
33373336 vcrTest(t, resource.TestCase{
33383337 PreCheck: func() { testAccPreCheck(t) },
33393338 Providers: testAccProviders,
33403339 CheckDestroy: testAccCheckContainerClusterDestroyProducer(t),
33413340 Steps: []resource.TestStep{
3341+ {
3342+ Config: testAccContainerCluster_basic_1_24(clusterName),
3343+ },
3344+ {
3345+ ResourceName: "google_container_cluster.primary",
3346+ ImportState: true,
3347+ ImportStateVerify: true,
3348+ ImportStateVerifyIgnore: []string{"min_master_version"},
3349+ },
33423350 {
33433351 Config: testAccContainerCluster_withGatewayApiConfig(clusterName, "CHANNEL_STANDARD"),
33443352 },
33453353 {
3346- ResourceName: "google_container_cluster.with_gateway_api_config ",
3354+ ResourceName: "google_container_cluster.primary ",
33473355 ImportState: true,
33483356 ImportStateVerify: true,
3357+ ImportStateVerifyIgnore: []string{"min_master_version"},
3358+ },
3359+ {
3360+ Config: testAccContainerCluster_withGatewayApiConfig(clusterName, "CHANNEL_EXPERIMENTAL"),
3361+ },
3362+ {
3363+ ResourceName: "google_container_cluster.primary",
3364+ ImportState: true,
3365+ ImportStateVerify: true,
3366+ ImportStateVerifyIgnore: []string{"min_master_version"},
3367+ },
3368+ {
3369+ Config: testAccContainerCluster_basic_1_24(clusterName),
3370+ },
3371+ {
3372+ ResourceName: "google_container_cluster.primary",
3373+ ImportState: true,
3374+ ImportStateVerify: true,
3375+ ImportStateVerifyIgnore: []string{"min_master_version"},
3376+ },
3377+ },
3378+ })
3379+ }
3380+
3381+ func TestAccContainerCluster_withInvalidGatewayApiConfigChannel(t *testing.T) {
3382+ t.Parallel()
3383+ clusterName := fmt.Sprintf("tf-test-cluster-%s", randString(t, 10))
3384+ vcrTest(t, resource.TestCase{
3385+ PreCheck: func() { testAccPreCheck(t) },
3386+ Providers: testAccProviders,
3387+ CheckDestroy: testAccCheckContainerClusterDestroyProducer(t),
3388+ Steps: []resource.TestStep{
3389+ {
3390+ Config: testAccContainerCluster_withGatewayApiConfig(clusterName, "CANARY"),
3391+ ExpectError: regexp.MustCompile(`expected gateway_api_config\.0\.channel to be one of \[CHANNEL_UNSPECIFIED CHANNEL_DISABLED CHANNEL_EXPERIMENTAL CHANNEL_STANDARD\], got CANARY`),
33493392 },
33503393 },
33513394 })
@@ -3537,6 +3580,28 @@ resource "google_container_cluster" "primary" {
35373580`, name)
35383581}
35393582
3583+ func testAccContainerCluster_basic_1_23_8(name string) string {
3584+ return fmt.Sprintf(`
3585+ resource "google_container_cluster" "primary" {
3586+ name = "%s"
3587+ location = "us-central1-a"
3588+ initial_node_count = 1
3589+ min_master_version = "1.23.8-gke.1900"
3590+ }
3591+ `, name)
3592+ }
3593+
3594+ func testAccContainerCluster_basic_1_24(name string) string {
3595+ return fmt.Sprintf(`
3596+ resource "google_container_cluster" "primary" {
3597+ name = "%s"
3598+ location = "us-central1-a"
3599+ initial_node_count = 1
3600+ min_master_version = "1.24"
3601+ }
3602+ `, name)
3603+ }
3604+
35403605func testAccContainerCluster_networkingModeRoutes(name string) string {
35413606 return fmt.Sprintf(`
35423607resource "google_container_cluster" "primary" {
@@ -6607,13 +6672,11 @@ resource "google_container_cluster" "with_dns_config" {
66076672
66086673func testAccContainerCluster_withGatewayApiConfig(clusterName string, gatewayApiChannel string) string {
66096674 return fmt.Sprintf(`
6610- resource "google_container_cluster" "with_gateway_api_config " {
6675+ resource "google_container_cluster" "primary " {
66116676 name = "%s"
66126677 location = "us-central1-f"
66136678 initial_node_count = 1
6614- release_channel {
6615- channel = "RAPID"
6616- }
6679+ min_master_version = "1.24"
66176680 gateway_api_config {
66186681 channel = "%s"
66196682 }
@@ -6694,17 +6757,6 @@ resource "google_container_cluster" "primary" {
66946757`, name)
66956758}
66966759
6697- func testAccContainerCluster_basic_1_23_8(name string) string {
6698- return fmt.Sprintf(`
6699- resource "google_container_cluster" "primary" {
6700- name = "%s"
6701- location = "us-central1-a"
6702- initial_node_count = 1
6703- min_master_version = "1.23.8-gke.1900"
6704- }
6705- `, name)
6706- }
6707-
67086760func testAccContainerCluster_withMonitoringConfigEnabled(name string) string {
67096761 return fmt.Sprintf(`
67106762resource "google_container_cluster" "primary" {
0 commit comments