From d7bbd3ef336ea76fe959a91424d2d42068ed25f1 Mon Sep 17 00:00:00 2001 From: pulumi-bot Date: Mon, 5 Jun 2023 19:26:21 +0000 Subject: [PATCH 1/2] make tfgen --- provider/go.mod | 11 ++++++----- provider/go.sum | 21 ++++++++++++--------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/provider/go.mod b/provider/go.mod index 5598e391..8c0fba60 100644 --- a/provider/go.mod +++ b/provider/go.mod @@ -4,9 +4,9 @@ go 1.19 require ( github.com/digitalocean/terraform-provider-digitalocean v0.0.0 - github.com/pulumi/pulumi-terraform-bridge/v3 v3.47.3 - github.com/pulumi/pulumi/pkg/v3 v3.68.0 - github.com/pulumi/pulumi/sdk/v3 v3.68.0 + github.com/pulumi/pulumi-terraform-bridge/v3 v3.49.0 + github.com/pulumi/pulumi/pkg/v3 v3.69.0 + github.com/pulumi/pulumi/sdk/v3 v3.69.0 ) replace ( @@ -42,6 +42,7 @@ require ( github.com/Azure/go-autorest/logger v0.2.1 // indirect github.com/Azure/go-autorest/tracing v0.6.0 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 // indirect + github.com/BurntSushi/toml v1.2.1 // indirect github.com/Masterminds/goutils v1.1.1 // indirect github.com/Masterminds/semver v1.5.0 // indirect github.com/Masterminds/semver/v3 v3.1.1 // indirect @@ -188,11 +189,11 @@ require ( github.com/pmezard/go-difflib v1.0.0 // indirect github.com/posener/complete v1.2.3 // indirect github.com/pulumi/pulumi-java/pkg v0.9.2 // indirect - github.com/pulumi/pulumi-terraform-bridge/x/muxer v0.0.3 // indirect + github.com/pulumi/pulumi-terraform-bridge/x/muxer v0.0.4 // indirect github.com/pulumi/pulumi-yaml v1.1.1 // indirect github.com/pulumi/schema-tools v0.1.2 // indirect github.com/pulumi/terraform-diff-reader v0.0.0-20201211191010-ad4715e9285e // indirect - github.com/rivo/uniseg v0.2.0 // indirect + github.com/rivo/uniseg v0.4.4 // indirect github.com/rogpeppe/go-internal v1.9.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/ryanuber/go-glob v1.0.0 // indirect diff --git a/provider/go.sum b/provider/go.sum index c913f7d9..e05bde0d 100644 --- a/provider/go.sum +++ b/provider/go.sum @@ -280,6 +280,8 @@ github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBp github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 h1:WVsrXCnHlDDX8ls+tootqRE87/hL9S/g4ewig9RsD/c= github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/toml v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak= +github.com/BurntSushi/toml v1.2.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/GoogleCloudPlatform/cloudsql-proxy v1.31.2/go.mod h1:qR6jVnZTKDCW3j+fC9mOEPHm++1nKDMkqbbkD6KNsfo= @@ -1669,16 +1671,16 @@ github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40T github.com/pulumi/pulumi-java/pkg v0.9.2 h1:fpBwf1NHf3j5YuigOWsXPvJCAFivEp1D6aOlYIrSbr0= github.com/pulumi/pulumi-java/pkg v0.9.2/go.mod h1:+5V4jggi3063hksi28zYvLm42UWVg3VqpR6qGZraIdM= github.com/pulumi/pulumi-terraform-bridge/testing v0.0.1 h1:SCg1gjfY9N4yn8U8peIUYATifjoDABkyR7H9lmefsfc= -github.com/pulumi/pulumi-terraform-bridge/v3 v3.47.3 h1:8xncSOiUZAgBFjcC3eUsjCmhYDUwppNNl7iOC8CAstY= -github.com/pulumi/pulumi-terraform-bridge/v3 v3.47.3/go.mod h1:bDKHLW8vhuhmOUVdcSK8aAIRU8fqx8ZqqREO13Rx/uc= -github.com/pulumi/pulumi-terraform-bridge/x/muxer v0.0.3 h1:1SmRVwRnrplcdBVVgoKYL8xqW8dCeiQPSwpGkx4ga6U= -github.com/pulumi/pulumi-terraform-bridge/x/muxer v0.0.3/go.mod h1:n0TS1WsPjOfto6hyDZbXfNZQuLli2X9iDWt2nzmQJsg= +github.com/pulumi/pulumi-terraform-bridge/v3 v3.49.0 h1:bjPwHGfMFdX/UjEX0VCjuQAD6eQvn1tI42atlixECC8= +github.com/pulumi/pulumi-terraform-bridge/v3 v3.49.0/go.mod h1:QdMHrg7J/OnXdm68lQROGLivbJlwMpHq75kdnigDSWw= +github.com/pulumi/pulumi-terraform-bridge/x/muxer v0.0.4 h1:rIzMmtcVpPX8ynaz6/nW5AHNY63DiNfCohqmxWvMpM4= +github.com/pulumi/pulumi-terraform-bridge/x/muxer v0.0.4/go.mod h1:Kt8RIZWa/N8rW3+0g6NrqCBmF3o+HuIhFaZpssEkG6w= github.com/pulumi/pulumi-yaml v1.1.1 h1:8pyBNIU8+ym0wYpjhsCqN+cutygfK1XbhY2YEeNfyXY= github.com/pulumi/pulumi-yaml v1.1.1/go.mod h1:GhpdS6rFpwqvUtKdA+fQy8P28iNvncng39IXh5q68vE= -github.com/pulumi/pulumi/pkg/v3 v3.68.0 h1:JeJAAJiVe6JliNRKI1ABYPfUJ3Fcy72qYoVZJSOjvNE= -github.com/pulumi/pulumi/pkg/v3 v3.68.0/go.mod h1:4uJVC8hkWk0PxTx/d64da9x3IUJxBGR6RXi8eUv7Rvk= -github.com/pulumi/pulumi/sdk/v3 v3.68.0 h1:JWn3DGJhzoWL8bNbUdyLSSPeKS2F9mv14/EL9QeVT3w= -github.com/pulumi/pulumi/sdk/v3 v3.68.0/go.mod h1:A/WHc5MlxU8GpX/sRmfQ9G0/Bxxl4GNdSP7TQmy4yIw= +github.com/pulumi/pulumi/pkg/v3 v3.69.0 h1:IP9WCBFYRXWzbEFNsSquBoHKF5ux32XImKpRdju8HjU= +github.com/pulumi/pulumi/pkg/v3 v3.69.0/go.mod h1:GbsJqE2bGotPY+mj07LKlpps9ZzAlV7qRQ/u77kw9yk= +github.com/pulumi/pulumi/sdk/v3 v3.69.0 h1:WENc7menQMT10I34kVg1ZatQTMlifovuZ9i8CcTrk7A= +github.com/pulumi/pulumi/sdk/v3 v3.69.0/go.mod h1:BUUBfQZsH0FPuznRfFHkR+b96VlXELnn+DgidFj4XSQ= github.com/pulumi/schema-tools v0.1.2 h1:Fd9xvUjgck4NA+7/jSk7InqCUT4Kj940+EcnbQKpfZo= github.com/pulumi/schema-tools v0.1.2/go.mod h1:62lgj52Tzq11eqWTIaKd+EVyYAu5dEcDJxMhTjvMO/k= github.com/pulumi/terraform-diff-reader v0.0.0-20201211191010-ad4715e9285e h1:Dik4Qe/+xguB8JagPyXNlbOnRiXGmq/PSPQTGunYnTk= @@ -1687,8 +1689,9 @@ github.com/pulumi/terraform-plugin-sdk/v2 v2.0.0-20230327102345-3fa930f86570 h1: github.com/pulumi/terraform-plugin-sdk/v2 v2.0.0-20230327102345-3fa930f86570/go.mod h1:xcOSYlRVdPLmDUoqPhO9fiO/YCN/l6MGYeTzGt5jgkQ= github.com/rakyll/embedmd v0.0.0-20171029212350-c8060a0752a2/go.mod h1:7jOTMgqac46PZcF54q6l2hkLEG8op93fZu61KmxWDV4= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= +github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= From b2a0ac0cdd51520ed53a48fb4262a79e91cea23e Mon Sep 17 00:00:00 2001 From: pulumi-bot Date: Mon, 5 Jun 2023 19:27:41 +0000 Subject: [PATCH 2/2] make build_sdks --- sdk/go/digitalocean/config/config.go | 12 ++++++++++-- sdk/go/digitalocean/config/pulumiUtilities.go | 2 +- sdk/go/digitalocean/provider.go | 8 ++++++-- sdk/go/digitalocean/pulumiUtilities.go | 2 +- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/sdk/go/digitalocean/config/config.go b/sdk/go/digitalocean/config/config.go index 1409b480..af1e7e3d 100644 --- a/sdk/go/digitalocean/config/config.go +++ b/sdk/go/digitalocean/config/config.go @@ -14,7 +14,11 @@ func GetApiEndpoint(ctx *pulumi.Context) string { if err == nil { return v } - return getEnvOrDefault("https://api.digitalocean.com", nil, "DIGITALOCEAN_API_URL").(string) + var value string + if d := getEnvOrDefault("https://api.digitalocean.com", nil, "DIGITALOCEAN_API_URL"); d != nil { + value = d.(string) + } + return value } // The maximum number of retries on a failed API request. @@ -48,7 +52,11 @@ func GetSpacesEndpoint(ctx *pulumi.Context) string { if err == nil { return v } - return getEnvOrDefault("", nil, "SPACES_ENDPOINT_URL").(string) + var value string + if d := getEnvOrDefault(nil, nil, "SPACES_ENDPOINT_URL"); d != nil { + value = d.(string) + } + return value } // The secret access key for Spaces API operations. diff --git a/sdk/go/digitalocean/config/pulumiUtilities.go b/sdk/go/digitalocean/config/pulumiUtilities.go index d6acb195..62130067 100644 --- a/sdk/go/digitalocean/config/pulumiUtilities.go +++ b/sdk/go/digitalocean/config/pulumiUtilities.go @@ -51,7 +51,7 @@ func parseEnvStringArray(v string) interface{} { func getEnvOrDefault(def interface{}, parser envParser, vars ...string) interface{} { for _, v := range vars { - if value := os.Getenv(v); value != "" { + if value, ok := os.LookupEnv(v); ok { if parser != nil { return parser(value) } diff --git a/sdk/go/digitalocean/provider.go b/sdk/go/digitalocean/provider.go index 59636611..43542cd4 100644 --- a/sdk/go/digitalocean/provider.go +++ b/sdk/go/digitalocean/provider.go @@ -37,10 +37,14 @@ func NewProvider(ctx *pulumi.Context, } if args.ApiEndpoint == nil { - args.ApiEndpoint = pulumi.StringPtr(getEnvOrDefault("https://api.digitalocean.com", nil, "DIGITALOCEAN_API_URL").(string)) + if d := getEnvOrDefault("https://api.digitalocean.com", nil, "DIGITALOCEAN_API_URL"); d != nil { + args.ApiEndpoint = pulumi.StringPtr(d.(string)) + } } if args.SpacesEndpoint == nil { - args.SpacesEndpoint = pulumi.StringPtr(getEnvOrDefault("", nil, "SPACES_ENDPOINT_URL").(string)) + if d := getEnvOrDefault(nil, nil, "SPACES_ENDPOINT_URL"); d != nil { + args.SpacesEndpoint = pulumi.StringPtr(d.(string)) + } } var resource Provider err := ctx.RegisterResource("pulumi:providers:digitalocean", name, args, &resource, opts...) diff --git a/sdk/go/digitalocean/pulumiUtilities.go b/sdk/go/digitalocean/pulumiUtilities.go index 13b4056e..f65712e5 100644 --- a/sdk/go/digitalocean/pulumiUtilities.go +++ b/sdk/go/digitalocean/pulumiUtilities.go @@ -51,7 +51,7 @@ func parseEnvStringArray(v string) interface{} { func getEnvOrDefault(def interface{}, parser envParser, vars ...string) interface{} { for _, v := range vars { - if value := os.Getenv(v); value != "" { + if value, ok := os.LookupEnv(v); ok { if parser != nil { return parser(value) }