diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 32aba750..e1ebfb9d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,7 +26,7 @@ jobs: - name: Checkout code uses: actions/checkout@v2 - name: Format - run: if ![ -z "$(find . -type f -name "*.go" -not -path "./vendor/*" | sed "s|^\./||" | xargs gofmt -l)" ]; then exit 1; fi + run: if [ ! -z "$(find . -type f -name "*.go" -not -path "./vendor/*" | sed "s|^\./||" | xargs gofmt -l)" ]; then exit 1; fi if: matrix.platform == 'ubuntu-latest' - name: Vet run: go vet $(go list ./... | grep -v '/vendor/') diff --git a/CHANGELOG.md b/CHANGELOG.md index c9dd7234..58912830 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,9 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html) -# [v6.1.0-12] (Unreleased) +# [v6.0.0-13] +#### Major changes +1.This release is validated to support Terraform 0.13. Terraform 0.13 support HCL2 and enables automated installation of the HPE OneView Terraform Provider. ### Bug fixes & Enhancements: - [#277] (https://github.com/HewlettPackard/terraform-provider-oneview/issues/277) SPT Import configuration issue diff --git a/Dockerfile b/Dockerfile index 5d8abd57..cd24a9e2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM golang:alpine MAINTAINER "Priyanka Sood " -ENV TERRAFORM_VERSION=0.12.29 +ENV TERRAFORM_VERSION=0.13.6 ENV USER root RUN mkdir -p /usr/local/terraform @@ -21,8 +21,6 @@ WORKDIR /go/src/github.com/HewlettPackard/terraform-provider-oneview COPY . /go/src/github.com/HewlettPackard/terraform-provider-oneview RUN cd $GOPATH/src/github.com/HewlettPackard/terraform-provider-oneview -RUN go build -o $GOPATH/bin/terraform-provider-oneview -RUN mv $GOPATH/bin/terraform-provider-oneview /usr/local/terraform/ RUN go get github.com/kardianos/govendor ENV PATH $PATH:/usr/local/terraform/ diff --git a/README.md b/README.md index aa8fee0f..d8c00e9e 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,12 @@ ## Build Status -OV Version |6.00| 5.60 | 5.50 -| ------------- |:-------------:| -------------:| -------------:| -SDK Version/Tag |[v6.0.0-12 ](https://github.com/HewlettPackard/terraform-provider-oneview/releases/tag/v6.0.0-12)| [v1.7.0-12 ](https://github.com/HewlettPackard/terraform-provider-oneview/releases/tag/v1.7.0-12) | [v1.7.0-12 ](https://github.com/HewlettPackard/terraform-provider-oneview/releases/tag/v1.7.0-12) | -Build Status | ![Build status](https://ci.appveyor.com/api/projects/status/u84505l6syp70013?svg=true)| ![Build status](https://ci.appveyor.com/api/projects/status/u84505l6syp70013?svg=true)| ![Build status](https://ci.appveyor.com/api/projects/status/u84505l6syp70013?svg=true)| +OV Version |6.0.0|6.00| 5.60 | 5.50 +| ------------- |:-------------:| -------------:| -------------:|--------------:| +SDK Version/Tag |[v6.0.0-13 ](https://github.com/HewlettPackard/terraform-provider-oneview/releases/tag/v6.0.0-13)|[v6.0.0-12 ](https://github.com/HewlettPackard/terraform-provider-oneview/releases/tag/v6.0.0-12)| [v1.7.0-12 ](https://github.com/HewlettPackard/terraform-provider-oneview/releases/tag/v1.7.0-12) | [v1.7.0-12 ](https://github.com/HewlettPackard/terraform-provider-oneview/releases/tag/v1.7.0-12) | + Build Status | [![Build status](https://action-badges.now.sh/JasonEtco/action-badges)](https://github.com/HewlettPackard/terraform-provider-oneview/actions/runs/707591356)| [![Build status](https://api.travis-ci.com/HewlettPackard/terraform-provider-oneview.svg)](https://travis-ci.org/github/HewlettPackard/terraform-provider-oneview/builds)| [![Build status](https://api.travis-ci.com/HewlettPackard/terraform-provider-oneview.svg)](https://travis-ci.org/github/HewlettPackard/terraform-provider-oneview/builds)| [![Build status](https://api.travis-ci.com/HewlettPackard/terraform-provider-oneview.svg)](https://travis-ci.org/github/HewlettPackard/terraform-provider-oneview/builds)| ``` -Note: v1.7.0-12 onwards supports Terraform 0.12.xx +Note: v6.0.0-13 onwards supports Terraform 0.13.xx ``` ## Introduction @@ -36,10 +36,10 @@ The light weight containerized version of the HPE OneView SDK for Terraform is a ```bash # Download and store a local copy of oneview-sdk-for-terraform and use it as a Docker Image. -$ docker pull hewlettpackardenterprise/hpe-oneview-sdk-for-terraform:v6.0.0-12-OV6.0 +$ docker pull hewlettpackardenterprise/hpe-oneview-sdk-for-terraform:v6.0.0-13-OV6.0 # Run docker commands below given, which will in turn create a sh session # where you can create files, issue commands and execute the examples. -$ docker run -it docker pull hewlettpackardenterprise/hpe-oneview-sdk-for-terraform:v6.0.0-12-OV6.0 /bin/sh +$ docker run -it docker pull hewlettpackardenterprise/hpe-oneview-sdk-for-terraform:v6.0.0-13-OV6.0 /bin/sh ``` ### Local Setup @@ -66,25 +66,23 @@ $ export PATH=$PATH:$GOROOT/bin:$GOPATH/bin - Installing Terraform - Install Terraform 0.12.x from [here](https://www.terraform.io/downloads.html) and save it into `/usr/local/bin/terraform` folder (create it if it doesn't exists). + Install Terraform 0.13.x from [here](https://www.terraform.io/downloads.html) and save it into `/usr/local/bin/terraform` folder (create it if it doesn't exists). -```bash -``` -- Install Oneview Terraform Provider SDK -```go -# Download the source code for terraform-provider-oneview -# Build the needed binary -# Get the branch 'Terraform-0.12' terraform-provider-oneview which is supports Terraform v0.12.x. -$ git clone -b Terraform-0.12 https://github.com/HewlettPackard/terraform-provider-oneview.git -$ cd terraform-provider-oneview -# Build the provider -$ go build -o terraform-provider-oneview -# Create the plugin location if it does not exist and copy the provider binary there. -$ mkdir -p ~/.terraform.d/plugins/ -$ mv terraform-provider-oneview ~/.terraform.d./plugins/ +- Install Oneview Terraform Provider SDK from Terraform Registry + Terraform 0.13 added support for automatically downloading providers from +the terraform registry. Add the following to your terraform project + +```hcl +terraform { + required_providers { + oneview = { + source = "HewlettPackard/oneview" + } + } +``` ## Configuration ### Environment Variables diff --git a/oneview/data_source_server_profile.go b/oneview/data_source_server_profile.go index e17cc78b..7f141f91 100644 --- a/oneview/data_source_server_profile.go +++ b/oneview/data_source_server_profile.go @@ -725,11 +725,11 @@ func dataSourceServerProfileRead(d *schema.ResourceData, meta interface{}) error for _, controller := range serverProfile.LocalStorage.Controllers { controllers = append(controllers, map[string]interface{}{ - "device_slot": controller.DeviceSlot, - "drive_write_cache": controller.DriveWriteCache, - "import_configuration": controller.ImportConfiguration, - "initialize": controller.Initialize, - "mode": controller.Mode, + "device_slot": controller.DeviceSlot, + "drive_write_cache": controller.DriveWriteCache, + "import_configuration": controller.ImportConfiguration, + "initialize": controller.Initialize, + "mode": controller.Mode, "predictive_spare_rebuild": controller.PredictiveSpareRebuild, }) logicaldrives := make([]map[string]interface{}, 0, len(controller.LogicalDrives)) diff --git a/oneview/data_source_server_profile_template.go b/oneview/data_source_server_profile_template.go index b788a328..b4a3753b 100644 --- a/oneview/data_source_server_profile_template.go +++ b/oneview/data_source_server_profile_template.go @@ -388,10 +388,10 @@ func dataSourceServerProfileTemplateRead(d *schema.ResourceData, meta interface{ }) } controllers = append(controllers, map[string]interface{}{ - "device_slot": spt.LocalStorage.Controllers[i].DeviceSlot, - "initialize": *spt.LocalStorage.Controllers[i].Initialize, - "drive_write_cache": spt.LocalStorage.Controllers[i].DriveWriteCache, - "mode": spt.LocalStorage.Controllers[i].Mode, + "device_slot": spt.LocalStorage.Controllers[i].DeviceSlot, + "initialize": *spt.LocalStorage.Controllers[i].Initialize, + "drive_write_cache": spt.LocalStorage.Controllers[i].DriveWriteCache, + "mode": spt.LocalStorage.Controllers[i].Mode, "predictive_spare_rebuild": spt.LocalStorage.Controllers[i].PredictiveSpareRebuild, "logical_drives": logicalDrives, }) diff --git a/oneview/resource_logical_interconnect_group.go b/oneview/resource_logical_interconnect_group.go index 4c49305d..ba7270eb 100644 --- a/oneview/resource_logical_interconnect_group.go +++ b/oneview/resource_logical_interconnect_group.go @@ -1714,7 +1714,7 @@ func resourceLogicalInterconnectGroupRead(d *schema.ResourceData, meta interface interconnectSettings := make([]map[string]interface{}, 0, 1) interconnectSetting := map[string]interface{}{ - "type": logicalInterconnectGroup.EthernetSettings.Type, + "type": logicalInterconnectGroup.EthernetSettings.Type, "fast_mac_cache_failover": *logicalInterconnectGroup.EthernetSettings.EnableFastMacCacheFailover, "network_loop_protection": *logicalInterconnectGroup.EthernetSettings.EnableNetworkLoopProtection, "pause_flood_protection": *logicalInterconnectGroup.EthernetSettings.EnablePauseFloodProtection, @@ -1729,16 +1729,16 @@ func resourceLogicalInterconnectGroupRead(d *schema.ResourceData, meta interface if logicalInterconnectGroup.IgmpSettings != nil { igmpSettings := make([]map[string]interface{}, 0, 1) igmpSetting := map[string]interface{}{ - "category": logicalInterconnectGroup.IgmpSettings.Category, - "consistency_checking": logicalInterconnectGroup.IgmpSettings.ConsistencyChecking, - "created": logicalInterconnectGroup.IgmpSettings.Created, - "dependent_resource_uri": logicalInterconnectGroup.IgmpSettings.DependentResourceUri, - "description": logicalInterconnectGroup.IgmpSettings.Description, - "etag": logicalInterconnectGroup.IgmpSettings.ETAG, - "igmp_snooping": *logicalInterconnectGroup.IgmpSettings.EnableIgmpSnooping, - "prevent_flooding": *logicalInterconnectGroup.IgmpSettings.EnablePreventFlooding, - "proxy_reporting": *logicalInterconnectGroup.IgmpSettings.EnableProxyReporting, - "id": logicalInterconnectGroup.IgmpSettings.ID, + "category": logicalInterconnectGroup.IgmpSettings.Category, + "consistency_checking": logicalInterconnectGroup.IgmpSettings.ConsistencyChecking, + "created": logicalInterconnectGroup.IgmpSettings.Created, + "dependent_resource_uri": logicalInterconnectGroup.IgmpSettings.DependentResourceUri, + "description": logicalInterconnectGroup.IgmpSettings.Description, + "etag": logicalInterconnectGroup.IgmpSettings.ETAG, + "igmp_snooping": *logicalInterconnectGroup.IgmpSettings.EnableIgmpSnooping, + "prevent_flooding": *logicalInterconnectGroup.IgmpSettings.EnablePreventFlooding, + "proxy_reporting": *logicalInterconnectGroup.IgmpSettings.EnableProxyReporting, + "id": logicalInterconnectGroup.IgmpSettings.ID, "igmp_idle_timeout_interval": logicalInterconnectGroup.IgmpSettings.IgmpIdleTimeoutInterval, "igmp_snooping_vlan_ids": logicalInterconnectGroup.IgmpSettings.IgmpSnoopingVlanIds, "modified": logicalInterconnectGroup.IgmpSettings.Modified, @@ -1821,7 +1821,7 @@ func resourceLogicalInterconnectGroupRead(d *schema.ResourceData, meta interface qualityOfService := make([]map[string]interface{}, 0, 1) qualityOfService = append(qualityOfService, map[string]interface{}{ - "type": logicalInterconnectGroup.QosConfiguration.Type, + "type": logicalInterconnectGroup.QosConfiguration.Type, "active_qos_config_type": logicalInterconnectGroup.QosConfiguration.ActiveQosConfig.Type, "config_type": logicalInterconnectGroup.QosConfiguration.ActiveQosConfig.ConfigType, "uplink_classification_type": logicalInterconnectGroup.QosConfiguration.ActiveQosConfig.UplinkClassificationType, diff --git a/versions.tf b/versions.tf index ac97c6ac..1048bd12 100644 --- a/versions.tf +++ b/versions.tf @@ -1,4 +1,9 @@ - terraform { - required_version = ">= 0.12" + required_version = ">= 0.13" + required_providers { + oneview = { + source = "HewlettPackard/oneview" + version = "6.0.0-13" #Check https://registry.terraform.io/v1/providers/hewlettpackard/oneview/versions + } + } }