Skip to content

bug: workspace type creation with referenced non existing ApiExport #4145

@OlegErshov

Description

@OlegErshov

Describe the bug

Before (until version 0.31.2) it was possible to create a WorkspaceType which references non existing yet ApiExport in defaultApiBindings section. With 0.31.2 it's not possible even using admin kubeconfig. It might be not a bug as it makes sense to do not create WorkspaceType which references something non existing

Steps To Reproduce

  1. Run sharded test server https://github.com/kcp-dev/kcp/tree/main/cmd/sharded-test-server
  2. Using admin kubeconfig try to create workspace type like this and you will get the next error
apiVersion: tenancy.kcp.io/v1alpha1
kind: WorkspaceType
metadata:
  name: provider
spec:
  defaultAPIBindings:
    - export: core.platform-mesh.io
      path: root:platform-mesh-system

Error:
Error from server (Forbidden): error when creating "workspace-type-provider.yaml": workspacetypes.tenancy.kcp.io "provider" is forbidden: unable to create or update WorkspaceType: no permission to bind to export root:platform-mesh-system:core.platform-mesh.io

If you create platform-mesh-system workspace, you will still face the same issue

Also important thing. If you create ApiExport and than reference it in WorkspaceType, the issue will be gone

Expected Behaviour

As it was before, WorkspaceType is created without issues

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions