Skip to content
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

Pulumi errors on locally built tool plugin kind #16248

Closed
ringods opened this issue May 22, 2024 · 0 comments · Fixed by #16249
Closed

Pulumi errors on locally built tool plugin kind #16248

ringods opened this issue May 22, 2024 · 0 comments · Fixed by #16249
Assignees
Labels
area/plugins Plugin acquisition and resolution kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed

Comments

@ringods
Copy link
Member

ringods commented May 22, 2024

What happened?

In the process of building a plugin of kind tool. After building a local version and putting it on my PATH, Pulumi CLI errors:

❯ which pulumi-tool-d2
/Users/ringods/Projects/personal/pulumi-tool-d2/pulumi-tool-d2

❯ pulumi plugin run d2
warning: using pulumi-tool-d2 from $PATH at /Users/ringods/Projects/personal/pulumi-tool-d2/pulumi-tool-d2
error: could not get plugin path: %!w(<nil>)

Example

Faulty line:

if !errors.As(err, &me) {

Even if err is nil, we end up in the if block and return the wrapped error. Example:

https://go.dev/play/p/4TlK5o3Ch6A

Output of pulumi about

Pulumi CLI v3.116.1

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).

@ringods ringods added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels May 22, 2024
@Frassle Frassle self-assigned this May 22, 2024
@Frassle Frassle added area/plugins Plugin acquisition and resolution and removed needs-triage Needs attention from the triage team labels May 22, 2024
Frassle added a commit that referenced this issue May 22, 2024
Fixes two bugs with plugin run:
1. That it err'd even if it found the path
2. That it didn't correctly find the path if it auto-installed

Fixes #16248
github-merge-queue bot pushed a commit that referenced this issue May 22, 2024
<!--- 
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. -->

Fixes two bugs with plugin run:
1. That it err'd even if it found the path
2. That it didn't correctly find the path if it auto-installed

Fixes #16248

## Checklist

- [x] I have run `make tidy` to update any new dependencies
- [x] I have run `make lint` to verify my code passes the lint check
  - [x] I have formatted my code using `gofumpt`

<!--- 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.
-->
- [ ] 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 Cloud,
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
Cloud API version
<!-- @pulumi employees: If yes, you must submit corresponding changes in
the service repo. -->
@pulumi-bot pulumi-bot added the resolution/fixed This issue was fixed label May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/plugins Plugin acquisition and resolution kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants