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

Deployment container or image name change ignored when server-side apply is enabled. #2322

Closed
MitchellGerdisch opened this issue Feb 17, 2023 · 2 comments
Assignees
Labels
area/server-side-apply kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed size/M Estimated effort to complete (up to 5 days).
Milestone

Comments

@MitchellGerdisch
Copy link

What happened?

After deploying a k8s deployment that uses server-side apply, and then changing the container or image name, Pulumi does not detect a change when running pulumi up.

Expected Behavior

Changes to the pulumi code should be detected and updates made accordingly.

Steps to reproduce

Using the code in this file: main.py.txt

  1. Deploy a stack using the above code
  2. modify container_name and/or image_name (around line 80)
  3. Run pulumi preview and/or pulumi up and note that no change is detected when in fact the code has changed.

Output of pulumi about

CLI
Version 3.55.0
Go Version go1.20
Go Compiler gc

Plugins
NAME VERSION
gcp 6.49.0
kubernetes 3.24.0
python unknown
random 4.11.2

Host
OS darwin
Version 12.5.1
Arch x86_64

Found no pending operations associated with dev

Backend
Name pulumi.com

Dependencies:
NAME VERSION
pip 23.0.0
pulumi-gcp 6.49.0
pulumi-kubernetes 3.24.0
pulumi-random 4.11.2
setuptools 67.3.2
wheel 0.38.4

Additional context

Things work correctly (i.e. updates are detected and executed) when server-side apply is NOT enabled.

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

@MitchellGerdisch MitchellGerdisch added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Feb 17, 2023
@squaremo
Copy link
Contributor

squaremo commented Feb 17, 2023

I was able to see this by using pulumi new kubernetes-typescript and adapting a little:

import * as k8s from "@pulumi/kubernetes";
import * as kx from "@pulumi/kubernetesx";

const provider = new k8s.Provider("local", { enableServerSideApply: true });

const appLabels = { app: "nginx" };
const deployment = new k8s.apps.v1.Deployment("nginx", {
    spec: {
        selector: { matchLabels: appLabels },
        replicas: 1,
        template: {
            metadata: { labels: appLabels },
            spec: { containers: [{ name: "nginx1", image: "nginx" }] }
        }
    }
}, { provider });

export const name = deployment.metadata.name;

If I pulumi up, then change the name of the container, and pulumi up again, it says nothing has changed and takes no actions. I would expect it to update the pod template of the deployment.

@squaremo squaremo removed the needs-triage Needs attention from the triage team label Feb 17, 2023
@kpitzen kpitzen added the size/M Estimated effort to complete (up to 5 days). label Feb 27, 2023
@lblackstone lblackstone self-assigned this Jul 13, 2023
@lblackstone lblackstone added the resolution/fixed This issue was fixed label Jul 13, 2023
@lblackstone lblackstone added this to the 0.91 milestone Jul 13, 2023
@lblackstone
Copy link
Member

This works in the v4 release when you run a refresh in either CSA or SSA mode (fixed in #2445).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/server-side-apply kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed size/M Estimated effort to complete (up to 5 days).
Projects
None yet
Development

No branches or pull requests

5 participants