Commit Graph

2529 Commits (92cb90fc5d118ed5c892f425ed1ded5290894db5)

Author SHA1 Message Date
Kubernetes Submit Queue 9adbbf2324 Merge pull request #34587 from resouer/stringflag
Automatic merge from submit-queue

Merge string flag into util flag

Continuing my work on https://github.com/kubernetes/kubernetes/issues/15634

This refactoring is expected to be completely finished and then I will add a verify scripts in `hack`
2016-10-14 04:22:11 -07:00
Angus Salkeld ea1063a263 Assign options.Err in "set image"
There is a usage of options.Err in a Printf, but this option is never set.
This patch passes the stderr into the command and assigns the option correctly.
2016-10-14 11:17:03 +10:00
Kubernetes Submit Queue 786cc3ef6c Merge pull request #32142 from juanvallejo/jvallejo_bugfix/remove-compinit-call-zsh-completions
Automatic merge from submit-queue

remove call to compinit in zsh completion output

**Release note**:
```release-note
release-note-none
```

Fixes: https://github.com/kubernetes/kubernetes/issues/32029
Fixes:
https://github.com/kubernetes/kubernetes/issues/27538#issuecomment-238574035

The zsh completion output makes a call to "compinit" which causes the
zsh completion system to re-initialize every time `<root_cmd> completion zsh`
is sourced, overwriting any settings already applied to other commands.
This in-turn caused other commands' completions to break (such as git,
gcloud, vim) causing an error "function definition file not found" to
be returned any time a tab-completion was attempted.

This patch removes the call to `compinit` in the zsh completion output,
causing no behavioral changes to the existing `completion` command, but
fixing any issues that were caused after sourcing its output.
2016-10-13 16:33:09 -07:00
juanvallejo 4bf980967a remove call to compinit in zsh completion output
Fixes: https://github.com/kubernetes/kubernetes/issues/32029
Fixes:
https://github.com/kubernetes/kubernetes/issues/27538#issuecomment-238574035

The zsh completion output makes a call to "compinit" which causes the
zsh completion system to re-initialize every time `<root_cmd> completion zsh`
is sourced, overwriting any settings already applied to other commands.
This in-turn caused other commands' completions to break (such as git,
gcloud, vim) causing an error "function definition file not found" to
be returned any time a tab-completion was attempted.

This patch removes the call to `compinit` in the zsh completion output,
causing no behavioral changes to the existing `completion` command, but
fixing any issues that were caused after sourcing its output.
2016-10-13 16:47:20 -04:00
Kubernetes Submit Queue f2ca99ed2c Merge pull request #32104 from lojies/usededentforcompletion
Automatic merge from submit-queue

Use dedent for completion.go
2016-10-13 10:07:54 -07:00
AdoHe b2280a646a update various commands to adapt the new Factory interface 2016-10-13 21:01:14 +08:00
AdoHe dfae1a27c2 add fake factories for test 2016-10-13 20:57:14 +08:00
AdoHe 593d8e0d7c refactor Factory make it interface 2016-10-13 20:57:14 +08:00
Kubernetes Submit Queue 523fce990a Merge pull request #32781 from lukaszo/ready_ds
Automatic merge from submit-queue

Add ReadyScheduled to DaemonSet status

Fixes #25605

cc @bgrant0607 @mikedanese
2016-10-13 00:25:56 -07:00
Kubernetes Submit Queue b8b7f9ffc0 Merge pull request #32722 from juanvallejo/jvallejo_return-err-on-oc-get-empty-list
Automatic merge from submit-queue

return warning on empty list result in kubectl get

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

The current default behavior of `kubectl get` is to return an empty
output when there are no resources to display. This patch improves
usability by returning a warning through stderr in the case of an empty
list.

##### Before
`$ kubectl get pods`
  - *empty output*

##### After
`$ kubectl get pods`
```
There are no resources to display.
```
2016-10-12 23:48:01 -07:00
Kubernetes Submit Queue 44337ba8c2 Merge pull request #33176 from gluke77/allow-pod-prefix-for-kubectl-exec
Automatic merge from submit-queue

Allow 'pod/' prefix in pod name for 'kubectl exec'

This PR adds ability to provide pod name with 'pod/' prefix for 'kubectl exec' command. Pod names without 'pod/' prefix are still allowed.

Fixes #24225
2016-10-12 10:15:42 -07:00
Illia Khudoshyn ea12b32d6a Allow 'pod/' prefix in pod name for 'kubectl exec'
Fixes #24225

