kubernetes/docs
Kubernetes Submit Queue 644a544d62 Merge pull request #46062 from alexandercampbell/correct-deprecation-errors
Automatic merge from submit-queue (batch tested with PRs 46201, 45952, 45427, 46247, 46062)

kubectl: fix deprecation warning bug

**What this PR does / why we need it**:

Some kubectl commands were deprecated but would fail to print the
correct warning message when a flag was given before the command name.

	# Correctly prints the warning that "resize" is deprecated and
	# "scale" is now preferred.
	kubectl resize [...]

	# Should print the same warning but no warning is printed.
	kubectl --v=1 resize [...]

This was due to a fragile check on os.Args[1].

This commit implements a new function deprecatedCmd() that is used to
construct new "passthrough" commands which are marked as deprecated and
hidden.

Note that there is an existing "filters" system that may be preferable
to the system created in this commit. I'm not sure why the "filters"
array was not used for all deprecated commands in the first place.

**Release note**:

```release-note
NONE
```
2017-05-22 20:58:07 -07:00
..
admin run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
api-reference Merge pull request #44899 from smarterclayton/burst 2017-05-22 19:07:09 -07:00
design replace contents of docs/design with stubs 2017-01-11 08:23:44 -05:00
devel PR template: Update links to kubernetes/community repo 2017-03-17 12:23:58 -04:00
getting-started-guides README: Update obsolete link 2017-03-17 12:15:35 -04:00
images Updated for v1.2.0. 2016-03-18 14:20:56 -07:00
man/man1 docs: add new generated docs for deprecated commands 2017-05-22 14:22:48 -07:00
proposals replace contents of docs/proposals with stubs 2016-12-21 21:15:09 -05:00
user-guide Merge pull request #44621 from caarlos0/patch-1 2017-05-11 19:39:40 -07:00
yaml/kubectl docs: add new generated docs for deprecated commands 2017-05-22 14:22:48 -07:00
.generated_docs .generated_docs: update to include "new" commands 2017-05-19 08:56:53 -07:00
api.md fix munge-docs build errors 2016-11-17 16:49:00 +01:00
BUILD Enable auto-generating sources rules 2017-01-05 14:14:13 -08:00
OWNERS Move .generated_docs to docs/ so docs OWNERS can review / approve 2017-02-16 10:11:57 -08:00
README.md fix munge-docs build errors 2016-11-17 16:49:00 +01:00
reporting-security-issues.md Replace out of date security disclosure doc 2017-03-17 10:45:33 -07:00

Kubernetes Documentation: releases.k8s.io/HEAD

Analytics