Commit Graph

93 Commits (c582a37cae02b4d1a850e6668ea8ea0a81dcd204)

Author SHA1 Message Date
David Eads 7923a9fd99 snip links to internal clients 2018-08-02 14:53:22 -04:00
David Eads 70417ca150 make template printers a recommended printer 2018-07-03 07:47:17 -04:00
David Eads c85e69aeb9
remove unnecessary factory delegation for RESTClientGetter method 2018-05-28 15:12:41 +02:00
juanvallejo 3895887f5e move scaleClient from factory 2018-05-27 11:07:36 -04:00
Maciej Szulik 383872615d
Remove kubectl reapers 2018-05-25 22:18:05 +02:00
juanvallejo 0d3e85608f move f.Command out of the factory 2018-05-22 13:31:01 -04:00
juanvallejo d1603c9560 move PrintOptions to genericclioptions 2018-05-21 14:59:41 -04:00
David Eads 420dd9bf66 move type setting into an optional layer above normal printing 2018-05-17 17:22:12 -04:00
David Eads 4b36c15872 remove single use, non-polymorphic helpers from factory 2018-05-15 15:05:49 -04:00
Kubernetes Submit Queue 143d3b8824
Merge pull request #63561 from juanvallejo/jvallejo/make-opinionated-print-flags-constructor
Automatic merge from submit-queue (batch tested with PRs 63669, 63511, 63561, 63289). 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>.

remove legacyscheme dep from printFlags

**Release note**:
```release-note
NONE
```

Breaks PrintFlags dependency on legacyscheme
Prerequisite to https://github.com/kubernetes/kubernetes/pull/63402

cc @deads2k @soltysh
2018-05-10 14:25:16 -07:00
juanvallejo 40e52bf07d remove legacyscheme dep from printFlags 2018-05-10 14:51:12 -04:00
David Eads 16d6a6c52f move resource builder to generic options 2018-05-10 14:15:12 -04:00
David Eads 682e028516 stop pretending that we have statically known shortcuts 2018-05-08 08:11:56 -04:00
juanvallejo 5a34e4f594 remove printer helpers 2018-05-07 15:37:55 -04:00
David Eads 9a48066749 update restmapping to indicate fully qualified resource 2018-05-01 16:34:49 -04:00
Maciej Szulik b7d4f15965
Remove Factory from more Run commands 2018-04-30 19:58:54 +02:00
juanvallejo f432ebe262
finish wiring PrintFlags 2018-04-27 21:41:03 +02:00
David Eads ecd9a6be2e final record flag cleanup 2018-04-19 14:56:00 -04:00
David Eads f01e16bb3e remove flags deprecated in 1.5 2018-04-19 08:08:44 -04:00
David Eads 1fec6980b6 segregate job scaling from everything else 2018-04-05 10:24:34 -04:00
p0lyn0mial 3b00b4a86f removes job scaler 2018-04-04 08:23:21 -04:00
Kubernetes Submit Queue 3511f708cb
Merge pull request #60630 from CaoShuFeng/scale_job
Automatic merge from submit-queue. 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>.

remove "scale job" from help info

Remove "scale job" from help info since it's deprecated



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

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```

/assign @deads2k @soltysh
2018-03-06 07:35:44 -08:00
Cao Shufeng 8be9d275b6 remove "scale job" from help info
Remove "scale job" from help info since it's deprecated
2018-03-01 17:00:05 +08:00
Cao Shufeng f0cd1ad04e fix warning info format
Before this change:
```
$ kubectl exec -p nginx-aaaaaaaaaaaaa-67b58bf687-r68b9 ls
-p POD_NAME is DEPRECATED and will be removed in a future version. Use exec POD_NAME instead.bin
boot
dev
...

$ kubectl scale --replicas=2 job/pi
kubectl scale job is DEPRECATED and will be removed in a future version.job.batch "pi" scaled
```

After this change:
```
$ kubectl exec -p nginx-aaaaaaaaaaaaa-67b58bf687-r68b9 ls
-p POD_NAME is DEPRECATED and will be removed in a future version. Use exec POD_NAME instead.
bin
boot
dev
...

