From a73238d0f0ab4af360fe3bc7c907e666ee9c1ebe Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Apr 2024 18:11:38 -0500 Subject: [PATCH] Bump github.com/hewlettpackard/hpegl-metal-client from 1.5.10 to 1.5.11 (#190) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Bump github.com/hewlettpackard/hpegl-metal-client from 1.5.10 to 1.5.11 Bumps [github.com/hewlettpackard/hpegl-metal-client](https://github.com/hewlettpackard/hpegl-metal-client) from 1.5.10 to 1.5.11. - [Release notes](https://github.com/hewlettpackard/hpegl-metal-client/releases) - [Commits](https://github.com/hewlettpackard/hpegl-metal-client/compare/v1.5.10...v1.5.11) --- updated-dependencies: - dependency-name: github.com/hewlettpackard/hpegl-metal-client dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Add project API support to enable volume replication for Project * update test * update test --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: “Patricia --- go.mod | 2 +- go.sum | 4 ++-- .../acceptance_test/resource_project_test.go | 3 ++- internal/resources/resource_project.go | 18 +++++++++++++++++- version | 2 +- 5 files changed, 23 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index df51040..1a4f0db 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/golangci/golangci-lint v1.55.2 github.com/hashicorp/terraform-plugin-docs v0.19.1 github.com/hashicorp/terraform-plugin-sdk/v2 v2.33.0 - github.com/hewlettpackard/hpegl-metal-client v1.5.10 + github.com/hewlettpackard/hpegl-metal-client v1.5.11 github.com/hewlettpackard/hpegl-provider-lib v0.0.14 github.com/stretchr/testify v1.9.0 gopkg.in/yaml.v2 v2.4.0 diff --git a/go.sum b/go.sum index 41899ef..7fc7327 100644 --- a/go.sum +++ b/go.sum @@ -401,8 +401,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.10 h1:8E7JWzFrQoVH4x1EKTIG5vrKmWdXhennQquRuBne8hI= -github.com/hewlettpackard/hpegl-metal-client v1.5.10/go.mod h1:E72/o32a5WwVAUhXvXEUKZOGiSA84hsTS+xezFqtbgU= +github.com/hewlettpackard/hpegl-metal-client v1.5.11 h1:uTCGYRrKGG/Nd5i7KLL9jSW1XDYrB1pKI3mpZsKtSYM= +github.com/hewlettpackard/hpegl-metal-client v1.5.11/go.mod h1:E72/o32a5WwVAUhXvXEUKZOGiSA84hsTS+xezFqtbgU= github.com/hewlettpackard/hpegl-provider-lib v0.0.14 h1:fwIXQsdEdeYYvaJQr1vwfPgCGYKgZaP7kL0p8xbBQJ4= github.com/hewlettpackard/hpegl-provider-lib v0.0.14/go.mod h1:7StTTobQIl8pZCLcJnZm0/+N4lNE2MO6H/U0LhTfXog= github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= diff --git a/internal/acceptance_test/resource_project_test.go b/internal/acceptance_test/resource_project_test.go index 4943ce2..b31a1e3 100644 --- a/internal/acceptance_test/resource_project_test.go +++ b/internal/acceptance_test/resource_project_test.go @@ -1,4 +1,4 @@ -// (C) Copyright 2022 Hewlett Packard Enterprise Development LP +// (C) Copyright 2022,2024 Hewlett Packard Enterprise Development LP package acceptance_test @@ -88,6 +88,7 @@ func projectBasic(op string) string { private_networks = 30 } sites=["1ad98170-993e-4bfc-8b84-e689ea9a429b"] + volume_replication_enabled = true }`, name, company, hosts) return common + res diff --git a/internal/resources/resource_project.go b/internal/resources/resource_project.go index 65202c8..55db681 100644 --- a/internal/resources/resource_project.go +++ b/internal/resources/resource_project.go @@ -1,4 +1,4 @@ -// (C) Copyright 2020-2023 Hewlett Packard Enterprise Development LP +// (C) Copyright 2020-2024 Hewlett Packard Enterprise Development LP package resources @@ -32,6 +32,8 @@ const ( pPrivateNetworks = "private_networks" pInstanceTypes = "instance_types" pPermittedImages = "permitted_images" + + pVolumeReplicationEnabled = "volume_replication_enabled" ) func limitsSchema() map[string]*schema.Schema { @@ -163,6 +165,14 @@ func projectSchema() map[string]*schema.Schema { Type: schema.TypeString, }, }, + + pVolumeReplicationEnabled: { + Type: schema.TypeBool, + Optional: true, + Default: false, + ForceNew: true, + Description: "Volume replication is enabled for the project if set.", + }, } } @@ -190,6 +200,8 @@ func resourceMetalProjectCreate(d *schema.ResourceData, meta interface{}) (err e np := rest.NewProject{ Name: d.Get(pName).(string), + + VolumeReplicationEnabled: d.Get(pVolumeReplicationEnabled).(bool), } if list, ok := d.Get(pProfile).([]interface{}); ok && len(list) == 1 { @@ -372,6 +384,10 @@ func resourceMetalProjectRead(d *schema.ResourceData, meta interface{}) (err err } } + if err = d.Set(pVolumeReplicationEnabled, project.VolumeReplicationEnabled); err != nil { + return err //nolint:wrapcheck // defer func is wrapping the error. + } + return nil } diff --git a/version b/version index 825879a..3cb7374 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.3.52 +1.3.53