pulumi-kubernetes
pulumi-kubernetes copied to clipboard
Expose config to disable upsert behavior
This exposes opt-in provider configuration to disable upsert behavior. When this is set we will use CSA for creation and surface "already exists" errors when we attempt to overwrite something.
I called the config enableUpsert to be consistent with some of our other configs (although I'd prefer disableUpsert since that makes it more obvious what the default behavior is).
An E2E test is included and I'll try to add some units around this as well.
Fixes https://github.com/pulumi/pulumi-kubernetes/issues/2926.
Does the PR have any schema changes?
Looking good! No breaking changes found. No new resources/functions.
Codecov Report
Attention: Patch coverage is 11.76471% with 30 lines in your changes are missing coverage. Please review.
Project coverage is 29.79%. Comparing base (
09be004) to head (0006ded).
| Files | Patch % | Lines |
|---|---|---|
| provider/pkg/gen/schema.go | 0.00% | 21 Missing :warning: |
| provider/pkg/provider/provider.go | 25.00% | 7 Missing and 2 partials :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## master #3000 +/- ##
==========================================
- Coverage 29.86% 29.79% -0.08%
==========================================
Files 63 63
Lines 8353 8384 +31
==========================================
+ Hits 2495 2498 +3
- Misses 5634 5660 +26
- Partials 224 226 +2
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Let me state my opinion here, that Kubernetes SSA is designed for a multi-party authoring experience (where multiple parties apply their intentions to a given object), but design-wise says nothing about object lifecycle. For example, it doesn't answer the question of "who should delete this object, my party or your party?". An auto-scaler, for example, would not expect to create or to delete a given object, merely to control the replicas field while the object exists.
Pulumi has features like "import" and "retainOnDelete" to control an object's lifecycle, and there's no good reason that SSA should complicate that, in my opinion. I agree with disabling upsert, perhaps opt-in in v4 and always disabled in v5.