This PR adds ability to provide pod name with 'pod/' prefix for 'kubectl exec' command. Pod names without 'pod/' prefix are still allowed.
2016-10-12 17:42:31 +03:00
Łukasz Oleś 5d2e215652 Add NumberReady to DaemonSet status
Fixes #25605
2016-10-12 15:15:10 +02:00
Kubernetes Submit Queue 3a882072e9 Merge pull request #34279 from ymqytw/refactor_edit
Automatic merge from submit-queue

Refactor kubectl edit cmd

Refactor `kubectl edit` command.

#33250 will be based on this PR for easier review.
Will need to rebase after #33973 merges.
2016-10-12 03:52:39 -07:00
Harry Zhang eb81ef6023 Merge string flag into util flag 2016-10-11 23:28:59 -04:00
Michail Kargakis 75f30ec46f kubectl: add --revision flag in rollout status 2016-10-10 15:04:46 +02:00
m1093782566 fd47b6d4d1 change petset replicas type from int to int32
Change-Id: I0b8c30083e4a221421de46d9d4dcb21b1f5bb36f
2016-10-08 17:13:20 +08:00
Kubernetes Submit Queue 46c009952d Merge pull request #34199 from asalkeld/annotate-label
Automatic merge from submit-queue

Make kubectl label and annotate more consistent

**What this PR does / why we need it**:
This makes the label and annotate cmd files more consistent which should help with code maintenance.

Some of the main changes:
- add dryrun to annotate (can push this in a different PR if requested)
- use Complete(), Validate() and RunX()
- don't place dynamic variables in the options (only user options and args)
- call the NewBuilder() in the Run function.

**Which issue this PR fixes** 
fixes #34151

**Special notes for your reviewer**:
Note: you *can* now diff the two files and the changes make sense.

**Release note**:
```release-note
kubectl annotate now supports --dry-run
```
2016-10-07 23:58:54 -07:00
Kubernetes Submit Queue 882d431f96 Merge pull request #33552 from floreks/kubectl-node-external-ip
Automatic merge from submit-queue

kubectl: Add external ip information to node when '-o wide' is used

<!--  Thanks for sending a pull request!  Here are some tips for you:
1. If this is your first time, read our contributor guidelines https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md and developer guide https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md
2. If you want *faster* PR reviews, read how: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/faster_reviews.md
3. Follow the instructions for writing a release note: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes
-->

**Which issue this PR fixes**: fixes #33457

**Special notes for your reviewer**: 
1. Is it possible to expose multiple external ips on the node?
2. Should this be supported or first one be taken like now? 
3. Should more node address types be shown?

I'll add tests if solution is approved.

**Release note**:
<!--  Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access) 
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
-->
```release-note
kubectl: Add external ip information to node when '-o wide' is used
```
2016-10-07 21:10:27 -07:00
Kubernetes Submit Queue f2016df2cc Merge pull request #34054 from deads2k/testapi-01-remove-default.groupversion
Automatic merge from submit-queue

remove testapi.Default.GroupVersion

I'm going to try to take this as a series of mechanicals.  This removes `testapi.Default.GroupVersion()` and replaces it with `registered.GroupOrDie(api.GroupName).GroupVersion`.

@caesarxuchao I'm trying to see how much of `pkg/api/testapi` I can remove.
2016-10-07 20:30:34 -07:00
David Oppenheimer cd4e08e7ec Revert "Add kubelet awareness to taint tolerant match caculator." 2016-10-07 12:10:55 -07:00
Kubernetes Submit Queue 21188cadeb Merge pull request #26501 from resouer/scheduler
Automatic merge from submit-queue

Add kubelet awareness to taint tolerant match caculator.

Add kubelet awareness to taint tolerant match caculator.

Ref: #25320

This is required by `TaintEffectNoScheduleNoAdmit` & `TaintEffectNoScheduleNoAdmitNoExecute `, so that node will know if it should expect the taint&tolerant
2016-10-07 12:05:35 -07:00
deads2k 518d5500c7 remove testapi.Default.GroupVersion 2016-10-07 10:10:54 -04:00
Kubernetes Submit Queue 8b834dd5c0 Merge pull request #34243 from liggitt/simplify-raw
Automatic merge from submit-queue

Simplify kubectl get --raw

Write to configured output stream
Don't assume output is a string
2016-10-07 06:29:10 -07:00
Mike Danese ea5ecc4145 implement kubectl apply --prune 2016-10-06 17:49:02 -07:00
ymqytw 2af1c03b2a refactor edit cmd 2016-10-06 16:29:09 -07:00
Jordan Liggitt 82a099d92d
Simplify kubectl get --raw 2016-10-06 11:42:19 -04:00
Angus Salkeld 4a09ded01d Make kubectl label and annotate more consistent
Some of the main changes:
- add dryrun to annotate (can push this in a different PR if requested)
- use Complete(), Validate() and RunX()
- don't place dynamic variables in the options (only user options and args)
- call the NewBuilder() in the Run function.

