Skip to content

Commit

Permalink
Merge pull request #209 from NetApp/integration/main
Browse files Browse the repository at this point in the history
Integration/main
  • Loading branch information
wenjun666 authored Nov 27, 2024
2 parents 02b324e + 0fe07ae commit e581b7e
Show file tree
Hide file tree
Showing 9 changed files with 349 additions and 57 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 24.11.3
ENHANCEMENTS:
* Update GCP storage package to support GCP identity federation. This version requries terraform 1.1 and the Go 1.21.
* Update document: indicate the minimum required terraform version

BUG FIXES:
* resource/connector_gcp: Fix schema structure while creating Restricted mode.

## 24.11.2
BUG FIXES:
* add `azure_tag` option in documentation.
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ The syntax is as follows:

```hcl
terraform {
required_version = ">= 1.1"
required_providers {
netapp-cloudmanager = {
source = "NetApp/netapp-cloudmanager"
Expand Down
33 changes: 29 additions & 4 deletions cloudmanager/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,21 @@ type policySchedule struct {
Retention int `json:"retention"`
}

// vmInstance
type vmInstance struct {
NetworkInterfaces []networkInterfaces `json:"networkInterfaces"`
}

// networkInterfaces
type networkInterfaces struct {
AccessConfigs []accessConfigs `json:"accessConfigs"`
}

// accessConfigs
type accessConfigs struct {
NatIP string `json:"natIP"`
}

// Check HTTP response code, return error if HTTP request is not successed.
func apiResponseChecker(statusCode int, response []byte, funcName string) error {

Expand Down Expand Up @@ -1341,10 +1356,20 @@ func (c *Client) setOCCMConfig(request configValuesUpdateRequest, clientID strin
log.Print("Error creating instance")
return err
}
if len(vm["networkInterfaces"].([]interface{})) > 0 {
accessConfigs := vm["networkInterfaces"].([]interface{})[0].(map[string]interface{})["accessConfigs"]
if len(accessConfigs.([]interface{})) > 0 {
connectorIP = vm["networkInterfaces"].([]interface{})[0].(map[string]interface{})["accessConfigs"].([]interface{})[0].(map[string]interface{})["natIP"].(string)
var vmInstance vmInstance
vmjsonbody, err := json.Marshal(vm)
if err != nil {
log.Print("Failed to marshall response from getVMInstance ", err)
return err
}
if err := json.Unmarshal(vmjsonbody, &vmInstance); err != nil {
log.Print("Failed to unmarshall response from getVMInstance ", err)
return err
}

if len(vmInstance.NetworkInterfaces) > 0 {
if len(vmInstance.NetworkInterfaces[0].AccessConfigs) > 0 {
connectorIP = vmInstance.NetworkInterfaces[0].AccessConfigs[0].NatIP
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion examples/cloudmanager/local/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ provider "netapp-cloudmanager" {
}

terraform {
required_version = ">= 0.13"
required_version = ">= 1.1"
required_providers {
netapp-cloudmanager = {
source = "netapp.com/netapp/netapp-cloudmanager"
Expand Down
2 changes: 1 addition & 1 deletion examples/cloudmanager/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ provider "netapp-cloudmanager" {
}

terraform {
required_version = ">= 0.13"
required_version = ">= 1.1"
required_providers {
netapp-cloudmanager = {
source = "hashicorp/netapp-cloudmanager"
Expand Down
2 changes: 1 addition & 1 deletion examples/cloudmanager/versions.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

terraform {
required_version = ">= 0.12"
required_version = ">= 1.1"
}
2 changes: 1 addition & 1 deletion examples/volume/versions.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

terraform {
required_version = ">= 0.12"
required_version = ">= 1.1"
}
97 changes: 92 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,17 +1,104 @@
module github.com/netapp/terraform-provider-netapp-cloudmanager

go 1.15
go 1.21

require (
github.com/Azure/azure-sdk-for-go v46.4.0+incompatible
github.com/Azure/go-autorest/autorest v0.11.28
github.com/Azure/go-autorest/autorest/azure/auth v0.5.3
github.com/aws/aws-sdk-go v1.35.5
github.com/aws/aws-sdk-go v1.37.0
github.com/fatih/structs v1.1.0
github.com/hashicorp/terraform v0.13.4
github.com/sirupsen/logrus v1.7.0
golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43
golang.org/x/sys v0.0.0-20220818161305-2296e01440c6 // indirect
golang.org/x/tools v0.0.0-20201008025239-9df69603baec // indirect
golang.org/x/oauth2 v0.23.0
gopkg.in/yaml.v2 v2.2.8
)

require (
cloud.google.com/go v0.112.1 // indirect
cloud.google.com/go/compute/metadata v0.5.0 // indirect
cloud.google.com/go/iam v1.1.6 // indirect
cloud.google.com/go/storage v1.38.0 // indirect
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
github.com/Azure/go-autorest/autorest/adal v0.9.18 // indirect
github.com/Azure/go-autorest/autorest/azure/cli v0.4.2 // indirect
github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
github.com/Azure/go-autorest/autorest/to v0.4.0 // indirect
github.com/Azure/go-autorest/autorest/validation v0.3.0 // indirect
github.com/Azure/go-autorest/logger v0.2.1 // indirect
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
github.com/agext/levenshtein v1.2.2 // indirect
github.com/apparentlymart/go-cidr v1.1.0 // indirect
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
github.com/apparentlymart/go-versions v1.0.1 // indirect
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
github.com/bmatcuk/doublestar v1.1.5 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dimchansky/utfbom v1.1.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/golang-jwt/jwt/v4 v4.2.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/mock v1.7.0-rc.1 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/s2a-go v0.1.7 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
github.com/googleapis/gax-go/v2 v2.12.2 // indirect
github.com/hashicorp/errwrap v1.0.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.1 // indirect
github.com/hashicorp/go-getter v1.5.1 // indirect
github.com/hashicorp/go-hclog v0.9.2 // indirect
github.com/hashicorp/go-multierror v1.0.0 // indirect
github.com/hashicorp/go-plugin v1.3.0 // indirect
github.com/hashicorp/go-retryablehttp v0.5.2 // indirect
github.com/hashicorp/go-safetemp v1.0.0 // indirect
github.com/hashicorp/go-uuid v1.0.1 // indirect
github.com/hashicorp/go-version v1.2.0 // indirect
github.com/hashicorp/hcl v0.0.0-20170504190234-a4b07c25de5f // indirect
github.com/hashicorp/hcl/v2 v2.9.1 // indirect
github.com/hashicorp/hil v0.0.0-20190212112733-ab17b08d6590 // indirect
github.com/hashicorp/terraform-config-inspect v0.0.0-20191212124732-c6ae6269b9d7 // indirect
github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 // indirect
github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect
github.com/mitchellh/copystructure v1.0.0 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/go-testing-interface v1.0.0 // indirect
github.com/mitchellh/go-wordwrap v1.0.0 // indirect
github.com/mitchellh/mapstructure v1.1.2 // indirect
github.com/mitchellh/reflectwalk v1.0.1 // indirect
github.com/oklog/run v1.0.0 // indirect
github.com/spf13/afero v1.10.0 // indirect
github.com/stretchr/testify v1.9.0 // indirect
github.com/ulikunitz/xz v0.5.8 // indirect
github.com/vmihailenco/msgpack/v4 v4.3.12 // indirect
github.com/vmihailenco/tagparser v0.1.1 // indirect
github.com/zclconf/go-cty v1.8.0 // indirect
github.com/zclconf/go-cty-yaml v1.0.2 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect
go.opentelemetry.io/otel v1.24.0 // indirect
go.opentelemetry.io/otel/metric v1.24.0 // indirect
go.opentelemetry.io/otel/trace v1.24.0 // indirect
golang.org/x/crypto v0.27.0 // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/net v0.29.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.25.0 // indirect
golang.org/x/text v0.18.0 // indirect
golang.org/x/time v0.5.0 // indirect
google.golang.org/api v0.169.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect
google.golang.org/grpc v1.66.0 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
)
Loading

0 comments on commit e581b7e

Please sign in to comment.