chilly-sunset-85353
11/24/2025, 11:30 PMReplaceOnChanges = ["*"]
Anyone have an idea for resolving this?
Preview failed: resource "..." was not successfully created by the Kubernetes API server: StatefulSet.apps "cluster" is invalid: spec: Forbidden: updates to statefulset spec for fields other than 'replicas', 'ordinals', 'template', 'updateStrategy', 'persistentVolumeClaimRetentionPolicy' and 'minReadySeconds' are forbidden
My customresourceoptions:
new CustomResourceOptions {
Parent = this,
Provider = k8sProvider,
// this didn't work either
// ReplaceOnChanges = [
// "spec.podManagementPolicy",
// "spec.revisionHistoryLimit",
// "spec.selector",
// "spec.selector.*",
// "spec.serviceName",
// "spec.volumeClaimTemplates",
// "spec.volumeClaimTemplates.*",
// ],
ReplaceOnChanges = ["*"],
DeleteBeforeReplace = true,
CustomTimeouts = new CustomTimeouts {
Create = TimeSpan.FromMinutes( 1 ),
Update = TimeSpan.FromMinutes( 1 )
}
}chilly-sunset-85353
11/24/2025, 11:31 PMvolumeClaimTemplates before, and now I'm getting it attempting to update the selector.chilly-sunset-85353
11/24/2025, 11:41 PMchilly-sunset-85353
11/24/2025, 11:43 PM--verbose 4 doesn't really lay bare the inner workings of what's happening in the provider/enginechilly-sunset-85353
11/24/2025, 11:43 PMchilly-sunset-85353
11/24/2025, 11:44 PMlittle-cartoon-10569
11/24/2025, 11:56 PMchilly-sunset-85353
11/24/2025, 11:56 PMchilly-sunset-85353
11/24/2025, 11:56 PMStatefulSet from Pulumi.Kubernetes.Apps.V1chilly-sunset-85353
11/24/2025, 11:58 PMlittle-cartoon-10569
11/25/2025, 12:00 AMchilly-sunset-85353
11/25/2025, 12:00 AMchilly-sunset-85353
11/25/2025, 12:00 AMlittle-cartoon-10569
11/25/2025, 12:00 AMReplaceOnChanges = { "*" }chilly-sunset-85353
11/25/2025, 12:01 AM["*"] is valid collection syntax as of C#12 (see https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/collection-expressions)chilly-sunset-85353
11/25/2025, 12:02 AMpulumi up
2. uncomment the extra selector on Program.cs:24 and run pulumi up againchilly-sunset-85353
11/25/2025, 12:03 AM15:55:19 /mnt/c/Users/madgv/work/bog/stateful-set-bug-repro $ pulumi up
Previewing update (dev):
Type Name Plan Info
pulumi:pulumi:Stack stateful-set-bug-repro-dev 1 error
+- └─ kubernetes:apps/v1:StatefulSet my-stateful-set replace [diff: ~sp
Diagnostics:
kubernetes:apps/v1:StatefulSet (my-stateful-set):
error: Preview failed: resource "urn:pulumi:dev::stateful-set-bug-repro::kubernetes:apps/v1:StatefulSet::my-stateful-set" was not successfully created by the Kubernetes API server: StatefulSet.apps "test" is invalid: spec: Forbidden: updates to statefulset spec for fields other than 'replicas', 'ordinals', 'template', 'updateStrategy', 'persistentVolumeClaimRetentionPolicy' and 'minReadySeconds' are forbidden
pulumi:pulumi:Stack (stateful-set-bug-repro-dev):
error: preview failed
Resources:
+-1 to replace
3 unchanged
2 erroredlittle-cartoon-10569
11/25/2025, 12:10 AMReplaceOnChanges = ["*"] will use collection expressions to build a List<string> and assign it, but ReplaceOnChanges = {"*"} will build a string[] and convert/cast it? Could the Pulumi SDK be doing something clever when converting/casting?little-cartoon-10569
11/25/2025, 12:10 AMReplaceOnChanges is List<string>, not string[]. Not sure if that's important.chilly-sunset-85353
11/25/2025, 12:11 AMlittle-cartoon-10569
11/25/2025, 12:11 AMList<string>.little-cartoon-10569
11/25/2025, 12:11 AMstring[]. I wondered if that was important.chilly-sunset-85353
11/25/2025, 12:15 AMlittle-cartoon-10569
11/25/2025, 12:16 AMchilly-sunset-85353
11/25/2025, 12:16 AMchilly-sunset-85353
11/25/2025, 12:17 AMchilly-sunset-85353
11/25/2025, 12:17 AMlittle-cartoon-10569
11/25/2025, 12:17 AMlittle-cartoon-10569
11/25/2025, 12:18 AMup --skip-preview will it work?chilly-sunset-85353
11/25/2025, 12:18 AMchilly-sunset-85353
11/25/2025, 12:18 AMchilly-sunset-85353
11/25/2025, 12:18 AM$ pulumi up --skip-preview
Updating (dev):
Type Name Status Info
pulumi:pulumi:Stack stateful-set-bug-repro-dev
+- └─ kubernetes:apps/v1:StatefulSet my-stateful-set replaced (2s) [dif
Resources:
+-1 replaced
3 unchanged
Duration: 7slittle-cartoon-10569
11/25/2025, 12:19 AMchilly-sunset-85353
11/25/2025, 12:19 AMchilly-sunset-85353
11/25/2025, 12:20 AMlittle-cartoon-10569
11/25/2025, 12:20 AMchilly-sunset-85353
11/25/2025, 12:21 AMchilly-sunset-85353
11/25/2025, 12:21 AMchilly-sunset-85353
11/25/2025, 12:21 AMlittle-cartoon-10569
11/25/2025, 12:21 AMchilly-sunset-85353
11/25/2025, 12:22 AMchilly-sunset-85353
11/25/2025, 12:22 AMchilly-sunset-85353
11/25/2025, 12:23 AMlittle-cartoon-10569
11/25/2025, 12:23 AMchilly-sunset-85353
11/25/2025, 12:24 AMchilly-sunset-85353
11/25/2025, 12:24 AM