From 73c7129746df2f421ced8ca824401576a4713be4 Mon Sep 17 00:00:00 2001 From: Axel Ismirlian Date: Tue, 15 Oct 2024 11:44:42 -0500 Subject: [PATCH] Fix volume size and count validation --- ibm/service/power/resource_ibm_pi_volume.go | 2 +- ibm/service/power/resource_ibm_pi_volume_bulk.go | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/ibm/service/power/resource_ibm_pi_volume.go b/ibm/service/power/resource_ibm_pi_volume.go index 365de4a32c..8a11bd1948 100644 --- a/ibm/service/power/resource_ibm_pi_volume.go +++ b/ibm/service/power/resource_ibm_pi_volume.go @@ -124,7 +124,7 @@ func ResourceIBMPIVolume() *schema.Resource { Description: "The size of the volume in GB.", Required: true, Type: schema.TypeFloat, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validation.FloatAtLeast(1), }, Arg_VolumeType: { Computed: true, diff --git a/ibm/service/power/resource_ibm_pi_volume_bulk.go b/ibm/service/power/resource_ibm_pi_volume_bulk.go index 290a095e18..b01c620c93 100644 --- a/ibm/service/power/resource_ibm_pi_volume_bulk.go +++ b/ibm/service/power/resource_ibm_pi_volume_bulk.go @@ -85,11 +85,12 @@ func ResourceIBMPIVolumeBulk() *schema.Resource { ValidateFunc: validation.NoZeroValues, }, Arg_Count: { - Default: 1, - Description: "Number of volumes to create. Default 1.", - ForceNew: true, - Optional: true, - Type: schema.TypeInt, + Default: 1, + Description: "Number of volumes to create. Default 1.", + ForceNew: true, + Optional: true, + Type: schema.TypeInt, + ValidateFunc: validation.IntAtLeast(1), }, Arg_ReplicationEnabled: { Computed: true, @@ -138,7 +139,7 @@ func ResourceIBMPIVolumeBulk() *schema.Resource { ForceNew: true, Required: true, Type: schema.TypeFloat, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validation.FloatAtLeast(1), }, Arg_VolumeType: { Computed: true,