$ kubectl scale --replicas=2 job/pi
kubectl scale job is DEPRECATED and will be removed in a future version.
job.batch "pi" scaled
```
2018-03-01 16:39:31 +08:00
Kubernetes Submit Queue d4acd6b997
Merge pull request #58283 from nikhita/kubectl-scale-unstructured
Automatic merge from submit-queue (batch tested with PRs 59463, 59719, 60181, 58283, 59966). 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>.

kubectl scale: support Unstructured objects

Support `Unstructured` objects with kubectl scale.

So that we can use the scale subresource for custom resources (possible after https://github.com/kubernetes/kubernetes/pull/55168 is merged):

```
➜ cluster/kubectl.sh scale --replicas=5 crontabs/my-new-cron-object
crontab "my-new-cron-object" scaled
```

**Release note**:

```release-note
NONE
```

/cc sttts deads2k p0lyn0mial
2018-02-23 00:34:30 -08:00
Kubernetes Submit Queue 39c7e9242b
Merge pull request #60139 from soltysh/deprecate_scale_job
Automatic merge from submit-queue. 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>.

Deprecate kubectl scale job

**What this PR does / why we need it**:
With the generic scaler (https://github.com/kubernetes/kubernetes/pull/58298) the only problem is job and as discussed in https://github.com/kubernetes/kubernetes/pull/58468#issuecomment-360794229 and during SIG CLI we've agreed that scaling jobs was a mistake we need to revert. 
This PR deprecates scale command for jobs, only. 

/assign @deads2k @pwittrock 

**Release note**:
```release-note
Deprecate kubectl scale jobs (only jobs). 
```
2018-02-22 01:29:30 -08:00
Maciej Szulik 0bf2561898
Deprecate kubectl scale job 2018-02-21 22:31:15 +01:00
David Eads be04e7c1b1 collapse printing paths 2018-02-21 08:15:22 -05:00
juanvallejo beb5ea641a
remove mapper dependency - PrintSuccess 2018-02-07 10:10:45 -05:00
Nikhita Raghunath 5cdd4dcbd5 kubectl scale: support Unstructured objects 2018-01-15 17:01:45 +05:30
Di Xu 1c715d51c4 some code change
fix wrong required flags

disable the addition of [flags] to the usage, use customized useline

fix function rename
2017-12-25 16:23:38 +08:00
Clayton Coleman 8f4b6c8771
All commands must declare Unstructured or Internal
Callers must take a dependency on one or the other set of conversions
and default client behavior. Future changes may add a Versioned() type,
but this is an accurate reflection of current code state.
2017-11-19 20:41:02 -05:00
juanvallejo 701d6536a2
move cmd/util/printing.go#PrintSuccess to factory_builder.go 2017-11-15 10:46:39 -05:00
Di Xu 057b7bf767 rename selector to labelSelector 2017-11-06 14:30:20 +08:00
Kubernetes Submit Queue 1b93686fe3 Merge pull request #51021 from zjj2wry/scale-selector-all
Automatic merge from submit-queue (batch tested with PRs 51021, 53225, 53094, 53219). 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>.

"fix issue(#49965)kubectl scale also says that it can work based on a label selector or all"

**What this PR does / why we need it**:
Fixes #49965 #44800

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-09-29 12:38:17 -07:00
juanvallejo 90d76adb4b
add Local and Unstructured builder attributes
Moves DisabledClientMapperForMapping wrapper to new Local attribute.
Removes Factory#NewUnstructuredBuilder in favor of new Unstructured
builder attribute.
2017-09-05 11:57:00 -04:00
zhengjiajin a24be450b2 fix issue(49965)kubectl scale also says that it can work based on a label selector or all 2017-08-23 17:09:36 +08:00
ymqytw b776df8a20 move i18n to kubectl/util 2017-08-16 12:27:36 -07:00
Alexander Campbell 6fd36c10ad kubectl/cmd: many small refactors
* Rename variables and functions to match Go convention.
   For example, UsageError --> UsageErrorf.
 * Remove redundant or unreachable code.
 * Simplify some utility functions (no functionality changes).
 * Fix hanging 'if { return } else { return }' constructs.
 * Fix several incorrect printf verbs.
2017-06-27 16:25:20 -07:00
Kubernetes Submit Queue ff108258bb Merge pull request #46220 from superbrothers/add-statefulset
Automatic merge from submit-queue (batch tested with PRs 47776, 46220, 46878, 47942, 47947)

Add statefulset to the completion candidates of kubectl scale

**What this PR does / why we need it**: This commit adds `statefulset` to the completion candidates of kubectl scale.
```
$ kubectl scale <tab>
deployment             job                    --replicas             replicaset             replicationcontroller  statefulset
```

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes kubernetes/kubectl#14

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-06-24 04:15:50 -07:00
juanvallejo d036686185
fix --local flag for `kubectl set` commands 2017-06-13 12:57:05 -04:00
Kazuki Suda feb8148796 Add statefulset to the completion candidates of kubectl scale 2017-05-23 21:17:33 +09:00
Alexander Campbell 9e7f29c3fb cmd: fix deprecation warning bug
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 scale [...]

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

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.
2017-05-18 16:48:13 -07:00
bruceauyeung ab4029c85b Signed-off-by: bruceauyeung <ouyang.qinhua@zte.com.cn>
rename variables to make sure that they conform to golang variable name convention
2017-04-25 15:07:01 +08:00
Brendan Burns 79f51923d3 Extract a bunch more strings from kubectl 2017-04-06 20:12:50 -07:00
deads2k 8895f314b4 move category expansion out of restmapper 2017-03-27 13:54:05 -04:00
xilabao 131802a5cd add secret flag to options 2017-02-25 23:40:50 +08:00
Brendan Burns f1de40b448 Extract some flag description strings to be translated. 2017-02-21 22:07:30 -08:00
Brendan Burns d9c4a289a6 Extract strings for translation. 2017-02-06 22:32:01 -08:00
Jordan Liggitt 408a978f26
fix --record to work with unstructured objects 2017-01-26 19:59:27 -05:00