kubectl icon indicating copy to clipboard operation
kubectl copied to clipboard

`kubectl cp` does not support resource/name format

Open sanmai-NL opened this issue 3 years ago • 25 comments

What would you like to be added?

kubectl cp file.txt default/pod/mypod-0365fce5-b565b9fd9-zjw8h:/tmp/

should work, but it doesn't because of the pod/ resource type in the name.

Why is this needed?

Feature parity, principle of least surprise, consistency, flexibility, suitability for scripting with kubectl get pods -o name. Other subcommands do support this syntax.

sanmai-NL avatar Nov 10 '22 08:11 sanmai-NL

@sanmai-NL: There are no sig labels on this issue. Please add an appropriate label by using one of the following commands:

  • /sig <group-name>
  • /wg <group-name>
  • /committee <group-name>

Please see the group list for a listing of the SIGs, working groups, and committees available.

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.

k8s-ci-robot avatar Nov 10 '22 08:11 k8s-ci-robot

@sanmai-NL: This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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.

k8s-ci-robot avatar Nov 10 '22 08:11 k8s-ci-robot

See also kubernetes/kubernetes#72104.

sanmai-NL avatar Nov 10 '22 09:11 sanmai-NL

/sig cli /transfer kubectl

pacoxu avatar Nov 11 '22 02:11 pacoxu

We don't plan on expanding kubectl cp functionality outside of pod resources. Is there a reason you'd need to use the pod/podname syntax?

eddiezane avatar Dec 07 '22 17:12 eddiezane

We don't plan on expanding kubectl cp functionality outside of pod resources. Is there a reason you'd need to use the pod/podname syntax?

Hi @eddiezane, Please see the Why this is needed section.

sanmai-NL avatar Dec 07 '22 20:12 sanmai-NL

@eddiezane @sanmai-NL Is this still required..I may be interested to work on this.

MayukhSobo avatar Dec 15 '22 05:12 MayukhSobo

@MayukhSobo we would accept a PR that adds this. It may require switching the cp command to use the builder that some of the other commands use. https://github.com/kubernetes/kubernetes/blob/4e785dc7e3ac1d01cedd23a0ed9c4a67dc9c214f/staging/src/k8s.io/kubectl/pkg/cmd/portforward/portforward.go#L304

/tirage accepted /priority backlog /assign @MayukhSobo

eddiezane avatar Jan 04 '23 18:01 eddiezane

Hi @eddiezane,

I am interested in working on this, Is there any option to work on this issue?

Thanks

rdeepc avatar Mar 01 '23 04:03 rdeepc

This issue has not been updated in over 1 year, and should be re-triaged.

You can:

  • Confirm that this issue is still relevant with /triage accepted (org members only)
  • Close this issue with /close

For more details on the triage process, see https://www.kubernetes.dev/docs/guide/issue-triage/

/remove-triage accepted

k8s-triage-robot avatar Feb 29 '24 04:02 k8s-triage-robot