From c99eea7a7d87f976c4e7a59bde876f161185854d Mon Sep 17 00:00:00 2001 From: Arthur Outhenin-Chalandre Date: Sat, 9 Apr 2022 18:28:52 +0200 Subject: [PATCH] Add containerinfra nodegroup zero node count support Signed-off-by: Arthur Outhenin-Chalandre --- .../resource_openstack_containerinfra_nodegroup_v1.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/openstack/resource_openstack_containerinfra_nodegroup_v1.go b/openstack/resource_openstack_containerinfra_nodegroup_v1.go index 1e33dc5f1..b2c15610a 100644 --- a/openstack/resource_openstack_containerinfra_nodegroup_v1.go +++ b/openstack/resource_openstack_containerinfra_nodegroup_v1.go @@ -91,7 +91,7 @@ func resourceContainerInfraNodeGroupV1() *schema.Resource { Type: schema.TypeInt, Optional: true, ForceNew: true, - Computed: true, + Default: 1, }, "min_node_count": { @@ -156,8 +156,12 @@ func resourceContainerInfraNodeGroupV1Create(ctx context.Context, d *schema.Reso createOpts.DockerVolumeSize = &dockerVolumeSize } nodeCount := d.Get("node_count").(int) - if nodeCount > 0 { + if nodeCount >= 0 { createOpts.NodeCount = &nodeCount + if nodeCount == 0 { + containerInfraClient.Microversion = containerInfraV1ZeroNodeCountMicroversion + + } } maxNodeCount := d.Get("max_node_count").(int) if maxNodeCount > 0 {