kcp icon indicating copy to clipboard operation
kcp copied to clipboard

Unable to edit labels on a workspace

Open vidyanambiar opened this issue 3 years ago • 4 comments

Describe the bug I'm unable to edit labels on my workspace.

To Reproduce Steps to reproduce the behavior:

  1. Install kcp plugin using the kcp repo's main branch
  2. Switch context to kcp-unstable (The same behavior was seen on kcp-stable with v0.7.4 as well)
  3. Go to the home workspace kubectl ws '~'
  4. Create a workspace under here kubectl kcp workspace create test-edit
  5. Run k label workspaces/test-edit test-label=test-value to add a new label to it
  6. Or run k label clusterworkspace/test-edit test-label=test-value
  7. Or run k edit workspace test-edit to attempt to edit the workspace and change labels that way

Expected behavior I expect the label to be added to the workspace.

Actual behavior An error indicates that this operation is not allowed.

➜  kcp git:(main) k label workspace/test-edit test-label=test-value
Error from server (MethodNotAllowed): the server does not allow this method on the requested resource
➜  kcp git:(main) k label clusterworkspace/test-edit test-label=test-value
Error from server (Forbidden): clusterworkspaces.tenancy.kcp.dev "test-edit" is forbidden: User "rh-sso:vnambiar-hac" cannot get resource "clusterworkspaces" in API group "tenancy.kcp.dev" at the cluster scope
➜  kcp git:(main) k edit workspace test-edit
error: workspaces.tenancy.kcp.dev "test-editx" could not be patched: the server does not allow this method on the requested resource
You can run `kubectl replace -f /var/folders/4d/rsyg5zds54dcl2jcm67x39cc0000gn/T/kubectl-edit-ca1d6.yaml` to try this update again.

Additional context

k label clusterworkspace/test-edit test-label=test-value -v 6

➜  kcp git:(main) k label clusterworkspace/test-edit test-label=test-value -v 6
I0818 09:30:53.333344    4678 loader.go:379] Config loaded from file:  /Users/vidyanambiar/Documents/hac-stuff/kcp/kcp-kubeconfigs/config
I0818 09:30:53.742203    4678 round_trippers.go:445] GET https://********/clusters/root:users:qs:ie:rh-sso-vnambiar-hac/apis/tenancy.kcp.dev/v1alpha1/clusterworkspaces/test-edit 403 Forbidden in 404 milliseconds
I0818 09:30:53.742498    4678 helpers.go:216] server response object: [{
  "kind": "Status",
  "apiVersion": "v1",
  "metadata": {},
  "status": "Failure",
  "message": "clusterworkspaces.tenancy.kcp.dev \"test-edit\" is forbidden: User \"rh-sso:vnambiar-hac\" cannot get resource \"clusterworkspaces\" in API group \"tenancy.kcp.dev\" at the cluster scope",
  "reason": "Forbidden",
  "details": {
    "name": "test-edit",
    "group": "tenancy.kcp.dev",
    "kind": "clusterworkspaces"
  },
  "code": 403
}]
F0818 09:30:53.742522    4678 helpers.go:115] Error from server (Forbidden): clusterworkspaces.tenancy.kcp.dev "test-edit" is forbidden: User "rh-sso:vnambiar-hac" cannot get resource "clusterworkspaces" in API group "tenancy.kcp.dev" at the cluster scope
goroutine 1 [running]:
[snip]

k label workspace/test-edit test-label=test-value -v 6

➜  kcp git:(main) k label workspace/test-edit test-label=test-value -v 6
I0818 09:34:19.437186    5002 loader.go:379] Config loaded from file:  /Users/vidyanambiar/Documents/hac-stuff/kcp/kcp-kubeconfigs/config
I0818 09:34:19.842434    5002 round_trippers.go:445] GET https://********/clusters/root:users:qs:ie:rh-sso-vnambiar-hac/apis/tenancy.kcp.dev/v1beta1/workspaces/test-edit 307 Temporary Redirect in 398 milliseconds
I0818 09:34:19.888536    5002 round_trippers.go:445] GET https://********/services/workspaces/root:users:qs:ie:rh-sso-vnambiar-hac/apis/tenancy.kcp.dev/v1beta1/workspaces/test-edit 200 OK in 46 milliseconds
I0818 09:34:20.008914    5002 round_trippers.go:445] PATCH https://********/clusters/root:users:qs:ie:rh-sso-vnambiar-hac/apis/tenancy.kcp.dev/v1beta1/workspaces/test-edit?fieldManager=kubectl-label 307 Temporary Redirect in 119 milliseconds
I0818 09:34:20.045618    5002 round_trippers.go:445] PATCH https://********/services/workspaces/root:users:qs:ie:rh-sso-vnambiar-hac/apis/tenancy.kcp.dev/v1beta1/workspaces/test-edit?fieldManager=kubectl-label 405 Method Not Allowed in 36 milliseconds
I0818 09:34:20.045879    5002 helpers.go:216] server response object: [{
  "kind": "Status",
  "apiVersion": "v1",
  "metadata": {},
  "status": "Failure",
  "message": "the server does not allow this method on the requested resource",
  "reason": "MethodNotAllowed",
  "details": {},
  "code": 405
}]
F0818 09:34:20.045902    5002 helpers.go:115] Error from server (MethodNotAllowed): the server does not allow this method on the requested resource
goroutine 1 [running]:
[snip]

vidyanambiar avatar Aug 18 '22 13:08 vidyanambiar

Did we remove update status from the virtual workspace on purpose, @davidfestal ? Do we expect users to be able to e.g. label workspaces?

stevekuznetsov avatar Aug 18 '22 15:08 stevekuznetsov

From the community meeting: sounds like this was just not implemented in the past, we need to figure out what the user should be able to change about a Workspace and what RBAC would allow them to do this. We also need to nail down the user flows that require e.g. labels on Workspace objects.

stevekuznetsov avatar Aug 23 '22 15:08 stevekuznetsov

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 avatar Apr 14 '24 08:04 kcp-ci-bot

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 avatar May 14 '24 08:05 kcp-ci-bot

Rotten issues close after 30d of inactivity. Reopen the issue with /reopen. Mark the issue as fresh with /remove-lifecycle rotten.

/close

kcp-ci-bot avatar Jun 13 '24 08:06 kcp-ci-bot

@kcp-ci-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity. Reopen the issue with /reopen. Mark the issue as fresh with /remove-lifecycle rotten.

/close

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/test-infra repository.

kcp-ci-bot avatar Jun 13 '24 08:06 kcp-ci-bot