You can now do diff between these files and they are as identical as possible.
2016-10-06 17:17:40 +10:00
Kubernetes Submit Queue 05192d9d57 Merge pull request #33319 from juanvallejo/jvallejo/add-option-to-set-nodeport
Automatic merge from submit-queue

Add option to set a service nodeport

**Release note**:
```release-note
Add kubectl --node-port option for specifying the service nodeport
```

This patch adds the option to set a nodeport when creating a NodePort
service. In case of a port allocation error due to a specified port
being out of the valid range, the error now includes the valid
range. If a `--node-port` value is not specified, it defaults to zero, in
which case the allocator will default to its current behavior of
assigning an available port.

This patch also adds a new helper function in `cmd/util/helpers.go` to
retrieve `Int32` cobra flags.

**Example**
```
# create a nodeport service with an invalid port
$ kubectl create service nodeport mynodeport --tcp=8080:7777 --node-port=1
The Service "mynodeport" is invalid: spec.ports[0].nodePort: Invalid
value: 1: provided port is not in the valid range. Valid ports range
from 30000-32767

# create a nodeport service with a valid port
$ kubectl create service nodeport mynodeport --tcp=8080:7777 --node-port=30000
service "mynodeport" created

# create a nodeport service with a port already in use
$ kubectl create service nodeport mynodeport --tcp=8080:7777 --node-port=30000
The Service "mynodeport" is invalid: spec.ports[0].nodePort: Invalid value: 3000: provided port is already allocated

$ kubectl describe service mynodeport
Name:                   mynodeport
Namespace:              default
Labels:                 app=mynodeport
Selector:               app=mynodeport
Type:                   NodePort
IP:                     172.30.81.254
Port:                   8080-7777       8080/TCP
NodePort:               8080-7777       30000/TCP
Endpoints:              <none>
Session Affinity:       None
No events.
```

@fabianofranz
2016-10-05 15:00:32 -07:00
Kubernetes Submit Queue 87393e1da9 Merge pull request #34106 from kargakis/rollout-status-watch-flag
Automatic merge from submit-queue

kubectl: add watch flag in rollout status

Fixes https://github.com/kubernetes/kubernetes/issues/30627

@kubernetes/kubectl
2016-10-05 13:09:01 -07:00
Kubernetes Submit Queue d4088fc47b Merge pull request #34020 from juanvallejo/jvallejo/allow-empty-annotation-values
Automatic merge from submit-queue

Allow empty annotation values

Related downstream issue: https://github.com/openshift/origin/issues/11175

**Release note**:
```release-note
release-note-none
```

Annotations with empty values can be used, for example, in diagnostics
logging. This patch removes the client-side check for empty values in
an annotation key-value pair.

**Before**
```
$ kubectl annotate pod zookeeper-1 node-selector="" --overwrite
error: invalid annotation format: node-selector=
```

**After**
```
$ kubectl annotate pod zookeeper-1 node-selector="" --overwrite
pod "zookeper-1" annotated
```

```
$ kubectl get po/zookeeper-1 --template='{{.metadata.annotations}}'
map[... node-selector: test-label:test]
```

@fabianofranz @liggitt
2016-10-05 11:48:02 -07:00
juanvallejo a872657371
Allow empty annotation values
Annotations with empty values can be used, for example, in diagnostics
logging. This patch removes the client-side check for empty values in
an annotation key-value pair.

**Before**
```
$ kubectl annotate pod zookeeper-1 node-selector="" --overwrite
error: invalid annotation format: node-selector=
```

**After**
```
$ kubectl annotate pod zookeeper-1 node-selector="" --overwrite
pod "zookeper-1" annotated
```

```
$ kubectl get po/zookeeper-1 --template='{{.metadata.annotations}}'
map[... node-selector: test-label:test]
```
2016-10-05 13:17:08 -04:00
Kubernetes Submit Queue 0798f02391 Merge pull request #33942 from kargakis/sttts-kubectl-run-watch-until
Automatic merge from submit-queue

Switch kubectl to use watch.Until

Squashed version of https://github.com/kubernetes/kubernetes/pull/30235 

@ncdc PTAL

