From 34c384a51fb04434a78e90d0e13e45abb5e14a70 Mon Sep 17 00:00:00 2001 From: Achu <91447221+achu-1612@users.noreply.github.com> Date: Tue, 24 Sep 2024 09:50:15 +0530 Subject: [PATCH] DE24092: volume: add export count attribute (#222) * volume: add export count attribute * mod: updated metal client to v1.5.23 * mod: go mod tidy --- go.mod | 2 +- go.sum | 4 ++-- internal/resources/resource_volume.go | 13 +++++++++++++ version | 2 +- 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index ea1d403..22a7d32 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/golangci/golangci-lint v1.58.2 github.com/hashicorp/terraform-plugin-docs v0.19.4 github.com/hashicorp/terraform-plugin-sdk/v2 v2.34.0 - github.com/hewlettpackard/hpegl-metal-client v1.5.22 + github.com/hewlettpackard/hpegl-metal-client v1.5.23 github.com/hewlettpackard/hpegl-provider-lib v0.0.18 github.com/stretchr/testify v1.9.0 gopkg.in/yaml.v2 v2.4.0 diff --git a/go.sum b/go.sum index 067318a..fb447aa 100644 --- a/go.sum +++ b/go.sum @@ -387,8 +387,8 @@ github.com/hashicorp/terraform-svchost v0.1.1 h1:EZZimZ1GxdqFRinZ1tpJwVxxt49xc/S github.com/hashicorp/terraform-svchost v0.1.1/go.mod h1:mNsjQfZyf/Jhz35v6/0LWcv26+X7JPS+buii2c9/ctc= github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE= github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= -github.com/hewlettpackard/hpegl-metal-client v1.5.22 h1:EW19Adpfroi27jpYYjlNddx/TwGKnTVysd5Lpqoo/ls= -github.com/hewlettpackard/hpegl-metal-client v1.5.22/go.mod h1:+BO4BfQXf3IWnsxvk2IdE27Ijrm1jDVYIgpebYh1L9M= +github.com/hewlettpackard/hpegl-metal-client v1.5.23 h1:EQuYg4qGpUUF11hNYqb3ekzUKgqIfQd2RNg1Y3SCGqc= +github.com/hewlettpackard/hpegl-metal-client v1.5.23/go.mod h1:+BO4BfQXf3IWnsxvk2IdE27Ijrm1jDVYIgpebYh1L9M= github.com/hewlettpackard/hpegl-provider-lib v0.0.18 h1:87iXgq8Oe2ebBRicL5K+HknQF9e1ce6MHfIHeTVVqlI= github.com/hewlettpackard/hpegl-provider-lib v0.0.18/go.mod h1:Bw2DhefBjqXQI6s5vBBGiWUkFz7fx4KkbGfwmo9wv3U= github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= diff --git a/internal/resources/resource_volume.go b/internal/resources/resource_volume.go index 9c1e2c6..194d6d1 100644 --- a/internal/resources/resource_volume.go +++ b/internal/resources/resource_volume.go @@ -37,6 +37,7 @@ const ( vActiveSite = "active_site" vCreatedSite = "created_site" vReplicationEnabled = "replication_enabled" + vExportCount = "export_count" // volume Info constants. vID = "id" @@ -202,6 +203,14 @@ func volumeSchema() map[string]*schema.Schema { Computed: true, Description: "The site where the volume was originally created.", }, + + vExportCount: { + Type: schema.TypeInt, + Required: false, + Optional: false, + Computed: true, + Description: "The number of active exports for this volume", + }, } } @@ -391,6 +400,10 @@ func resourceMetalVolumeRead(d *schema.ResourceData, meta interface{}) (err erro return fmt.Errorf("set %s : %v", vReplicationEnabled, err) } + if err = d.Set(vExportCount, volume.ExportCount); err != nil { + return fmt.Errorf("set %s: %v", vExportCount, err) + } + d.Set(vName, volume.Name) d.Set(vDescription, volume.Description) flavorName, _ := p.GetVolumeFlavorName(volume.FlavorID) diff --git a/version b/version index 160c739..02c1916 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.3.61 +1.3.62