Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: CEL validation of PermissionClaims.ResourceSelector.Namespaces not compiling or passing tests #2898

Open
nrb opened this issue Mar 14, 2023 · 2 comments
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@nrb
Copy link
Contributor

nrb commented Mar 14, 2023

Describe the bug

As part of #2456, a CEL validation rule was added to the PermissionClaims.ResourceSelector.Namespaces field to disallow the empty string ("") anywhere in the list.

However, this test is not passing and the validator function created from the rule seems to be a no-op based on debugging information.

Steps To Reproduce

  1. Edit pkg/apis/apis/v1alpha1/types_apiexport_test.go and remove the t.Skip statement
  2. cd pkg/apis && go test ./apis/v1alpha1 -run TestAPIExportPermissionClaimNamespace
--- FAIL: TestAPIExportPermissionClaimNamespace (0.00s)
    --- FAIL: TestAPIExportPermissionClaimNamespace/single_invalid_entry (0.00s)
        types_apiexport_test.go:279: want error "\"\" is not a valid namespace. Leave field blank for cluster-scoped resources", got ""
FAIL
FAIL    github.com/kcp-dev/kcp/pkg/apis/apis/v1alpha1   0.298s
FAIL

Expected Behaviour

The CEL validation function should be constructed, but for some reason stepping into it all the fields are set to nil. Possibly a bug in our parsing logic?

Additional Context

No response

@nrb nrb added the kind/bug Categorizes issue or PR as related to a bug. label Mar 14, 2023
@nrb nrb changed the title bug: TestAPIExportPermissionClaimNamespace needs to pass CEL validation of PermissionClaims.ResourceSelector.Namespaces not compiling or passing tests Mar 17, 2023
@nrb nrb changed the title CEL validation of PermissionClaims.ResourceSelector.Namespaces not compiling or passing tests bug: CEL validation of PermissionClaims.ResourceSelector.Namespaces not compiling or passing tests Mar 17, 2023
@nrb nrb self-assigned this Mar 17, 2023
@kcp-ci-bot
Copy link
Contributor

Issues go stale after 90d of inactivity.
After a furter 30 days, they will turn rotten.
Mark the issue as fresh with /remove-lifecycle stale.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@kcp-ci-bot kcp-ci-bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 16, 2024
@kcp-ci-bot
Copy link
Contributor

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

/lifecycle rotten

@kcp-ci-bot kcp-ci-bot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
Status: Backlog
Development

No branches or pull requests

2 participants