kubernetes / kubectl

Issue tracker and mirror of kubectl code
Apache License 2.0
2.88k stars 922 forks source link

`kubectl cp` does not support resource/name format #1325

Open sanmai-NL opened 2 years ago

sanmai-NL commented 2 years ago

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.

k8s-ci-robot commented 2 years ago

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

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](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
k8s-ci-robot commented 2 years ago

@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](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
sanmai-NL commented 2 years ago

See also kubernetes/kubernetes#72104.

pacoxu commented 2 years ago

/sig cli /transfer kubectl

eddiezane commented 1 year ago

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?

sanmai-NL commented 1 year ago

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.

MayukhSobo commented 1 year ago

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

eddiezane commented 1 year ago

@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

rdeepc commented 1 year ago

Hi @eddiezane,

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

Thanks

k8s-triage-robot commented 8 months ago

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

You can:

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

/remove-triage accepted

k8s-triage-robot commented 5 months ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

sanmai-NL commented 5 months ago

/remove-lifecycle stale

k8s-triage-robot commented 4 months ago

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

sanmai-NL commented 4 months ago

/remove-lifecycle rotten

k8s-triage-robot commented 1 month ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

sanmai-NL commented 1 month ago

/remove-lifecycle stale

k8s-triage-robot commented 10 hours ago

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

sanmai-NL commented 8 hours ago

/remove-lifecycle rotten