cc: @kubernetes/kubectl
2016-10-05 08:29:54 -07:00
Michail Kargakis 7e972f4cbd kubectl: add watch flag in rollout status 2016-10-05 16:33:06 +02:00
Kubernetes Submit Queue a7f6557f1d Merge pull request #34074 from asalkeld/annotate-local-option
Automatic merge from submit-queue

Add local option to annotate

**What this PR does / why we need it**:
Add the --local option to be both consistent with other commands and so it can be used with "set selector" and "create service".

**Which issue this PR fixes** 
Related: #7296

**Special notes for your reviewer**:
None

**Release note**:
```release-note
Add a new option "--local" to the `kubectl annotate`
```
2016-10-05 07:09:05 -07:00
Kubernetes Submit Queue 776af8e7f6 Merge pull request #33990 from asalkeld/local-option-label
Automatic merge from submit-queue

Add local option to the label command

**What this PR does / why we need it**:
Add the --local option to be both consistent with other commands and so it can be used with  "set selector" and "create service".

**Which issue this PR fixes** 
Related: #7296

**Special notes for your reviewer**:
None

**Release note**:
```release-note
Add a new option "--local" to the `kubectl label`
```
2016-10-05 06:32:13 -07:00
Kubernetes Submit Queue 33103e576e Merge pull request #33639 from guangxuli/k8s_test_helper
Automatic merge from submit-queue

if test succ remove the tmp file
2016-10-05 01:56:18 -07:00
Angus Salkeld 5cb945d672 Add local option to the label command
This is to be used with the new "set selector" command.
2016-10-05 15:45:43 +10:00
Angus Salkeld b86b85dea9 Add local option to annotate 2016-10-05 14:39:56 +10:00
nikhiljindal bbea084375 Enable kubectl describe rs to work when apiserver does not support pods 2016-10-04 13:27:31 -07:00
juanvallejo 7d1461be8e remove unused GetFlagInt32 func 2016-10-04 13:19:24 -04:00
juanvallejo cfbdcec7d6 make portallocator.ErrNotInRange a type 2016-10-04 13:19:24 -04:00
juanvallejo 6b83f89d47 Add option to set a service nodeport
This patch adds the option to set a nodeport when creating a NodePort
service. In case of a port allocation error due to a specified port
being out of the valid range, the error now includes the valid
range. If a `--node-port` value is not specified, it defaults to zero, in
which case the allocator will default to its current behavior of
assigning an available port.

This patch also adds a new helper function in `cmd/util/helpers.go` to
retrieve `Int32` cobra flags.

**Example**
```
$ kubectl create service nodeport mynodeport --tcp=8080:7777 --node-port=1
The Service "mynodeport" is invalid: spec.ports[0].nodePort: Invalid
value: 1: provided port is not in the valid range. Valid ports range
from 30000-32767

$ kubectl create service nodeport mynodeport --tcp=8080:7777 --node-port=30000
service "mynodeport" created

$ oc describe service mynodeport
Name:                   mynodeport
Namespace:              default
Labels:                 app=mynodeport
Selector:               app=mynodeport
Type:                   NodePort
IP:                     172.30.81.254
Port:                   8080-7777       8080/TCP
NodePort:               8080-7777       30000/TCP
Endpoints:              <none>
Session Affinity:       None
No events.
```
2016-10-04 13:19:24 -04:00
Michail Kargakis 40b7fabaf2 kubectl: return exit status appropriately after running watch.Until 2016-10-03 18:54:53 +02:00
bindata-mockuser 5ad518cd2b Switch kubectl to use watch.Until 2016-10-03 17:17:41 +02:00
Ilya Dmitrichenko abc0a98d25
Replace references to http://releases.k8s.io/HEAD/docs/user-guide/ 2016-10-02 11:44:40 +01:00
Kubernetes Submit Queue 6f69293240 Merge pull request #32599 from mikedanese/kubectl-selector
Automatic merge from submit-queue

allow kubectl -f to filter by selector

cc @kubernetes/kubectl

Fixes #32544
2016-10-01 01:13:09 -07:00
Kubernetes Submit Queue f9dd76564c Merge pull request #33686 from ymqytw/format_json_printer_for_runtime.Unknown
Automatic merge from submit-queue

formatting json printer for runtime.Unknown

Formatting JSONPrinter.
It prints everything in one single line before.
Now it prints in well-formatted way.
2016-09-30 06:13:17 -07:00
Mike Danese 5f2569c16d allow kubectl -f to filter by selector 2016-09-30 00:42:35 -07:00
ymqytw d74704254d formatting json printer for runtime.Unknown 2016-09-29 08:45:08 -07:00