Skip to content

fix: WorkspaceType admission rejecting forward-referenced APIExports#4149

Open
pen-pal wants to merge 1 commit into
kcp-dev:mainfrom
pen-pal:fix/4145-wst-allow-missing-apiexport
Open

fix: WorkspaceType admission rejecting forward-referenced APIExports#4149
pen-pal wants to merge 1 commit into
kcp-dev:mainfrom
pen-pal:fix/4145-wst-allow-missing-apiexport

Conversation

@pen-pal
Copy link
Copy Markdown

@pen-pal pen-pal commented May 25, 2026

Summary

Fixes a regression in 0.31.2 where creating a WorkspaceType referencing an APIExport that doesn't exist yet is rejected with no permission to bind to export ..., even for admins.

The bind-permission check (added in #4082) treats a NotFound on the APIExport lookup the same as a permission denial. This breaks the common flow of creating a WorkspaceType before its APIExports.

Now: if the APIExport isn't found, skip the SAR for that entry. The check still runs whenever the APIExport exists.

What Type of PR Is This?

/kind bug
/kind regression

Related Issue(s)

Fixes #4145

Release Notes

Fix a regression in WorkspaceType admission that rejected creates referencing an APIExport that did not yet exist, even for admins. Such forward references are allowed again; the bind-permission check still applies when the APIExport exists.

The bind-permission gate added in 429ccf7 returned a "no permission to
bind to export" forbidden whenever the referenced APIExport could not be
resolved, blocking even admins from creating a WorkspaceType ahead of
its APIExports. Treat NotFound as a skip so the declarative ordering
flow that worked before 0.31.2 keeps working; an existing APIExport
still triggers the SAR.

Fixes kcp-dev#4145

Signed-off-by: pen-pal <unameme@proton.me>
@kcp-ci-bot kcp-ci-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. dco-signoff: yes Indicates the PR's author has signed the DCO. kind/regression Categorizes issue or PR as related to a regression from a prior release. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API labels May 25, 2026
@kcp-ci-bot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign sttts for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kcp-ci-bot kcp-ci-bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 25, 2026
@kcp-ci-bot
Copy link
Copy Markdown
Contributor

Hi @pen-pal. Thanks for your PR.

I'm waiting for a kcp-dev member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@pen-pal pen-pal changed the title fix: Fix WorkspaceType admission rejecting forward-referenced APIExports [WIP] fix: Fix WorkspaceType admission rejecting forward-referenced APIExports May 25, 2026
@kcp-ci-bot kcp-ci-bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 25, 2026
@pen-pal pen-pal changed the title [WIP] fix: Fix WorkspaceType admission rejecting forward-referenced APIExports fix: WorkspaceType admission rejecting forward-referenced APIExports May 25, 2026
@kcp-ci-bot kcp-ci-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates the PR's author has signed the DCO. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/bug Categorizes issue or PR as related to a bug. kind/regression Categorizes issue or PR as related to a regression from a prior release. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: workspace type creation with referenced non existing ApiExport

2 participants