New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to destroy (panic) stack when using ArchivePaths
in Go
#143
Comments
Some debugging notes: when // So long as the target element is a pointer, we have a pointer to pointer; dig through until we bottom out
// on the non-pointer type that matches the source. This assumes the source isn't itself a pointer!
contract.Assertf(vsrc.Type().Kind() != reflect.Ptr, "source is a pointer") |
Bit backwards there. That assert is checking that the value being decoded into the command struct is not a pointer. Which suggests that UnmarshalProperties is sometimes returning a pointer for a string array. Oddly the decode sequence for Create looks exactly the same (it uses I'll see if I can repro this with engine diagnostics and see what's being sent over the wire. |
Ah it's the archive result itself: |
Its worth noting that the same problem happens on update as well. It is masked if no changes are made to the resource inputs, but the problem is still there. We can test this by running |
11053: Allow decoding *asset and *archive values r=iwahbe a=iwahbe <!--- Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation. --> # Description <!--- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. --> We handle ptr sources in deserialization. This is necessary since `pulumi.New*Asset` and `pulumi.New*Archive` return `*resource.Asset` and `*resource.Archive` respectively. This will fix pulumi/pulumi-command#143 when it is picked up. ## Checklist <!--- Please provide details if the checkbox below is to be left unchecked. --> - [X] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [X] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Service, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Service API version <!-- `@Pulumi` employees: If yes, you must submit corresponding changes in the service repo. --> Co-authored-by: Ian Wahbe <ian@wahbe.com>
11053: Allow decoding *asset and *archive values r=iwahbe a=iwahbe <!--- Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation. --> # Description <!--- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. --> We handle ptr sources in deserialization. This is necessary since `pulumi.New*Asset` and `pulumi.New*Archive` return `*resource.Asset` and `*resource.Archive` respectively. This will fix pulumi/pulumi-command#143 when it is picked up. ## Checklist <!--- Please provide details if the checkbox below is to be left unchecked. --> - [X] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [X] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Service, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Service API version <!-- `@Pulumi` employees: If yes, you must submit corresponding changes in the service repo. --> Co-authored-by: Ian Wahbe <ian@wahbe.com>
@iwahbe this should be closed by pulumi/pulumi#11053? |
Oh, hm, as it statically links to Pu/pu we likely want to update go.mod and cut a release. |
What happened?
As reported internally here, the customer is unable to delete their stack when a pulumi-command uses
ArchivePaths: pulumi.StringArray{pulumi.String("*.go")}
.The code provided below, generates this panic.
Steps to reproduce
main.go
pulumi up --yes
(it works)pulumi destroy --yes
(a panic is raised)Expected Behavior
The stack is deleted as expected.
Actual Behavior
A panic is raised and the stack destruction is interrupted.
Output of
pulumi about
Additional context
main.go
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).
The text was updated successfully, but these errors were encountered: