Skip to content

Emit resourceRef.apiVersion on restate-workload-identity IAMPolicyMember#136

Open
pcholakov wants to merge 1 commit into
mainfrom
pavel/iampolicymember-apiversion
Open

Emit resourceRef.apiVersion on restate-workload-identity IAMPolicyMember#136
pcholakov wants to merge 1 commit into
mainfrom
pavel/iampolicymember-apiversion

Conversation

@pcholakov

@pcholakov pcholakov commented May 23, 2026

Copy link
Copy Markdown
Contributor

Summary

The operator's server-side apply of the restate-workload-identity IAMPolicyMember CR was sending spec.resourceRef without apiVersion. Config Connector defaults that field at creation, but SSA's atomic-struct semantics strip the defaulted value on every subsequent apply, and CC's deny-immutable-field-updates webhook then denies the change with:

admission webhook "deny-immutable-field-updates.cnrm.cloud.google.com" denied the request: the IAMPolicyMember's spec is immutable

Reconcile loops on this and blocks any unrelated RestateCluster update (e.g. image overrides) from propagating.

This change adds apiVersion to IAMPolicyMemberResourceRef and sets it to iam.cnrm.cloud.google.com/v1beta1 when constructing the workload-identity binding (the referenced resource is always an IAMServiceAccount). The webhook only fires on changes to immutable fields, and the value the operator now emits matches what Config Connector defaulted at create time, so the apply becomes a no-op for that field.

Related: restatedev/restate-cloud#833

Quality gates

All green inside the workspace:

  • cargo check: passes
  • cargo nextest run --all-features: 48 passed, 1 skipped
  • cargo fmt --all -- --check: clean for files touched by this PR (a pre-existing fmt diff in src/resources/restatedeployments.rs:375 is on main and out of scope here)
  • cargo clippy --all-features --all-targets -- -D warnings: clean

Rollout note

This needs an operator chart version bump and a Nuon roll to land on existing BYOC installs that are wedged on the immutability webhook.

Test plan

  • Upgrade operator on a wedged dev BYOC env, confirm IAMPolicyMember reconciles cleanly and the wedge clears
  • Confirm a subsequent RestateCluster image override applies without retriggering the webhook
  • Verify on a fresh install that the IAMPolicyMember is created and reaches Ready=True

The operator's server-side apply of restate-workload-identity
IAMPolicyMember was stripping resourceRef.apiVersion from the
existing CR (which Config Connector defaults at creation), triggering
the deny-immutable-field-updates webhook on every reconcile after
the initial create. Wedges the operator on any RestateCluster update.

Add apiVersion to IAMPolicyMemberResourceRef and set it to
iam.cnrm.cloud.google.com/v1beta1 when constructing the workload-
identity binding, since the referenced resource is always an
IAMServiceAccount. The webhook only fires on changes to immutable
fields; emitting the same value CC defaulted is a no-op there.

Surfaced by restatedev/restate-cloud#833 during dev canary validation
of per-environment GCP service account identity.
@pcholakov pcholakov marked this pull request as ready for review May 23, 2026 16:34
@pcholakov pcholakov requested a review from lukebond May 23, 2026 16:34
@pcholakov

Copy link
Copy Markdown
Contributor Author

Tested by switching to the PR docker image, and that fixed the issue I was seeing, btw!

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 this pull request may close these issues.

2 participants