-
Notifications
You must be signed in to change notification settings - Fork 116
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
Panic on non-string kubeconfig
#1032
Labels
impact/panic
This bug represents a panic or unexpected crash
kind/bug
Some behavior is incorrect or out of spec
resolution/duplicate
This issue is a duplicate of another issue
Comments
This occurs when the kubeconfig used in the k8s provider is not stringified, and instead is passed as an object of The workaround is to use a string
Related: pulumi/pulumi-eks#359 |
We should do one or both of:
|
This was referenced Apr 16, 2020
This comment was marked as resolved.
This comment was marked as resolved.
EronWright
added a commit
that referenced
this issue
Jan 27, 2024
…2771) <!--Thanks for your contribution. See [CONTRIBUTING](CONTRIBUTING.md) for Pulumi's contribution guidelines. Help us merge your changes more quickly by adding more details such as labels, milestones, and reviewers.--> ### Proposed changes <!--Give us a brief description of what you've done and what it solves. --> This PR refactors the kubeconfig loading code to be more consistent between `DiffConfig` and `Configure`. Previously the `DiffConfig` method did not support file-based kubeconfigs, and would throw a spurious parser error. `DiffConfig` loads the kubeconfig to be able to detect cluster replacement, by comparing the active cluster info. Unlike `Configure`, it doesn't have support for ambient kubeconfigs. When an ambient config is in use, or the config is invalid (e.g. the `context` or `cluster` properties refer to a non-existent entry), then the replacement logic is skipped. This PR also fixes a panic in `DiffConfig` that would occur if `cluster` or `context` is a computed value; the provider will conservatively suggest replacement as it does when `kubeconfig` is a computed value. ### Testing New test cases were added for cluster change detection. New tests were added for the parsing code that was consolidated into `utils.go`. The tests now cover file-, string-, and object-based resource property values for `kubeconfig`. ### Related issues (optional) <!--Refer to related PRs or issues: #1234, or 'Fixes #1234' or 'Closes #1234'. Or link to full URLs to issues or pull requests in other GitHub repositories. --> Closes: #2663 Related: #1032
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
impact/panic
This bug represents a panic or unexpected crash
kind/bug
Some behavior is incorrect or out of spec
resolution/duplicate
This issue is a duplicate of another issue
A user reported the panic below. This appears to be due to the
kubeconfig
property being set to something other than a string, and a call to.StringValue()
panicing.In general, there are a lot of calls to
.StringValue()
and similar in this package that are not guarded with.IsString()
checks and are thus likely to panic instead of cleanly error on malformed inputs. We likely should audit (and test) these more holistically.The text was updated successfully, but these errors were encountered: