From 19162b0721ac32d3cd8918880e501be6c619b240 Mon Sep 17 00:00:00 2001 From: tombuildsstuff Date: Fri, 18 Mar 2022 16:18:36 +0100 Subject: [PATCH] dependencies: upgrdint to `v0.26.0` of `github.com/hashicorp/go-azure-helpers` --- go.mod | 2 +- go.sum | 4 +- .../resourcemanager/commonschema/edge_zone.go | 38 +++++++++++++++++++ .../resourcemanager/edgezones/normalize.go | 21 ++++++++++ .../resourcemanager/edgezones/schema.go | 12 ++++++ vendor/modules.txt | 3 +- 6 files changed, 76 insertions(+), 4 deletions(-) create mode 100644 vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema/edge_zone.go create mode 100644 vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones/normalize.go create mode 100644 vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones/schema.go diff --git a/go.mod b/go.mod index f5521fdccc8d..f38d01eac2d8 100644 --- a/go.mod +++ b/go.mod @@ -19,7 +19,7 @@ require ( github.com/google/go-cmp v0.5.6 github.com/google/uuid v1.1.2 github.com/hashicorp/errwrap v1.1.0 // indirect - github.com/hashicorp/go-azure-helpers v0.25.0 + github.com/hashicorp/go-azure-helpers v0.26.0 github.com/hashicorp/go-getter v1.5.4 github.com/hashicorp/go-multierror v1.1.1 github.com/hashicorp/go-plugin v1.4.2 // indirect diff --git a/go.sum b/go.sum index 03fbcbe485f1..8381cd73f731 100644 --- a/go.sum +++ b/go.sum @@ -252,8 +252,8 @@ github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brv github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-azure-helpers v0.12.0/go.mod h1:Zc3v4DNeX6PDdy7NljlYpnrdac1++qNW0I4U+ofGwpg= -github.com/hashicorp/go-azure-helpers v0.25.0 h1:rW75P2Ra7pnJJeKFy4Mjq8qfBsI3Uft6TFKP5oGwt94= -github.com/hashicorp/go-azure-helpers v0.25.0/go.mod h1:Z2IvHhrwmpdDU5Mdld+vETChcenndWcY1bws4Hsn+Wk= +github.com/hashicorp/go-azure-helpers v0.26.0 h1:uaxqRBGqxe4/60GMEcsHFt2rFp20+aeTAONubWT67aM= +github.com/hashicorp/go-azure-helpers v0.26.0/go.mod h1:Z2IvHhrwmpdDU5Mdld+vETChcenndWcY1bws4Hsn+Wk= github.com/hashicorp/go-checkpoint v0.5.0 h1:MFYpPZCnQqQTE18jFwSII6eUQrD/oxMFp3mlgcqk5mU= github.com/hashicorp/go-checkpoint v0.5.0/go.mod h1:7nfLNL10NsxqO4iWuW6tWW0HjZuDrwkBuEQsVcpCOgg= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= diff --git a/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema/edge_zone.go b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema/edge_zone.go new file mode 100644 index 000000000000..fecff8549dc9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema/edge_zone.go @@ -0,0 +1,38 @@ +package commonschema + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" +) + +// EdgeZoneComputed returns the schema for an Edge Zone which is Computed +func EdgeZoneComputed() *schema.Schema { + return &schema.Schema{ + Type: schema.TypeString, + Computed: true, + } +} + +// EdgeZoneOptional returns the schema for an Edge Zone which is Optional +func EdgeZoneOptional() *schema.Schema { + return &schema.Schema{ + Type: schema.TypeString, + Optional: true, + ValidateFunc: validation.StringIsNotEmpty, + StateFunc: edgezones.StateFunc, + DiffSuppressFunc: edgezones.DiffSuppressFunc, + } +} + +// EdgeZoneOptionalForceNew returns the schema for an Edge Zone which is both Optional and ForceNew +func EdgeZoneOptionalForceNew() *schema.Schema { + return &schema.Schema{ + Type: schema.TypeString, + Optional: true, + ForceNew: true, + ValidateFunc: validation.StringIsNotEmpty, + StateFunc: edgezones.StateFunc, + DiffSuppressFunc: edgezones.DiffSuppressFunc, + } +} diff --git a/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones/normalize.go b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones/normalize.go new file mode 100644 index 000000000000..531f992a890b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones/normalize.go @@ -0,0 +1,21 @@ +package edgezones + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/location" +) + +// Normalize transforms the specified user input into a canonical form +func Normalize(input string) string { + // we're intentionally passing through to Locations today since this is sufficient + // but it's helpful to have a specific endpoint for this should this need to change + // in the future + return location.Normalize(input) +} + +// NormalizeNilable normalizes the specified user input into a canonical form +func NormalizeNilable(input *string) string { + // we're intentionally passing through to Locations today since this is sufficient + // but it's helpful to have a specific endpoint for this should this need to change + // in the future + return location.NormalizeNilable(input) +} diff --git a/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones/schema.go b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones/schema.go new file mode 100644 index 000000000000..3883074d0e14 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones/schema.go @@ -0,0 +1,12 @@ +package edgezones + +import "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + +func DiffSuppressFunc(_, old, new string, _ *schema.ResourceData) bool { + return Normalize(old) == Normalize(new) +} + +func StateFunc(location interface{}) string { + input := location.(string) + return Normalize(input) +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 8586bacbcc73..c970871fb832 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -186,7 +186,7 @@ github.com/google/uuid # github.com/hashicorp/errwrap v1.1.0 ## explicit github.com/hashicorp/errwrap -# github.com/hashicorp/go-azure-helpers v0.25.0 +# github.com/hashicorp/go-azure-helpers v0.26.0 ## explicit github.com/hashicorp/go-azure-helpers/authentication github.com/hashicorp/go-azure-helpers/lang/dates @@ -195,6 +195,7 @@ github.com/hashicorp/go-azure-helpers/lang/response github.com/hashicorp/go-azure-helpers/polling github.com/hashicorp/go-azure-helpers/resourcemanager/commonids github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema +github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones github.com/hashicorp/go-azure-helpers/resourcemanager/identity github.com/hashicorp/go-azure-helpers/resourcemanager/location github.com/hashicorp/go-azure-helpers/resourcemanager/resourcegroups