Skip to content

Enable OwnerReferencesPermissionEnforcement in kind e2e clusters #7321

Done

Description

@ChrisJBurns

Problem

OpenShift enables the OwnerReferencesPermissionEnforcement admission plugin. It rejects creating an object whose ownerReference sets blockOwnerDeletion: true unless the creator can update the owner's <resource>/finalizers. Vanilla kind doesn't enable this plugin, so our e2e never caught #6835 (fixed in #6756). On OpenShift, the proxy-runner failed to create the mcp-<name>-headless Service, which is owned by the StatefulSet.

This was proposed as a follow-up in jhrozek's comment on #6756.

Proposed change

  1. Enable the plugin in test/e2e/thv-operator/kind-config.yaml, merging into the existing ClusterConfiguration patch:
    kubeadmConfigPatches:
      - |
        kind: ClusterConfiguration
        apiServer:
          extraArgs:
            service-node-port-range: "30000-30020"
            enable-admission-plugins: "NodeRestriction,OwnerReferencesPermissionEnforcement"
    NodeRestriction must stay in the list, because setting this flag replaces kubeadm's defaults.
  2. The Chainsaw job e2e-tests-operator in .github/workflows/operator-ci.yml (around lines 225-231) creates its cluster with kind's defaults. Point it at this config, or at a dedicated one, so the check runs on every PR. .github/workflows/test-e2e-lifecycle.yml and task kind-setup-e2e already use the config file.

Notes

  • Sequencing: this must land after Add /finalizers subresource for OKD/OpenShift installs #6756. Without that PR's statefulsets/finalizers grant, every SSE and streamable-http MCPServer in Chainsaw fails.
  • Other gaps: every operator SetControllerReference owner is a toolhive.stacklok.dev CR, which the * update rule covers. vMCP and the remote proxy set no owner references. registry-api is the one unknown, because it runs from an external image.
  • kind 1.36: once Renovate moves CI to kindest/node:v1.36, kind uses kubeadm v1beta4, where extraArgs is a list of {name, value}. Both this patch and the existing service-node-port-range patch will need rewriting, likely with kubeadmConfigPatchesJSON6902 and op: add on /apiServer/extraArgs/-.
  • envtest won't catch this class of bug: its clients run as admin and its API server doesn't run this plugin.

Activity

  1. added
    needs-triage
    on Nov 26, 2026
  2. added a commit that references this issue on Nov 26, 2026
    f4809b8
  3. ChrisJBurns commented on Nov 26, 2026

    @ChrisJBurns
    CollaboratorAuthor

    Correction to the kind 1.36 note above: it doesn't hold with kind v0.33.0. rdimitrov built a kindest/node:v1.36.1 cluster from this config, and kind converted the map-form extraArgs to the kubeadm v1beta4 list form itself. Both flags were on the apiserver, so neither patch needs rewriting for the 1.36 bump. See the review on #7334.

  4. added a commit that references this issue on Nov 26, 2026
    9300f3f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

needs-triage

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions