Use node_version during google_container_cluster creation (#10817)
This commit is contained in:
parent
2ebbf598cb
commit
b7faae4bac
|
@ -278,6 +278,10 @@ func resourceContainerClusterCreate(d *schema.ResourceData, meta interface{}) er
|
|||
InitialNodeCount: int64(d.Get("initial_node_count").(int)),
|
||||
}
|
||||
|
||||
if v, ok := d.GetOk("node_version"); ok {
|
||||
cluster.InitialClusterVersion = v.(string)
|
||||
}
|
||||
|
||||
if v, ok := d.GetOk("cluster_ipv4_cidr"); ok {
|
||||
cluster.ClusterIpv4Cidr = v.(string)
|
||||
}
|
||||
|
|
|
@ -26,6 +26,23 @@ func TestAccContainerCluster_basic(t *testing.T) {
|
|||
})
|
||||
}
|
||||
|
||||
func TestAccContainerCluster_withVersion(t *testing.T) {
|
||||
resource.Test(t, resource.TestCase{
|
||||
PreCheck: func() { testAccPreCheck(t) },
|
||||
Providers: testAccProviders,
|
||||
CheckDestroy: testAccCheckContainerClusterDestroy,
|
||||
Steps: []resource.TestStep{
|
||||
resource.TestStep{
|
||||
Config: testAccContainerCluster_withVersion,
|
||||
Check: resource.ComposeTestCheckFunc(
|
||||
testAccCheckContainerClusterExists(
|
||||
"google_container_cluster.with_version"),
|
||||
),
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
func TestAccContainerCluster_withNodeConfig(t *testing.T) {
|
||||
resource.Test(t, resource.TestCase{
|
||||
PreCheck: func() { testAccPreCheck(t) },
|
||||
|
@ -138,6 +155,19 @@ resource "google_container_cluster" "primary" {
|
|||
}
|
||||
}`, acctest.RandString(10))
|
||||
|
||||
var testAccContainerCluster_withVersion = fmt.Sprintf(`
|
||||
resource "google_container_cluster" "with_version" {
|
||||
name = "cluster-test-%s"
|
||||
zone = "us-central1-a"
|
||||
node_version = "1.4.7"
|
||||
initial_node_count = 1
|
||||
|
||||
master_auth {
|
||||
username = "mr.yoda"
|
||||
password = "adoy.rm"
|
||||
}
|
||||
}`, acctest.RandString(10))
|
||||
|
||||
var testAccContainerCluster_withNodeConfig = fmt.Sprintf(`
|
||||
resource "google_container_cluster" "with_node_config" {
|
||||
name = "cluster-test-%s"
|
||||
|
|
Loading…
Reference in New Issue