Fix events.k8s.io permission denial through APIExport virtual workspace#3894
Merged
kcp-ci-bot merged 5 commits intokcp-dev:mainfrom Mar 19, 2026
Merged
Fix events.k8s.io permission denial through APIExport virtual workspace#3894kcp-ci-bot merged 5 commits intokcp-dev:mainfrom
kcp-ci-bot merged 5 commits intokcp-dev:mainfrom
Conversation
Contributor
|
Skipping CI for Draft Pull Request. |
Signed-off-by: Karol Szwaj <karol.szwaj@gmail.com> On-behalf-of: @SAP karol.szwaj@sap.com
…ding Signed-off-by: Karol Szwaj <karol.szwaj@gmail.com> On-behalf-of: @SAP karol.szwaj@sap.com
Signed-off-by: Karol Szwaj <karol.szwaj@gmail.com> On-behalf-of: @SAP karol.szwaj@sap.com
…d /apis/events.k8s.io/v1/events) get registered in the vws Signed-off-by: Karol Szwaj <karol.szwaj@gmail.com> On-behalf-of: @SAP karol.szwaj@sap.com
8794915 to
3db5f39
Compare
Member
Author
|
/retest |
Contributor
|
@cnvergence is it ready to merge? |
Member
Author
|
Fixed all the issues, did some testing around as well, looks good to me Logs from MCR controller: 2026-03-16T10:55:39+01:00 INFO entrypoint Setting up manager
2026-03-16T10:55:39+01:00 INFO entrypoint Starting manager
2026-03-16T10:55:39+01:00 INFO controller-runtime.metrics Starting metrics server
2026-03-16T10:55:39+01:00 INFO controller-runtime.metrics Serving metrics server {"bindAddress": ":8080", "secure": false}
2026-03-16T10:55:39+01:00 INFO kcp-apiexport-cluster-provider starting factory
2026-03-16T10:55:39+01:00 INFO Starting Controller {"controller": "kcp-configmap-controller", "controllerGroup": "", "controllerKind": "ConfigMap"}
2026-03-16T10:55:39+01:00 INFO Starting workers {"controller": "kcp-configmap-controller", "controllerGroup": "", "controllerKind": "ConfigMap", "worker count": 1}
2026-03-16T10:55:45+01:00 INFO kcp-apiexport-cluster-provider detected new object {"object": {"metadata":{"name":"examples-apiexport-multicluster","uid":"7f1aef10-9493-4e60-be89-51f6e9764bfd","resourceVersion":"566","generation":1,"creationTimestamp":"2026-03-16T09:55:45Z","annotations":{"kcp.io/cluster":"root"},"ownerReferences":[{"apiVersion":"apis.kcp.io/v1alpha1","kind":"APIExport","name":"examples-apiexport-multicluster","uid":"6f5afeb9-0dba-4d13-a7de-7d328cdf650d"}],"managedFields":[{"manager":"kcp","operation":"Update","apiVersion":"apis.kcp.io/v1alpha1","time":"2026-03-16T09:55:45Z","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:ownerReferences":{".":{},"k:{\"uid\":\"6f5afeb9-0dba-4d13-a7de-7d328cdf650d\"}":{}}},"f:spec":{".":{},"f:export":{".":{},"f:name":{},"f:path":{}}}}}]},"spec":{"export":{"path":"root","name":"examples-apiexport-multicluster"}},"status":{}}}
2026-03-16T10:55:45+01:00 INFO kcp-apiexport-cluster-provider detected updated object {"object": {"metadata":{"name":"examples-apiexport-multicluster","uid":"7f1aef10-9493-4e60-be89-51f6e9764bfd","resourceVersion":"570","generation":1,"creationTimestamp":"2026-03-16T09:55:45Z","annotations":{"kcp.io/cluster":"root"},"ownerReferences":[{"apiVersion":"apis.kcp.io/v1alpha1","kind":"APIExport","name":"examples-apiexport-multicluster","uid":"6f5afeb9-0dba-4d13-a7de-7d328cdf650d"}],"managedFields":[{"manager":"root","operation":"Apply","apiVersion":"apis.kcp.io/v1alpha1","time":"2026-03-16T09:55:45Z","fieldsType":"FieldsV1","fieldsV1":{"f:status":{}},"subresource":"status"},{"manager":"kcp","operation":"Update","apiVersion":"apis.kcp.io/v1alpha1","time":"2026-03-16T09:55:45Z","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:ownerReferences":{".":{},"k:{\"uid\":\"6f5afeb9-0dba-4d13-a7de-7d328cdf650d\"}":{}}},"f:spec":{".":{},"f:export":{".":{},"f:name":{},"f:path":{}}}}}]},"spec":{"export":{"path":"root","name":"examples-apiexport-multicluster"}},"status":{}}}
2026-03-16T10:55:45+01:00 INFO kcp-apiexport-cluster-provider detected updated object {"object": {"metadata":{"name":"examples-apiexport-multicluster","uid":"7f1aef10-9493-4e60-be89-51f6e9764bfd","resourceVersion":"575","generation":1,"creationTimestamp":"2026-03-16T09:55:45Z","annotations":{"kcp.io/cluster":"root"},"ownerReferences":[{"apiVersion":"apis.kcp.io/v1alpha1","kind":"APIExport","name":"examples-apiexport-multicluster","uid":"6f5afeb9-0dba-4d13-a7de-7d328cdf650d"}],"managedFields":[{"manager":"root","operation":"Apply","apiVersion":"apis.kcp.io/v1alpha1","time":"2026-03-16T09:55:45Z","fieldsType":"FieldsV1","fieldsV1":{"f:status":{}},"subresource":"status"},{"manager":"kcp","operation":"Update","apiVersion":"apis.kcp.io/v1alpha1","time":"2026-03-16T09:55:45Z","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:ownerReferences":{".":{},"k:{\"uid\":\"6f5afeb9-0dba-4d13-a7de-7d328cdf650d\"}":{}}},"f:spec":{".":{},"f:export":{".":{},"f:name":{},"f:path":{}}}}},{"manager":"kcp","operation":"Update","apiVersion":"apis.kcp.io/v1alpha1","time":"2026-03-16T09:55:45Z","fieldsType":"FieldsV1","fieldsV1":{"f:status":{"f:conditions":{}}},"subresource":"status"}]},"spec":{"export":{"path":"root","name":"examples-apiexport-multicluster"}},"status":{"conditions":[{"type":"APIExportValid","status":"True","lastTransitionTime":"2026-03-16T09:55:45Z"},{"type":"PartitionValid","status":"True","lastTransitionTime":"2026-03-16T09:55:45Z"}]}}}
2026-03-16T10:55:46+01:00 INFO kcp-apiexport-cluster-provider detected updated object {"object": {"metadata":{"name":"examples-apiexport-multicluster","uid":"7f1aef10-9493-4e60-be89-51f6e9764bfd","resourceVersion":"628","generation":1,"creationTimestamp":"2026-03-16T09:55:45Z","annotations":{"kcp.io/cluster":"root"},"ownerReferences":[{"apiVersion":"apis.kcp.io/v1alpha1","kind":"APIExport","name":"examples-apiexport-multicluster","uid":"6f5afeb9-0dba-4d13-a7de-7d328cdf650d"}],"managedFields":[{"manager":"root","operation":"Apply","apiVersion":"apis.kcp.io/v1alpha1","time":"2026-03-16T09:55:46Z","fieldsType":"FieldsV1","fieldsV1":{"f:status":{"f:endpoints":{"k:{\"url\":\"https://192.168.1.45:6443/services/apiexport/root/examples-apiexport-multicluster\"}":{".":{},"f:url":{}}}}},"subresource":"status"},{"manager":"kcp","operation":"Update","apiVersion":"apis.kcp.io/v1alpha1","time":"2026-03-16T09:55:45Z","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:ownerReferences":{".":{},"k:{\"uid\":\"6f5afeb9-0dba-4d13-a7de-7d328cdf650d\"}":{}}},"f:spec":{".":{},"f:export":{".":{},"f:name":{},"f:path":{}}}}},{"manager":"kcp","operation":"Update","apiVersion":"apis.kcp.io/v1alpha1","time":"2026-03-16T09:55:45Z","fieldsType":"FieldsV1","fieldsV1":{"f:status":{"f:conditions":{}}},"subresource":"status"}]},"spec":{"export":{"path":"root","name":"examples-apiexport-multicluster"}},"status":{"conditions":[{"type":"APIExportValid","status":"True","lastTransitionTime":"2026-03-16T09:55:45Z"},{"type":"PartitionValid","status":"True","lastTransitionTime":"2026-03-16T09:55:45Z"}],"endpoints":[{"url":"https://192.168.1.45:6443/services/apiexport/root/examples-apiexport-multicluster"}]}}}
2026-03-16T10:55:46+01:00 INFO Starting EventSource {"controller": "kcp-configmap-controller", "controllerGroup": "", "controllerKind": "ConfigMap", "source": "func source: 0x1055dd540"}
2026-03-16T10:55:46+01:00 DEBUG kind source handler registered {"cluster": "1glx80kz6wqaccyk", "source": "kind", "hasRegistration": true}
2026-03-16T10:55:46+01:00 DEBUG kind source cache synced {"cluster": "1glx80kz6wqaccyk", "source": "kind"}
2026-03-16T10:55:46+01:00 INFO Reconciling ConfigMap {"controller": "kcp-configmap-controller", "controllerGroup": "", "controllerKind": "ConfigMap", "reconcileID": "f5d5260c-1ffc-499a-bb14-5f7591187baf", "cluster": "1glx80kz6wqaccyk", "name": "kube-root-ca.crt", "uuid": "2376831a-f448-44f2-8c72-7b5147ade22e"}
2026-03-16T10:55:46+01:00 INFO Reconciling ConfigMap {"controller": "kcp-configmap-controller", "controllerGroup": "", "controllerKind": "ConfigMap", "reconcileID": "f83fab42-6829-427a-b1ea-bc8ebff581ea", "cluster": "1glx80kz6wqaccyk", "name": "kube-root-ca.crt", "uuid": "fbafd202-1d6c-4f38-80c3-8b8a0dc6a965"}
2026-03-16T10:55:46+01:00 DEBUG kcp-apiexport-cluster-provider.recorder-manager ConfigMap kube-root-ca.crt reconciled {"url": "https://192.168.1.45:6443/services/apiexport/root/examples-apiexport-multicluster", "type": "Normal", "object": "nil", "action": "ConfigMap Reconciled", "reason": "normal"}
2026-03-16T10:55:46+01:00 DEBUG kcp-apiexport-cluster-provider.recorder-manager ConfigMap kube-root-ca.crt reconciled {"url": "https://192.168.1.45:6443/services/apiexport/root/examples-apiexport-multicluster", "type": "Normal", "object": "nil", "action": "ConfigMap Reconciled", "reason": "normal"}
2026-03-16T10:55:46+01:00 INFO Starting EventSource {"controller": "kcp-configmap-controller", "controllerGroup": "", "controllerKind": "ConfigMap", "source": "func source: 0x1055dd540"}
2026-03-16T10:55:46+01:00 DEBUG kind source handler registered {"cluster": "erc8bn3nmv0x5sji", "source": "kind", "hasRegistration": true}
2026-03-16T10:55:46+01:00 DEBUG kind source cache synced {"cluster": "erc8bn3nmv0x5sji", "source": "kind"}
2026-03-16T10:55:46+01:00 INFO Reconciling ConfigMap {"controller": "kcp-configmap-controller", "controllerGroup": "", "controllerKind": "ConfigMap", "reconcileID": "6ef99b08-c0d5-4079-a301-2809c610f3f9", "cluster": "erc8bn3nmv0x5sji", "name": "kube-root-ca.crt", "uuid": "d9fe37cf-126c-4b2f-b6b6-06cb6f09aa74"}
2026-03-16T10:55:46+01:00 DEBUG kcp-apiexport-cluster-provider.recorder-manager ConfigMap kube-root-ca.crt reconciled {"url": "https://192.168.1.45:6443/services/apiexport/root/examples-apiexport-multicluster", "type": "Normal", "object": "nil", "action": "ConfigMap Reconciled", "reason": "normal"}
2026-03-16T10:55:46+01:00 INFO Reconciling ConfigMap {"controller": "kcp-configmap-controller", "controllerGroup": "", "controllerKind": "ConfigMap", "reconcileID": "4755f517-b534-40d0-b898-29fe5cec1749", "cluster": "erc8bn3nmv0x5sji", "name": "kube-root-ca.crt", "uuid": "442dd653-da64-4418-889e-5f8f68388c85"}
2026-03-16T10:55:46+01:00 DEBUG kcp-apiexport-cluster-provider.recorder-manager ConfigMap kube-root-ca.crt reconciled {"url": "https://192.168.1.45:6443/services/apiexport/root/examples-apiexport-multicluster", "type": "Normal", "object": "nil", "action": "ConfigMap Reconciled", "reason": "normal"}
2026-03-16T10:55:46+01:00 INFO Starting EventSource {"controller": "kcp-configmap-controller", "controllerGroup": "", "controllerKind": "ConfigMap", "source": "func source: 0x1055dd540"}
2026-03-16T10:55:46+01:00 DEBUG kind source handler registered {"cluster": "1zymsjl7u8j6o5wl", "source": "kind", "hasRegistration": true}
2026-03-16T10:55:46+01:00 DEBUG kind source cache synced {"cluster": "1zymsjl7u8j6o5wl", "source": "kind"}
2026-03-16T10:55:46+01:00 INFO Reconciling ConfigMap {"controller": "kcp-configmap-controller", "controllerGroup": "", "controllerKind": "ConfigMap", "reconcileID": "5bdb9dd3-11f7-4496-acfc-b7cf08c52c8c", "cluster": "1zymsjl7u8j6o5wl", "name": "kube-root-ca.crt", "uuid": "e34ef8fe-5b3d-4b22-bbe8-895bbfdc25b1"}
2026-03-16T10:55:46+01:00 DEBUG kcp-apiexport-cluster-provider.recorder-manager ConfigMap kube-root-ca.crt reconciled {"url": "https://192.168.1.45:6443/services/apiexport/root/examples-apiexport-multicluster", "type": "Normal", "object": "nil", "action": "ConfigMap Reconciled", "reason": "normal"}
2026-03-16T10:55:46+01:00 INFO Reconciling ConfigMap {"controller": "kcp-configmap-controller", "controllerGroup": "", "controllerKind": "ConfigMap", "reconcileID": "58ad962a-5fa1-42a3-8b7b-eea2bcd01679", "cluster": "1zymsjl7u8j6o5wl", "name": "kube-root-ca.crt", "uuid": "d0228d22-6452-40aa-832b-12a67ad0ae02"}
2026-03-16T10:55:46+01:00 DEBUG kcp-apiexport-cluster-provider.recorder-manager ConfigMap kube-root-ca.crt reconciled {"url": "https://192.168.1.45:6443/services/apiexport/root/examples-apiexport-multicluster", "type": "Normal", "object": "nil", "action": "ConfigMap Reconciled", "reason": "normal"} |
Contributor
|
/lgtm lets see |
Contributor
|
LGTM label has been added. DetailsGit tree hash: d26aa46ae15fd603ecc6084ec5ef9f97f7e01112 |
Contributor
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mjudeikis The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Member
Author
|
/retest |
1 similar comment
Member
Author
|
/retest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When a controller created events through an APIExport virtual workspace, the event recorder
would get a permanent 403 "Server rejected event (will not retry!)" error.
Fixed the issue where APIExports claim events under the core group (
""), butclient-go's event recorder uses
events.k8s.io/v1. The virtual workspace APIReconcilernow registers both API groups when either event group is claimed.
The authorizer, maximal permission policy, and admission layers now normalise
events.k8s.io/eventsto core""/eventswhen matching against permission claims, so both API groups are treated as equivalent.When a new workspace is created, the APIBinding's
Status.APIExportClusterNameis not yet populated by the controller.Both the authorizer and admission layers now fall back to matching via
Spec.Reference.Export.Pathwhen the status field is empty.What Type of PR Is This?
/kind bug
Related Issue(s)
Fixes #3803
Release Notes