Skip to content

Stop setting blockOwnerDeletion on proxy-runner Services #7322

Duplicate

Description

@ChrisJBurns

Problem

The proxy-runner gives the mcp-<name> and mcp-<name>-headless Services a StatefulSet owner reference with blockOwnerDeletion: true. Under OwnerReferencesPermissionEnforcement (OpenShift), that requires update on apps/statefulsets/finalizers. #6756 adds that grant to the runner Role and the operator ClusterRole.

The flag does nothing for us. It only matters for foreground cascading deletion, and nothing in toolhive uses it: there is no DeletePropagationForeground or PropagationPolicy in cmd/ or pkg/, and RemoveWorkload deletes with empty DeleteOptions. Dropping it removes the need for the extra permission.

This was proposed as a follow-up in #6756 (jhrozek).

Proposed change

  • pkg/container/kubernetes/client.go:
    • Remove WithBlockOwnerDeletion(true) in applyService (around line 1144). It is hardcoded and is the value that actually applies.
    • Remove the unused BlockOwnerDeletion: ptr.To(true) in ensureBackendServices (around line 611), and update the comment around lines 591-593.
  • pkg/container/kubernetes/client_test.go: update the asserts around lines 868-869 and 888-889 to expect no blockOwnerDeletion.

The runner applies with Force: true as field owner, so existing Services lose the field on their next apply. Removing the field doesn't require the finalizers permission.

Keep the RBAC grant for one release

Don't remove apps/statefulsets/finalizers from defaultRBACRules or from the operator's +kubebuilder:rbac marker in this change. A new operator paired with an older pinned runner image would still set the flag, and OpenShift would break again. Remove the grant in a later release, then run task operator-manifests and update the Chainsaw assert-rbac-clusterrole.yaml fixtures. upsertRole replaces the Role's rules wholesale, so existing Roles shrink with no migration.

Keep the per-CRD toolhive /finalizers markers. The toolhive.stacklok.dev * rule already covers them, but they document the dependency in case * is ever narrowed.

Sequencing

Land after #6756 and after #7321, so CI enforces the plugin when this runs.

Activity

  1. added
    needs-triage
    on Nov 26, 2026
  2. rdimitrov commented on Nov 26, 2026

    @rdimitrov
    Member

    Closing as a duplicate of #6836, which proposes the same change and already has discussion. I carried this issue's plan to keep the grant for one release over to it: #6836 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions