kcp icon indicating copy to clipboard operation
kcp copied to clipboard

feature: Provide a flag similar to -n in openshift to update/view/access/create/delete/edit resource across workspaces in kcp something like a -w/--workspace flag

Open kasturinarra opened this issue 2 years ago • 2 comments

Feature Description

Currently in kcp if a user has to update/view/access/edit/create/delete a resource in another workspace user will have to change the workspace and enter the workspace in which the resource resides to perform the above operations. It would be helpful if a flag similar to -n in openshift is available or user should be able to perform CURD operations via the absolute path of the workspace.

Proposed Solution

Provide an option similar to -n in openshift to create/view/access/edit a resource across workspaces in kcp.

Examples:

$ kubectl get ws -w my-workspace $ kubectl get deployment -w my-kcp-workspace

Or

An absolute path to the workspace where the resource exists.

Examples:

$ kubectl get synctarget <full_path_to_locationworkspace> $ kubectl get deployment <full_path_to_workloadworkspace>

Alternative Solutions

No response

Want to contribute?

  • [ ] I would like to work on this issue.

Additional Context

No response

kasturinarra avatar Jan 17 '23 18:01 kasturinarra

Your examples use -n, -n is already a flag of kubectl, maybe you can suggest -w/--workspace and exemplify in your examples?

xingxingxia avatar Jan 18 '23 01:01 xingxingxia

We can't add flags to kubectl proper, so I don't believe there is a way to achieve this directly there. We could potentially have a wrapper of some sort that adds a --ws/--workspace flag, adjusts the server, and then execs kubectl.

ncdc avatar Jan 19 '23 16:01 ncdc