From 5f08e41aca8bdc7ae04d67e028bc8f2348c7d52c Mon Sep 17 00:00:00 2001 From: Dax Raad Date: Fri, 11 Oct 2024 17:18:17 -0400 Subject: [PATCH] pulumi: update to 3.136.1 --- go.mod | 7 +++---- go.sum | 14 ++++++-------- pkg/global/global.go | 19 ++++++++++++++++++- pkg/project/install.go | 3 ++- 4 files changed, 29 insertions(+), 14 deletions(-) diff --git a/go.mod b/go.mod index 484086302..d24081f09 100644 --- a/go.mod +++ b/go.mod @@ -35,12 +35,12 @@ require ( github.com/manifoldco/promptui v0.9.0 github.com/nrednav/cuid2 v1.0.0 github.com/posthog/posthog-go v0.0.0-20240221135834-4944045455b4 - github.com/pulumi/pulumi/sdk/v3 v3.115.2 + github.com/pulumi/pulumi/sdk/v3 v3.136.1 github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.9.0 github.com/twitchtv/twirp v8.1.3+incompatible github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0 - golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8 + golang.org/x/exp v0.0.0-20240604190554-fc45aab8b7f8 google.golang.org/protobuf v1.33.0 ) @@ -131,7 +131,7 @@ require ( github.com/pkg/errors v0.9.1 // indirect github.com/pkg/term v1.1.0 // indirect github.com/pulumi/appdash v0.0.0-20231130102222-75f619a67231 // indirect - github.com/pulumi/esc v0.8.3 // indirect + github.com/pulumi/esc v0.9.1 // indirect github.com/rivo/uniseg v0.4.7 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 // indirect @@ -141,7 +141,6 @@ require ( github.com/spf13/cobra v1.8.0 // indirect github.com/tailscale/hujson v0.0.0-20221223112325-20486734a56a github.com/texttheater/golang-levenshtein v1.0.1 // indirect - github.com/tweekmonster/luser v0.0.0-20161003172636-3fa38070dbd7 // indirect github.com/uber/jaeger-client-go v2.30.0+incompatible // indirect github.com/uber/jaeger-lib v2.4.1+incompatible // indirect github.com/xanzy/ssh-agent v0.3.3 // indirect diff --git a/go.sum b/go.sum index 29b57a9d9..347f05b7b 100644 --- a/go.sum +++ b/go.sum @@ -279,10 +279,10 @@ github.com/posthog/posthog-go v0.0.0-20240221135834-4944045455b4 h1:p+8kZn9P90aX github.com/posthog/posthog-go v0.0.0-20240221135834-4944045455b4/go.mod h1:QjlpryJtfYLrZF2GUkAhejH4E7WlDbdKkvOi5hLmkdg= github.com/pulumi/appdash v0.0.0-20231130102222-75f619a67231 h1:vkHw5I/plNdTr435cARxCW6q9gc0S/Yxz7Mkd38pOb0= github.com/pulumi/appdash v0.0.0-20231130102222-75f619a67231/go.mod h1:murToZ2N9hNJzewjHBgfFdXhZKjY3z5cYC1VXk+lbFE= -github.com/pulumi/esc v0.8.3 h1:myeDL6dD/mz34zZjCL8s7d/tWHBJYxfMxDCL11MHoqc= -github.com/pulumi/esc v0.8.3/go.mod h1:v5VAPxYDa9DRwvubbzKt4ZYf5y0esWC2ccSp/AT923I= -github.com/pulumi/pulumi/sdk/v3 v3.115.2 h1:CFx/KfS3fsp2EiXnX70JNUBvHADNqiQ617AVslu5I6E= -github.com/pulumi/pulumi/sdk/v3 v3.115.2/go.mod h1:d6LZJHqEfpgXUd8rFSSsbaPJcocZObXeaUr87jbA5MY= +github.com/pulumi/esc v0.9.1 h1:HH5eEv8sgyxSpY5a8yePyqFXzA8cvBvapfH8457+mIs= +github.com/pulumi/esc v0.9.1/go.mod h1:oEJ6bOsjYlQUpjf70GiX+CXn3VBmpwFDxUTlmtUN84c= +github.com/pulumi/pulumi/sdk/v3 v3.136.1 h1:VJWTgdBrLvvzIkMbGq/epNEfT65P9gTvw14UF/I7hTI= +github.com/pulumi/pulumi/sdk/v3 v3.136.1/go.mod h1:PvKsX88co8XuwuPdzolMvew5lZV+4JmZfkeSjj7A6dI= github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.3/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= @@ -320,8 +320,6 @@ github.com/tailscale/hujson v0.0.0-20221223112325-20486734a56a h1:SJy1Pu0eH1C29X github.com/tailscale/hujson v0.0.0-20221223112325-20486734a56a/go.mod h1:DFSS3NAGHthKo1gTlmEcSBiZrRJXi28rLNd/1udP1c8= github.com/texttheater/golang-levenshtein v1.0.1 h1:+cRNoVrfiwufQPhoMzB6N0Yf/Mqajr6t1lOv8GyGE2U= github.com/texttheater/golang-levenshtein v1.0.1/go.mod h1:PYAKrbF5sAiq9wd+H82hs7gNaen0CplQ9uvm6+enD/8= -github.com/tweekmonster/luser v0.0.0-20161003172636-3fa38070dbd7 h1:X9dsIWPuuEJlPX//UmRKophhOKCGXc46RVIGuttks68= -github.com/tweekmonster/luser v0.0.0-20161003172636-3fa38070dbd7/go.mod h1:UxoP3EypF8JfGEjAII8jx1q8rQyDnX8qdTCs/UQBVIE= github.com/twitchtv/twirp v8.1.3+incompatible h1:+F4TdErPgSUbMZMwp13Q/KgDVuI7HJXP61mNV3/7iuU= github.com/twitchtv/twirp v8.1.3+incompatible/go.mod h1:RRJoFSAmTEh2weEqWtpPE3vFK5YBhA6bqp2l1kfCC5A= github.com/uber/jaeger-client-go v2.30.0+incompatible h1:D6wyKGCecFaSRUpo8lCVbaOOb6ThwMmTEbhRwtKR97o= @@ -350,8 +348,8 @@ golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2Uz golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= -golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8 h1:aAcj0Da7eBAtrTp03QXWvm88pSyOt+UgdZw2BFZ+lEw= -golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8/go.mod h1:CQ1k9gNrJ50XIzaKCRR2hssIjF07kZFEiieALBM/ARQ= +golang.org/x/exp v0.0.0-20240604190554-fc45aab8b7f8 h1:LoYXNGAShUG3m/ehNk4iFctuhGX/+R1ZpfJ4/ia80JM= +golang.org/x/exp v0.0.0-20240604190554-fc45aab8b7f8/go.mod h1:jj3sYF3dwk5D+ghuXyeI3r5MFf+NT2An6/9dOA95KSI= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= diff --git a/pkg/global/global.go b/pkg/global/global.go index f615b9e5b..5b909b39a 100644 --- a/pkg/global/global.go +++ b/pkg/global/global.go @@ -97,6 +97,11 @@ func InstallPulumi() error { return fmt.Errorf("failed to download pulumi: HTTP status %d", resp.StatusCode) } + tmp := filepath.Join(BinPath(), ".tmp") + err = os.MkdirAll(tmp, 0755) + if err != nil { + return err + } switch fileExtension { case ".tar.gz": gzr, err := gzip.NewReader(resp.Body) @@ -104,7 +109,7 @@ func InstallPulumi() error { return err } defer gzr.Close() - err = untar(gzr, BinPath()) + err = untar(gzr, tmp) if err != nil { return err } @@ -113,6 +118,18 @@ func InstallPulumi() error { panic("cannot extract zip file for pulumi") } + entries, err := os.ReadDir(tmp) + if err != nil { + return err + } + for _, file := range entries { + err = os.Rename(filepath.Join(tmp, file.Name()), filepath.Join(BinPath(), file.Name())) + if err != nil { + return err + } + } + os.RemoveAll(tmp) + return nil } diff --git a/pkg/project/install.go b/pkg/project/install.go index 4fae9f1d9..6f2ba06fc 100644 --- a/pkg/project/install.go +++ b/pkg/project/install.go @@ -235,8 +235,9 @@ func FindProvider(name string, version string) (*ProviderLockEntry, error) { continue } alias := pkg.Pulumi.Name - if alias == "" { + if alias == "" || alias == "terraform-provider" { alias = pkg.Name + alias = strings.ReplaceAll(alias, "@sst-provider", "") alias = strings.ReplaceAll(alias, "/", "") alias = strings.ReplaceAll(alias, "@", "") alias = strings.ReplaceAll(alias, "pulumi", "")