-
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
Fix panic resulting from passing kubeconfig as object during provider creation #1373
Conversation
PR is now waiting for a maintainer to run the acceptance tests. This PR will only perform build and linting. Note for the maintainer: To run the acceptance tests, please comment /run-acceptance-tests on the PR |
PR is now waiting for a maintainer to run the acceptance tests. This PR will only perform build and linting. Note for the maintainer: To run the acceptance tests, please comment /run-acceptance-tests on the PR |
/run-acceptance-tests |
Please view the PR build - https://github.com/pulumi/pulumi-kubernetes/actions/runs/360069551 |
PR is now waiting for a maintainer to run the acceptance tests. This PR will only perform build and linting. Note for the maintainer: To run the acceptance tests, please comment /run-acceptance-tests on the PR |
@lblackstone Is the acceptance test bot working? Double checking that link, it seems to have built against the wrong PR: https://github.com/pulumi/pulumi-kubernetes/actions/runs/360069551 |
Yes, the header is misleading, but the checkout is for the correct SHA: https://github.com/pulumi/pulumi-kubernetes/runs/1391649550?check_suite_focus=true#step:2:478 |
Fixes #1231
You can successfully create a provider by specifying
kubeconfig
as an object, even though the SDKs are typed as a string. Any subsequent updates will fail in the DiffConfig path when it tries to parse the existing kubeconfig (it appears that there's no workaround for this at the moment once you've gotten yourself into the situation.This change adds support for parsing kubeconfig specified as either a map or a string to bypass the panic. Any other types will fail, and malformed kubeconfig maps will continue to fail on this path. I did not update the client SDK types of kubeconfig as the goal of this fix was to get rid of the panic.
How do you get into this situation? EKS specifies
kubeconfig
asOutput<any>
, so this is quite an easy mistake to make if the kubeconfig comes back as an object as it does in the following example:On the first update, the code runs fine and resources are created. On subsequent runs, it panics with the error message in the linked issue. The panic is no longer triggered after this change. It is unclear to me if the
any
typing of ekskubeconfig
is intentional or a bug, will follow up on that separately.