From c5cd358259439dadaf8ed4a30f703f5bb003f151 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 24 Apr 2024 20:32:27 +0000 Subject: [PATCH 1/4] 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] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 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= From 437c2f0100dc080dbc81202c611bd5350e399bc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CPatricia?= Date: Fri, 26 Apr 2024 13:15:29 -0500 Subject: [PATCH 2/4] Add project API support to enable volume replication for Project --- internal/resources/resource_project.go | 18 +++++++++++++++++- version | 2 +- 2 files changed, 18 insertions(+), 2 deletions(-) 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 From f335955b1fd7c19d805f80bbf0234836ab4f995d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CPatricia?= Date: Mon, 29 Apr 2024 11:44:03 -0500 Subject: [PATCH 3/4] update test --- internal/acceptance_test/resource_project_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/acceptance_test/resource_project_test.go b/internal/acceptance_test/resource_project_test.go index 4943ce2..e47772d 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 = false }`, name, company, hosts) return common + res From a0fde1479812aebf1bf49e896c122e56de9155b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CPatricia?= Date: Mon, 29 Apr 2024 13:24:34 -0500 Subject: [PATCH 4/4] update test --- internal/acceptance_test/resource_project_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/acceptance_test/resource_project_test.go b/internal/acceptance_test/resource_project_test.go index e47772d..b31a1e3 100644 --- a/internal/acceptance_test/resource_project_test.go +++ b/internal/acceptance_test/resource_project_test.go @@ -88,7 +88,7 @@ func projectBasic(op string) string { private_networks = 30 } sites=["1ad98170-993e-4bfc-8b84-e689ea9a429b"] - volume_replication_enabled = false + volume_replication_enabled = true }`, name, company, hosts) return common + res