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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose SSA patchForce option as an env var #2259

Closed
lblackstone opened this issue Dec 9, 2022 · 5 comments 路 Fixed by #2260
Closed

Expose SSA patchForce option as an env var #2259

lblackstone opened this issue Dec 9, 2022 · 5 comments 路 Fixed by #2260
Assignees
Labels
area/server-side-apply kind/enhancement Improvements or new features resolution/fixed This issue was fixed
Milestone

Comments

@lblackstone
Copy link
Member

Hello!

  • Vote on this issue by adding a 馃憤 reaction
  • If you want to implement this feature, comment to let us know (we'll work with you on design, scheduling, etc.)

Issue details

There are quite a few cases where patchForce is needed as a one-time change, but not something that users want to leave on permanently for a resource. This behavior is currently enabled by setting an annotation.

We should consider exposing the same behavior through an environment variable to allow one-time updates more easily.

Affected area/feature

@lblackstone lblackstone added kind/enhancement Improvements or new features area/server-side-apply labels Dec 9, 2022
@lblackstone
Copy link
Member Author

Got this working locally. I'll add this in a PR shortly.

PULUMI_K8S_ENABLE_PATCH_FORCE="true" pulumi up --target="**DeploymentPatch::example"
Previewing update (dev)

View Live: https://app.pulumi.com/lblackstone/pulumi-k8s-test/dev/previews/2fc3fde8-3420-4e39-ae23-196f6bfd4164

     Type                                   Name                 Plan
     pulumi:pulumi:Stack                    pulumi-k8s-test-dev
 +   鈹斺攢 kubernetes:apps/v1:DeploymentPatch  example              create


Resources:
    + 1 to create
    3 unchanged

Do you want to perform this update? yes
Updating (dev)

View Live: https://app.pulumi.com/lblackstone/pulumi-k8s-test/dev/updates/369

     Type                                   Name                 Status
     pulumi:pulumi:Stack                    pulumi-k8s-test-dev
 +   鈹斺攢 kubernetes:apps/v1:DeploymentPatch  example              created (0.23s)


Resources:
    + 1 created
    3 unchanged

Duration: 1s

@hagaibarel
Copy link

@lblackstone do you have plans to add this option to the stack configs as well? Same as other proivder options, e.g. kubernetes:enablePatchForce: "true"?

@lblackstone
Copy link
Member Author

@lblackstone do you have plans to add this option to the stack configs as well? Same as other proivder options, e.g. kubernetes:enablePatchForce: "true"?

Would that be useful to you? My impression was that this option is mostly useful on a per-resource basis, so I wasn't planning to add a stack config.

@hagaibarel
Copy link

Hmm... good question. I've had situations where I had a lot of conflicts and it was tedious to add the annotation per resource, in those cases I thought to myself that a config option would be really useful. That way I know just from looking at the stack config that we're set to force patch on conflict without relying on an env var that might be not be set (depending on the machine running pulumi up)

I guess it's a matter of preference, I prefer explicitly setting things in the stack config instead of relaying implicitly on the running environment. That way the entire project is self contained without any external arguments.

@lblackstone
Copy link
Member Author

That makes sense. I'll open another issue to track that request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/server-side-apply kind/enhancement Improvements or new features resolution/fixed This issue was fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants