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 attempts replacement of dynamic provider after version upgrade #645

Closed
geekflyer opened this issue Jul 22, 2019 · 1 comment · Fixed by pulumi/pulumi#2973
Closed
Assignees
Milestone

Comments

@geekflyer
Copy link

We're facing an issue with dynamic kubernetes provider instances when upgrading pulumi versions. I can't precisely say which version this started to occur, but I believe it first occured when upgrading CLI from 0.17.16 > 0.17.24 and "@pulumi/kubernetes": "0.22.0", > "@pulumi/kubernetes": "0.25.2", .

Basically what happens is the after the upgrade pulumi attempts to replace all our dynamic kubernetes provider instances incl. all resources that have been created using it, even though we made no changes to the stack resources.

After a bit debugging I found the issue is that previously our stack state only contained this:

 {
                "urn": "urn:pulumi:my-stack::my-stack::pulumi:providers:kubernetes::my-cluster",
                ...
                "inputs": {
                    "kubeconfig": "...",
                    "namespace": "my-namespace"
                }
                ...
            }

and after the upgrade pulumi wants to converge to this state:

     {
                  "urn": "urn:pulumi:my-stack::my-stack::pulumi:providers:kubernetes::my-cluster",
                ...
                "inputs": {
                    "kubeconfig": "...",
                    "namespace": "my-namespace"
                },
                "outputs": {
                    "kubeconfig": "...",
                    "namespace": "my-namespace"
                }
                ...
            },

As you can see after the upgrade suddenly an "outputs" section that wasn't there before is being added. Because it didn't exist before pulumi attempts to do a replacement.
I can workaround the issue by copying the "inputs" and pasting them as "outputs" and importing the fixed state.json which I did for a few stacks but since we have almost 100 stacks this is not a scalable solution.

Is this a known issue and is there a better solution to the problem?

I can btw reproduce this problem quite consistently (my machine, other machines, CI).

@geekflyer
Copy link
Author

@pgavlin

pgavlin added a commit to pulumi/pulumi that referenced this issue Jul 22, 2019
If we have no old state when diffing a provider, use the old inputs as
the old state. This handles the scenario where the CLI is being upgraded
from a version that did not reflect provider inputs to provider outputs,
and a provider is being upgraded from a version that did not implement
`DiffConfig` to a version that does.

Fixes pulumi/pulumi-kubernetes#645.
pgavlin added a commit to pulumi/pulumi that referenced this issue Jul 22, 2019
If we have no old state when diffing a provider, use the old inputs as
the old state. This handles the scenario where the CLI is being upgraded
from a version that did not reflect provider inputs to provider outputs,
and a provider is being upgraded from a version that did not implement
`DiffConfig` to a version that does.

Fixes pulumi/pulumi-kubernetes#645.
pgavlin added a commit to pulumi/pulumi that referenced this issue Jul 23, 2019
If we encounter a provider with old inputs but no old outputs when reading
a checkpoint file, use the old inputs as the old outputs. This handles the
scenario where the CLI is being upgraded from a version that did not
reflect provider inputs to provider outputs, and a provider is being
upgraded from a version that did not implement `DiffConfig` to a version
that does.

Fixes pulumi/pulumi-kubernetes#645.
pgavlin added a commit to pulumi/pulumi that referenced this issue Jul 23, 2019
If we encounter a provider with old inputs but no old outputs when reading
a checkpoint file, use the old inputs as the old outputs. This handles the
scenario where the CLI is being upgraded from a version that did not
reflect provider inputs to provider outputs, and a provider is being
upgraded from a version that did not implement `DiffConfig` to a version
that does.

Fixes pulumi/pulumi-kubernetes#645.
@hausdorff hausdorff added this to the 0.25 milestone Jul 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants