Skip to content

Commit f10af42

Browse files
authored
Randomize network name in the basic cluster (GoogleCloudPlatform#17012)
1 parent 6172dba commit f10af42

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

mmv1/products/hypercomputecluster/Cluster.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -749,5 +749,7 @@ examples:
749749
primary_resource_id: 'cluster'
750750
vars:
751751
cluster_id: 'my-cluster'
752+
network_id: 'cluster-net1'
752753
test_vars_overrides:
753754
cluster_id: 'fmt.Sprintf("tf%s", acctest.RandString(t, 8))'
755+
network_id: 'fmt.Sprintf("cluster-net1-%s", acctest.RandString(t,10))'

mmv1/templates/terraform/examples/hypercomputecluster_cluster_basic.tf.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ resource "google_hypercomputecluster_cluster" "{{$.PrimaryResourceId}}" {
1414
config {
1515
new_network {
1616
description = "Network one"
17-
network = "projects/${local.project_id}/global/networks/cluster-net1"
17+
network = "projects/${local.project_id}/global/networks/{{index $.Vars "network_id"}}"
1818
}
1919
}
2020
}

0 commit comments

Comments
 (0)