From 2cbb02d4b07dd6932e72c0eb397e773eaeec94f1 Mon Sep 17 00:00:00 2001 From: kt Date: Thu, 25 Apr 2019 23:41:48 -0700 Subject: [PATCH] update go-azure-helpers to 0.4.1 (fixes gov provider registration) --- go.mod | 2 +- go.sum | 4 ++-- .../resourceproviders/registration.go | 14 ++++++++------ vendor/modules.txt | 2 +- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index 4e8563f94911..922bc945ea56 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/davecgh/go-spew v1.1.1 github.com/dnaeon/go-vcr v1.0.1 // indirect github.com/google/uuid v0.0.0-20170814143639-7e072fc3a7be - github.com/hashicorp/go-azure-helpers v0.4.0 + github.com/hashicorp/go-azure-helpers v0.4.1 github.com/hashicorp/go-getter v1.1.0 github.com/hashicorp/go-multierror v1.0.0 github.com/hashicorp/go-uuid v1.0.1 diff --git a/go.sum b/go.sum index 89bc204e0323..2a475154b7d4 100644 --- a/go.sum +++ b/go.sum @@ -148,8 +148,8 @@ github.com/hashicorp/errwrap v0.0.0-20180715044906-d6c0cd880357/go.mod h1:YH+1FK github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-azure-helpers v0.0.0-20190129193224-166dfd221bb2/go.mod h1:lu62V//auUow6k0IykxLK2DCNW8qTmpm8KqhYVWattA= -github.com/hashicorp/go-azure-helpers v0.4.0 h1:iAJWTrKSD002iu5g33TgKeHK1NNqmafQftPC+yx+Hgk= -github.com/hashicorp/go-azure-helpers v0.4.0/go.mod h1:lu62V//auUow6k0IykxLK2DCNW8qTmpm8KqhYVWattA= +github.com/hashicorp/go-azure-helpers v0.4.1 h1:aEWYW4hxAVVmxmq7nPXGK8F44A6HBXQ4m0vB1M3/20g= +github.com/hashicorp/go-azure-helpers v0.4.1/go.mod h1:lu62V//auUow6k0IykxLK2DCNW8qTmpm8KqhYVWattA= 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 h1:wvCrVc9TjDls6+YGAF2hAifE1E5U1+b4tH6KdvN3Gig= diff --git a/vendor/github.com/hashicorp/go-azure-helpers/resourceproviders/registration.go b/vendor/github.com/hashicorp/go-azure-helpers/resourceproviders/registration.go index 04f13c07c5b4..f77700e31c9f 100644 --- a/vendor/github.com/hashicorp/go-azure-helpers/resourceproviders/registration.go +++ b/vendor/github.com/hashicorp/go-azure-helpers/resourceproviders/registration.go @@ -12,17 +12,19 @@ import ( // DetermineResourceProvidersRequiringRegistration determines which Resource Providers require registration to be able to be used func DetermineResourceProvidersRequiringRegistration(availableResourceProviders []resources.Provider, requiredResourceProviders map[string]struct{}) map[string]struct{} { - providers := requiredResourceProviders + providers := make(map[string]struct{}) - // filter out any providers already registered + // filter out any providers already registered and not in the required list. for _, p := range availableResourceProviders { - if _, ok := providers[*p.Namespace]; !ok { + // Skip it if it's not in the required list. + if _, ok := requiredResourceProviders[*p.Namespace]; !ok { continue } - if strings.ToLower(*p.RegistrationState) == "registered" { - log.Printf("[DEBUG] Skipping provider registration for namespace %s\n", *p.Namespace) - delete(providers, *p.Namespace) + // If it's in the required list but not registered. + if strings.ToLower(*p.RegistrationState) != "registered" { + log.Printf("[DEBUG] Adding provider registration for namespace %s\n", *p.Namespace) + providers[*p.Namespace] = requiredResourceProviders[*p.Namespace] } } diff --git a/vendor/modules.txt b/vendor/modules.txt index a6c18cab2148..2bb100959a07 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -154,7 +154,7 @@ github.com/google/go-cmp/cmp/internal/value github.com/google/uuid # github.com/hashicorp/errwrap v1.0.0 github.com/hashicorp/errwrap -# github.com/hashicorp/go-azure-helpers v0.4.0 +# github.com/hashicorp/go-azure-helpers v0.4.1 github.com/hashicorp/go-azure-helpers/authentication github.com/hashicorp/go-azure-helpers/resourceproviders github.com/hashicorp/go-azure-helpers/storage