pulumi / pulumi-std

Standard library functions implemented as a native Pulumi provider to be consumed from all Pulumi supported languages
Apache License 2.0
2 stars 2 forks source link

pulumi convert to golang output fails with unknown revision #32

Closed tinfoilcat closed 1 year ago

tinfoilcat commented 1 year ago

What happened?

I was attempting to convert some terraform code to go with pulumi convert and it crashed on the pulumi-std dependency.

andy@andy-workstation1:~/code/repos/infrastructure-bugcrowd/terraform/redis$ go version
go version go1.20.5 linux/amd64
andy@andy-workstation1:~/code/repos/infrastructure-bugcrowd/terraform/redis$ go env GOPROXY
https://proxy.golang.org,direct
andy@andy-workstation1:~/code/repos/infrastructure-bugcrowd/terraform/redis$ go clean -modcache
andy@andy-workstation1:~/code/repos/infrastructure-bugcrowd/terraform/redis$ pulumi convert --from terraform --language go
Converting from terraform...
Converting to go...
Installing dependencies...

go: downloading github.com/pulumi/pulumi-azure/sdk/v5 v5.44.1
go: downloading github.com/pulumi/pulumi-random/sdk/v4 v4.13.2
go: downloading github.com/pulumi/pulumi-std/sdk/go/std v1.4.0
go: downloading github.com/pulumi/pulumi/sdk/v3 v3.30.0
go: github.com/pulumi/pulumi-std/sdk/go/std@v1.4.0: reading github.com/pulumi/pulumi-std/sdk/go/std/go.mod at revision sdk/go/std/v1.4.0: unknown revision sdk/go/std/v1.4.0
error: installing dependencies failed; rerun manually to try again, then run `pulumi up` to perform an initial deployment: `go mod tidy` failed to install dependencies: exit status 1

andy@andy-workstation1:~/code/repos/infrastructure-bugcrowd/terraform/redis$ cat go.mod
module redis

go 1.17

require (
    github.com/pulumi/pulumi/sdk/v3 v3.30.0
    github.com/pulumi/pulumi-azure/sdk/v5 v5.44.1
    github.com/pulumi/pulumi-random/sdk/v4 v4.13.2
    github.com/pulumi/pulumi-std/sdk/go/std v1.4.0
)andy@andy-workstation1:~/code/repos/infrastructure-bugcrowd/terraform/redis$ 

^ I verified GOPROXY address is correct, and emptied out the modcache .. I also verified that the v1.4.0 tag exists in pulumi-std.

Expected Behavior

I expected terraform to get converted to go.

Steps to reproduce

try pulumi convert --from terraform --language go in a terraform module, and see if crashes on the v1.4.0 tag?

Output of pulumi about

andy@andy-workstation1:~/code/repos/infrastructure-bugcrowd/terraform/redis$ pulumi about
go: github.com/pulumi/pulumi-std/sdk/go/std@v1.4.0: invalid version: unknown revision sdk/go/std/v1.4.0

CLI          
Version      3.73.0
Go Version   go1.20.5
Go Compiler  gc

Plugins
NAME  VERSION
go    unknown

Host     
OS       ubuntu
Version  22.10
Arch     x86_64

This project is written in go: executable='/usr/local/go/bin/go' version='go version go1.20.5 linux/amd64'

Dependencies:
NAME                                     VERSION
github.com/pulumi/pulumi/sdk/v3          3.30.0
github.com/pulumi/pulumi-azure/sdk/v5    5.44.1
github.com/pulumi/pulumi-random/sdk/v4   4.13.2
github.com/pulumi/pulumi-std/sdk/go/std  1.4.0

Pulumi locates its logs in /tmp by default

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

tinfoilcat commented 1 year ago

for good measure, I tried it from another server (running a different version of go)

Installed pulumi:

user@someserver:~$ curl -fsSL https://get.pulumi.com | sh
=== Installing Pulumi v3.73.0 ===
+ Downloading https://get.pulumi.com/releases/sdk/pulumi-v3.73.0-linux-x64.tar.gz...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  136M  100  136M    0     0   172M      0 --:--:-- --:--:-- --:--:--  171M
+ Extracting to /home/user/.pulumi/bin
+ Adding $HOME/.pulumi/bin to $PATH in /home/user/.bashrc

=== Pulumi is now installed! 🍹 ===

then

user@someserver:~/infrastructure-bugcrowd/terraform/redis$ go version
go version go1.19.4 linux/amd64
user@someserver:~/infrastructure-bugcrowd/terraform/redis$ pulumi convert --from terraform --language go
Converting from terraform...
Downloading provider: terraform
Downloading provider: azure
Downloading provider: local
Downloading provider: random
Converting to go...
Installing dependencies...

go: downloading github.com/pulumi/pulumi-azure/sdk/v5 v5.44.1
go: downloading github.com/pulumi/pulumi-random/sdk/v4 v4.13.2
go: downloading github.com/pulumi/pulumi-std/sdk/go/std v1.4.0
go: downloading github.com/pulumi/pulumi/sdk/v3 v3.30.0
go: github.com/pulumi/pulumi-std/sdk/go/std@v1.4.0: reading github.com/pulumi/pulumi-std/sdk/go/std/go.mod at revision sdk/go/std/v1.4.0: unknown revision sdk/go/std/v1.4.0
error: installing dependencies failed; rerun manually to try again, then run `pulumi up` to perform an initial deployment: `go mod tidy` failed to install dependencies: exit status 1
tinfoilcat commented 1 year ago

moving this issue to github.com/pulumi repo instead.