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

kubectl exec: mark -p option as deprecated in the help output #104

Closed
php-coder opened this issue Oct 25, 2017 · 13 comments · Fixed by kubernetes/kubernetes#66558
Closed
Assignees
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug. sig/cli Categorizes an issue or PR as relevant to SIG CLI. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. type/code-cleanup

Comments

@php-coder
Copy link

php-coder commented Oct 25, 2017

Is this a request for help?:
No

What keywords did you search in Kubernetes issues before filing this one?:
kubectl deprecate


Is this a BUG REPORT or FEATURE REQUEST?:
bug

Kubernetes version (use kubectl version):

$ ./cluster/kubectl.sh version
Client Version: version.Info{Major:"1", Minor:"9+", GitVersion:"v1.9.0-alpha.1.1693+94acd5a076590e-dirty", GitCommit:"94acd5a076590e083df693f08b3b4f17b133165b", GitTreeState:"dirty", BuildDate:"2017-10-25T13:24:02Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"9+", GitVersion:"v1.9.0-alpha.1.1693+94acd5a076590e-dirty", GitCommit:"94acd5a076590e083df693f08b3b4f17b133165b", GitTreeState:"dirty", BuildDate:"2017-10-25T13:24:02Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}

What happened:
-p option of kubectl exec is deprecated:

./cluster/kubectl.sh exec -p nginx -i -t id
W1025 17:16:42.763587    7619 cmd.go:398] -p POD_NAME is DEPRECATED and will be removed in a future version. Use exec POD_NAME instead.
uid=0(root) gid=0(root) groups=0(root)

But it's not marked as deprecated in the help output:

$ ./cluster/kubectl.sh exec -h | grep -e '-p'
  -p, --pod='': Pod name

What you expected to happen:
Option description should mention deprecation or this option should be absent in the help output.

@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Oct 25, 2017
@apelisse apelisse added for-new-contributors good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. sig/cli Categorizes an issue or PR as relevant to SIG CLI. type/code-cleanup labels Oct 25, 2017
@yuexiao-wang
Copy link

I would like to work on it

@apelisse
Copy link
Member

I can't assign it to you, but I greatly appreciate you doing this. I'm looking at your PR right now. Thanks.

@k8s-ci-robot k8s-ci-robot added help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. and removed for-new-contributors labels Dec 15, 2017
@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

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

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Mar 15, 2018
@mengqiy mengqiy removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Mar 16, 2018
@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

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

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jun 14, 2018
@fejta-bot
Copy link

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.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten
/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot 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 Jul 14, 2018
@nikhita
Copy link
Member

nikhita commented Jul 16, 2018

/remove-lifecycle rotten

still relevant

@k8s-ci-robot k8s-ci-robot removed the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Jul 16, 2018
@ksaritek
Copy link

I will have a look the issue

@nikhita
Copy link
Member

nikhita commented Jul 19, 2018

I will have a look the issue

@ksaritek awesome! 🎉

@quasoft
Copy link

quasoft commented Jul 23, 2018

Update on this issue in kubernetes/kubernetes#54629

@ksaritek
Copy link

is that issue relevant to look or is it fixed already?

@apelisse
Copy link
Member

Still looks relevant to me:

~> kubectl version
Client Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.0", GitCommit:"91e7b4fd31fcd3d5f436da26c980becec37ceefe", GitTreeState:"clean", BuildDate:"2018-06-27T20:17:28Z", GoVersion:"go1.10.2", Compiler:"gc", Platform:"linux/amd64"}
...
~> kubectl exec -h
Execute a command in a container.

Examples:
  # Get output from running 'date' from pod 123456-7890, using the first
container by default
  kubectl exec 123456-7890 date
  
  # Get output from running 'date' in ruby-container from pod 123456-7890
  kubectl exec 123456-7890 -c ruby-container date
  
  # Switch to raw terminal mode, sends stdin to 'bash' in ruby-container from
pod 123456-7890
  # and sends stdout/stderr from 'bash' back to the client
  kubectl exec 123456-7890 -c ruby-container -i -t -- bash -il
  
  # List contents of /usr from the first container of pod 123456-7890 and sort
by modification time.
  # If the command you want to execute in the pod has any flags in common (e.g.
-i),
  # you must use two dashes (--) to separate your command's flags/arguments.
  # Also note, do not surround your command and its flags/arguments with quotes
  # unless that is how you would execute it normally (i.e., do ls -t /usr, not
"ls -t /usr").
  kubectl exec 123456-7890 -i -t -- ls -t /usr

Options:
  -c, --container='': Container name. If omitted, the first container in the pod
will be chosen
  -p, --pod='': Pod name
  -i, --stdin=false: Pass stdin to the container
  -t, --tty=false: Stdin is a TTY

Usage:
  kubectl exec POD [-c CONTAINER] -- COMMAND [args...] [options]

Use "kubectl options" for a list of global command-line options (applies to all
commands).

@apelisse
Copy link
Member

apelisse commented Jul 27, 2018

I've just seen the PR from @quasoft so maybe not actually :-/

@apelisse
Copy link
Member

Yeah, this is fixed. Github will close it automatically when the PR merges. Thanks everyone.

k8s-github-robot pushed a commit to kubernetes/kubernetes that referenced this issue Jul 28, 2018
Automatic merge from submit-queue (batch tested with PRs 66593, 66727, 66558). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Mark --pod/-p flag of kubectl exec command as deprecated

**What this PR does / why we need it**:
Marks the `--pod` (`-p` shorthand) flag of kubectl `exec` command as deprecated.
Hides the flag from the help menu, but shows a message when command is executed with this flag.

**Which issue this PR fixes**:
Fixes:  kubernetes/kubectl#104

This is a remake of PR #54629.

**Release note**:
```release-note
Flag --pod (-p shorthand) of kubectl exec command marked as deprecated
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug. sig/cli Categorizes an issue or PR as relevant to SIG CLI. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. type/code-cleanup
Projects
None yet
9 participants