Skip to content

Commit

Permalink
Bump github.com/hewlettpackard/hpegl-metal-client from 1.5.10 to 1.5.…
Browse files Browse the repository at this point in the history
…11 (#190)

* 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](HewlettPackard/hpegl-metal-client@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] <support@github.com>

* Add project API support to enable volume replication for Project

* update test

* update test

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: “Patricia <patricia.dibenedetto@hpe.com>
  • Loading branch information
dependabot[bot] and patricia-dibenedetto authored Apr 29, 2024
1 parent ae57759 commit a73238d
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 6 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
3 changes: 2 additions & 1 deletion internal/acceptance_test/resource_project_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// (C) Copyright 2022 Hewlett Packard Enterprise Development LP
// (C) Copyright 2022,2024 Hewlett Packard Enterprise Development LP

package acceptance_test

Expand Down Expand Up @@ -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
Expand Down
18 changes: 17 additions & 1 deletion internal/resources/resource_project.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// (C) Copyright 2020-2023 Hewlett Packard Enterprise Development LP
// (C) Copyright 2020-2024 Hewlett Packard Enterprise Development LP

package resources

Expand Down Expand Up @@ -32,6 +32,8 @@ const (
pPrivateNetworks = "private_networks"
pInstanceTypes = "instance_types"
pPermittedImages = "permitted_images"

pVolumeReplicationEnabled = "volume_replication_enabled"
)

func limitsSchema() map[string]*schema.Schema {
Expand Down Expand Up @@ -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.",
},
}
}

Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.3.52
1.3.53

0 comments on commit a73238d

Please sign in to comment.