-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4969 from modular-magician/codegen-pr-2739
Cluster authenticator groups ga
- Loading branch information
Showing
3 changed files
with
114 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -194,6 +194,26 @@ func TestAccContainerCluster_withMasterAuthConfig_NoCert(t *testing.T) { | |
}) | ||
} | ||
|
||
func TestAccContainerCluster_withAuthenticatorGroupsConfig(t *testing.T) { | ||
t.Parallel() | ||
clusterName := fmt.Sprintf("cluster-test-%s", acctest.RandString(10)) | ||
resource.Test(t, resource.TestCase{ | ||
PreCheck: func() { testAccPreCheck(t) }, | ||
Providers: testAccProviders, | ||
CheckDestroy: testAccCheckContainerClusterDestroy, | ||
Steps: []resource.TestStep{ | ||
{ | ||
Config: testAccContainerCluster_withAuthenticatorGroupsConfig(clusterName), | ||
}, | ||
{ | ||
ResourceName: "google_container_cluster.with_authenticator_groups", | ||
ImportState: true, | ||
ImportStateVerify: true, | ||
}, | ||
}, | ||
}) | ||
} | ||
|
||
func TestAccContainerCluster_withNetworkPolicyEnabled(t *testing.T) { | ||
t.Parallel() | ||
|
||
|
@@ -1390,6 +1410,50 @@ resource "google_container_cluster" "with_network_policy_enabled" { | |
`, clusterName) | ||
} | ||
|
||
func testAccContainerCluster_withAuthenticatorGroupsConfig(clusterName string) string { | ||
return fmt.Sprintf(` | ||
resource "google_compute_network" "container_network" { | ||
name = "container-net-%s" | ||
auto_create_subnetworks = false | ||
} | ||
resource "google_compute_subnetwork" "container_subnetwork" { | ||
name = google_compute_network.container_network.name | ||
network = google_compute_network.container_network.name | ||
ip_cidr_range = "10.0.36.0/24" | ||
region = "us-central1" | ||
private_ip_google_access = true | ||
secondary_ip_range { | ||
range_name = "pod" | ||
ip_cidr_range = "10.0.0.0/19" | ||
} | ||
secondary_ip_range { | ||
range_name = "svc" | ||
ip_cidr_range = "10.0.32.0/22" | ||
} | ||
} | ||
resource "google_container_cluster" "with_authenticator_groups" { | ||
name = "%s" | ||
location = "us-central1-a" | ||
initial_node_count = 1 | ||
network = google_compute_network.container_network.name | ||
subnetwork = google_compute_subnetwork.container_subnetwork.name | ||
authenticator_groups_config { | ||
security_group = "[email protected]" | ||
} | ||
ip_allocation_policy { | ||
cluster_secondary_range_name = google_compute_subnetwork.container_subnetwork.secondary_ip_range[0].range_name | ||
services_secondary_range_name = google_compute_subnetwork.container_subnetwork.secondary_ip_range[1].range_name | ||
} | ||
} | ||
`, clusterName, clusterName) | ||
} | ||
|
||
func testAccContainerCluster_withMasterAuthorizedNetworksConfig(clusterName string, cidrs []string, emptyValue string) string { | ||
|
||
cidrBlocks := emptyValue | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters