I’m having an issue in CI where I’ve updated `@pul...
# kubernetes
p
I’m having an issue in CI where I’ve updated
@pulumi/kubernetes
to the latest version (v2.6) but the state was using v2.2. In CI only the new one is installed (v2.6) and Pulumi fails because it attempts to load v2.2:
Copy code
error: could not load plugin for kubernetes provider 'urn:pulumi:<snip>::pulumi:providers:kubernetes::default_2_2_2': failed to load plugin /<snip>/.pulumi/plugins/resource-kubernetes-v2.2.2/pulumi-resource-kubernetes: plugin not found
Is there a way to refresh the state so that it expects the latest version of the plugin instead of the older one?
b
I believe you have to perform a successful run with the new and old plugins installed and then the state will update
Cc @white-balloon-205 to confirm
p
Gotcha. Given that one can’t rely on CI caches to have an old version of the plugin installed, is there a way to install a Pulumi plugin manually (i.e., not relying on
npm install
) so that during that transition period one can manually install the old version?
For example, one could do this:
Copy code
install_pulumi # installs Pulumi and configures PULUMI_HOME and credentials
yarn install
pulumi plugin install kubernetes@old
pulumi up # will move state from old to new
And then the line that installs the old plugin can be removed?
I’ve seen Pulumi automatically install missing plugins but it seems to only happen for some plugins and not all. The Kubernetes one is one of those that doesn’t auto-install
b
the pulumi plugin command takes a version
pulumi plugin install resource kubernetes v2.2.0
p
Yeah, I just noticed that 😅 Before I start manually installing plugins I wanted to see if I could do something more generic. The
pulumi plugin install
documentation specifies that if no kind/name/version is provided it will make a conservative guess as to what the project needs but running it locally, even with verbose logging results in no output (and no plugins installed) Also, do you know why the Kubernetes plugin isnt automatically installed, but others like GCP are?
b
there's no reason it shouldn't be, are you referring to the older plugin not automatically being installed?
w
It would definitely be good to support automatically acquiring plugins based on what's in the state file. Today we only automatically acquire whats in packages.
p
Yeah, even if the plugin is in
package.json
it won’t automatically install it (i.e., if
yarn install
is not run)
Also, running
pulumi plugin install
seems to be doing nothing. So I would have to hardcode
pulumi plugin install resource kubernetes v2.2.2
w
I opened https://github.com/pulumi/pulumi/issues/5619 - please do add additional details on there - totally agree with both points you noted above.
p
Great. Thanks @white-balloon-205! I’ll just hardcode the specific plugin in CI for now. Good to have a workaround!
I’ll add details to the issue
b
i was just writing the same issue, thanks @white-balloon-205!
p
Just added some details to the issue
@white-balloon-205, can you explain this?
Copy code
$ pulumi plugin ls
NAME        KIND      VERSION  SIZE    INSTALLED  LAST USED
gcp         resource  3.25.0   101 MB  n/a        40 seconds ago
kubernetes  resource  2.6.3    78 MB   n/a        40 seconds ago
kubernetes  resource  2.2.2    53 MB   n/a        1 second ago

$ pulumi up
Previewing update (makeswift/staging)
View Live: <https://app.pulumi.com/makeswift/table-webhooks/staging/previews/771837e2-7f1c-4e9d-a1eb-deaa51780236>
 
error: could not load plugin for kubernetes provider 'urn:pulumi:staging::table-webhooks::pulumi:providers:kubernetes::default_2_2_2': failed to load plugin /builds/makeswift/cosmos/.pulumi/plugins/resource-kubernetes-v2.2.2/pulumi-resource-kubernetes: plugin not found
The plugin seems to clearly be there but for some reason there’s still an error. Is this something to do with the fact that
INSTALLED
shows
n/a
instead of the install time?
I wasn’t able to get neither
pulumi plugin install resource kubernetes 2.2.2
or
pulumi install resource kubernetes 2.2.2 --exact
or
yarn add @pulumi/kubernetes@2.2.2
working so I had to manually update the state by exporting it, tweaking the provider versions and then importing the modified state.