Skip to content

Commit

Permalink
Add containerinfra nodegroup zero node count support
Browse files Browse the repository at this point in the history
Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@cern.ch>
  • Loading branch information
MrFreezeex committed Apr 9, 2022
1 parent eed8562 commit 277a23a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions openstack/resource_openstack_containerinfra_nodegroup_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func resourceContainerInfraNodeGroupV1() *schema.Resource {
Type: schema.TypeInt,
Optional: true,
ForceNew: true,
Computed: true,
Default: 1,
},

"min_node_count": {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 277a23a

Please sign in to comment.