Currently, if user executes `kubectl scale --dry-run`, output has no
indicator showing that this is not applied in reality.
This PR adds dry run suffix to the output as well as more integration
tests to verify it.
Kubernetes-commit: 76ee3788ccbac9003e3f24de9000ebd91c27611f
`kubectl scale` calls visitor two times. Second call fails when
the piped input is passed by returning an
`error: no objects passed to scale` error.
This PR uses the result of first visitor and fixes that piped
input problem. In addition to that, this PR also adds new
scale test to verify.
Kubernetes-commit: 13be899b422a1f68c38e3a9c9d88831db709a32d
Validate function is used to validate command options and should not get
any additional parameter. To preserve compatibility across all
kubectl commands, this PR removes all parameters in validate functions.
Kubernetes-commit: 8fb423bfabe0d53934cc94c154c7da2dc3ce1332
--current-replicas is only meaningful when it's -1 or greater.
Also add an error message to clarify the range of --current-replicas. It
is unclear that --current-replicas=-1 means no precondition. This info
may be useful for programming purposes (i.e., shell scripting, etc.).
Kubernetes-commit: 8fd7862e6974fda28bb91286ca79dc6fa236f2f8
Currently, server-side dry-run fetches the OpenAPI schema for every
single object.
This change fetches the OpenAPI schema only once.
Kubernetes-commit: caa158610dfb53de3582ed6df0eb37359206fc66
vendor/k8s.io/kubectl/pkg/cmd/scale/scale.go:212:2: this value of err is never used (SA4006)
Kubernetes-commit: 5710e1b162ea90a3df2622d09864bf2411eb5fd7