Commit Graph

2180 Commits (c19a65c0c6c6d72180a1e28a7e49e0f866b881c3)

Author SHA1 Message Date
Kubernetes Submit Queue 4f9c3d52b2 Merge pull request #29163 from lojies/adderr
Automatic merge from submit-queue

add err return

Since err can be returned by previous code,  add err return.
2016-08-02 21:39:39 -07:00
Kubernetes Submit Queue f2a9ba2339 Merge pull request #27392 from sjenning/old-kubectl-watch
Automatic merge from submit-queue

allow watching old resources with kubectl

Right now, one can not watch a resource with kubectl whose resourceVersion is outside the etcd watch window.  Specifying resourceVersion=0 returns the current object, then watches from the current index.

This PR changes the logic to use resourceVersion=0, which will work regardless of the resourceVersion of the object, and discard the first event if --watch-only is specified.

@ncdc @aveshagarwal
2016-08-02 14:44:20 -07:00
k8s-merge-robot 7a62b9c8d1 Merge pull request #29523 from fraenkel/service_names_rfc1035
Automatic merge from submit-queue

Allow service names up to 63 characters (RFC 1035)

fixes #3752
2016-08-02 10:33:16 -07:00
Seth Jennings 461faae367 allow watching old resources with kubectl 2016-08-02 10:28:04 -05:00
Michael Fraenkel b1e7e6cf46 Service names conform to RFC 1035 2016-08-02 08:42:15 -06:00
k8s-merge-robot 0fbd60fa30 Merge pull request #29187 from soltysh/multiversion_kubectl
Automatic merge from submit-queue

Create client from API version passed in config or use default

When creating a client read the `GroupVersion` value passed in the `restclient.Config`. If the passed `GroupVersion` does not match current group or is not enabled fallback to default `GroupVersion` for that group.

This PR should allow accessing `ScheduledJob` properly in `batch/v2alpha1`.

@smarterclayton @deads2k @caesarxuchao @lavalamp ptal
2016-08-02 06:10:26 -07:00
k8s-merge-robot ad0a44ea0b Merge pull request #29823 from alexbrand/config-context-msg
Automatic merge from submit-queue

Fix error msg in kubectl config get-contexts

Fixes #29822
2016-08-02 02:28:42 -07:00
k8s-merge-robot 44ea855713 Merge pull request #28239 from ApsOps/kubectl-expose-headless-svc
Automatic merge from submit-queue

Add a flag for `kubectl expose`to set ClusterIP and allow headless services

- Use `--cluster-ip=None` to create a headless service
- Fixes #10294
2016-08-02 01:18:19 -07:00
k8s-merge-robot 01cd7f326e Merge pull request #29621 from resouer/uuid
Automatic merge from submit-queue

Refactor uuid into its own pkg util/uuid

Continuing my work ref #15634

Anyone can review this if he/she wants.
2016-08-01 22:21:30 -07:00
Daniel Smith b712bfd7ac Revert "Extend all to more resources" 2016-08-01 21:51:57 -07:00
abrand 20ae1b87cc Fix error msg in kubectl config get-contexts 2016-08-01 17:27:15 -04:00
Michal Rostecki 59ca5986dd Print/log pointers of structs with %#v instead of %+v
There are many places in k8s where %+v is used to format a pointer
to struct, which isn't working as expected.

Fixes #26591
2016-08-01 22:27:56 +02:00
k8s-merge-robot ed763b8034 Merge pull request #29419 from wangxing1517/remove_redundant_ToJSON
Automatic merge from submit-queue

Remove redundant ToJSON

<!--
Checklist for submitting a Pull Request

Please remove this comment block before submitting.

1. Please read our [contributor guidelines](https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md).
2. See our [developer guide](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md).
3. If you want this PR to automatically close an issue when it is merged,
   add `fixes #<issue number>` or `fixes #<issue number>, fixes #<issue number>`
   to close multiple issues (see: https://github.com/blog/1506-closing-issues-via-pull-requests).
4. Follow the instructions for [labeling and writing a release note for this PR](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes) in the block below.
-->

ToJSON in pkg/kubectl/resource/visitor.go#ValidateSchema is unnecessary, because "data" will be checked in schema.ValidateBytes [pkg/api/validation/schema.go] shortly.
2016-08-01 10:50:50 -07:00
k8s-merge-robot 95b4572e7c Merge pull request #28955 from dims/roadmap-extend-all
Automatic merge from submit-queue

Extend all to more resources

Added more things from the list here:
https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/cmd.go#L159

Note, did not add events as it did not seem useful to me. Since
this is just a list of messages generated by the system.

Related to a suggestion in issue #22337
2016-08-01 10:07:01 -07:00
Harry Zhang c495397cae Refactor uuid into its own pkg 2016-07-30 00:07:02 -04:00
k8s-merge-robot 96996985a0 Merge pull request #29737 from andreykurilin/fix_kubectl_help_cmd
Automatic merge from submit-queue

Fix kubectl help command

PR 48d47b1027 broke `kubectl help` command due
to wrong check `help for help cmd` .

Fixes #29736
2016-07-28 19:07:55 -07:00
k8s-merge-robot b6b44b2d90 Merge pull request #29652 from lojies/shorthandconfigmaps
Automatic merge from submit-queue

add shorthand cm for configmaps

add shorthand 'cm' for configmaps.
2016-07-28 13:16:57 -07:00
Andrey Kurilin b2f8ee4f12 Fix kubectl help command
PR 48d47b1027 broke `kubectl help` command due
to wrong check `help for help cmd` .

Fixed issue #29736
2016-07-28 17:47:03 +03:00
k8s-merge-robot 5c6c8eb9a6 Merge pull request #29531 from AdoHe/rolling_update_panic
Automatic merge from submit-queue

fix kubectl rolling update empty file cause panic issue

 ```release-note
Fix issue with kubectl panicing when passed files that do not exist.
```

Fix #29398 
@pwittrock @justinsb ptal. This just fix on the cmd layer, I am thinking whether we should return err from marshal&unmarshal if the reader is empty.
2016-07-28 01:54:56 -07:00
k8s-merge-robot 1f9c41dc3a Merge pull request #29495 from xiangpengzhao/fix-defer-fclose
Automatic merge from submit-queue

defer file.Close() in resource_printer.go
2016-07-27 19:19:34 -07:00
lojies 79f09cb687 add shorthand cm for configmaps 2016-07-27 10:54:11 +08:00
Dr. Stefan Schimanski 199f991f6a Add --scopes to kubectl-create-quota and add tests 2016-07-26 14:12:35 +02:00
Maciej Szulik 1e496fd8ce Create client from API version passed in config or use default
When creating a client read the GroupVersion value passed in the
restclient.Config. If the passed GroupVersion does not match current
group or is not enabled fallback to default GroupVersion for that group.
2016-07-26 11:54:25 +02:00
maaz khan 5b95524d65 Add support for kubectl create quota command 2016-07-26 11:32:08 +02:00
AdoHe 0949e08336 fix kubectl rolling update empty file cause panic issue 2016-07-26 02:37:55 -04:00
lojies bf24ff00eb add err return 2016-07-26 08:55:53 +08:00
k8s-merge-robot b4b430bf0d Merge pull request #28833 from tnguyen-rh/fix-docstring
Automatic merge from submit-queue

Fix docstring: Say "flag options" instead of "flag statements"

[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
2016-07-25 16:16:06 -07:00
k8s-merge-robot c29f3238ec Merge pull request #26411 from zefciu/b17542
Automatic merge from submit-queue

Validation logic applied to edited file

The file that is submitted via ``edit`` is now subject to validation
logic as any other file. The validation flags were added to the ``edit``
command.

Fixes:  #17542
2016-07-25 09:18:55 -07:00
Davanum Srinivas ccf4e4d61e Extend all to more resources
Added more things from the list here:
https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/cmd.go#L159

Update the devel/kubectl-conventions.md with the rules mentioned by
a few folks on which resources could be added to the special 'all' alias

Related to a suggestion in issue #22337
2016-07-24 21:14:50 -04:00
xiangpengzhao 236a225060 defer file.Close() in resource_printer.go 2016-07-22 23:24:01 -04:00
Wang Xing 6cabb084c3 Remove redundant ToJSON 2016-07-22 11:28:21 +08:00
Janet Kuo 623a97c685 Use patch when recording commands in kubectl set image 2016-07-21 15:33:34 -07:00
k8s-merge-robot 1cf3f1cf03 Merge pull request #29237 from ncdc/fixup-windows-term
Automatic merge from submit-queue

Fix Windows terminal handling

Fix some issues with Windows terminal handling with respect to TTYs that came up as part of the
code that adds support for terminal resizing.

cc @smarterclayton @sttts @csrwng
2016-07-21 07:24:13 -07:00
Wojciech Tyczynski 4d0d115690 Revert "add tokenreviews endpoint to implement webhook" 2016-07-21 09:40:35 +02:00
deads2k 2c4a9f2e8d interesting changes to add tokenreviews endpoint to implement webhook 2016-07-20 15:11:56 -04:00
Andy Goldstein 77b0547b3d Fix Windows terminal handling
Fix some issues with Windows terminal handling with respect to TTYs that came up as part of the
code that adds support for terminal resizing.
2016-07-20 13:37:14 -04:00
Michal Rostecki 3ed9768a51 Make "attach" and "exec" rejection in proxy more explicit
The more explicit regular expression for rejection makes a
possibility of accessing pods (or any other resources) which
contain "attach" or "exec" in their names via proxy API. It
was not possible before.

Also, the reference for "run" resource was removed, because
it doesn't exist in any of k8s APIs currently.

Fixes: #21464
2016-07-19 20:50:19 +02:00
Michal Fojtik 3095437300 Retry updating deployment only on update conflict error 2016-07-19 13:01:06 +02:00
k8s-merge-robot e72f6a892d Merge pull request #28234 from damemi/record-false-bugfix
Automatic merge from submit-queue

Make sure --record=false is acknowledged when passed to commands

```release-note
Change setting "kubectl --record=false" to stop updating the change-cause when a previous change-cause is found.
```

Ensures that when `--record=false` is explicity set that no `ChangeCauseAnnotation`s are set on the object. Previously, if `--record=true` was used then all following actions triggered a `ChangeCauseAnnotation` even if `--record=false` was set, due to the prior `ChangeCauseAnnotation` existing.

Reference to bug report: https://bugzilla.redhat.com/show_bug.cgi?id=1351127

[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
2016-07-18 11:32:15 -07:00
k8s-merge-robot f50bb73ed6 Merge pull request #26136 from AdoHe/kubectl_apply_overwrite
Automatic merge from submit-queue

kubectl apply add --overwrite flag

```release-note
Add "kubectl --overwrite" flag to automatically resolve conflicts between the modified and live configuration using values from the modified configuration.
```
fixes #17238

This PR just add the `--overwrite` flag, pkg/strategicpatch has already support overwrite. @bgrant0607 @jackgr ptal.
2016-07-18 10:47:53 -07:00
Thien-Thi Nguyen 165363a834 Fix docstring: Say "flag options" instead of "flag statements" 2016-07-18 11:58:40 +02:00
AdoHe ddbd539d1e kubectl apply add --overwrite flag 2016-07-18 00:32:13 -04:00
Davanum Srinivas 2b0ed014b7 Use Go canonical import paths
Add canonical imports only in existing doc.go files.
https://golang.org/doc/go1.4#canonicalimports

Fixes #29014
2016-07-16 13:48:21 -04:00
Mike Dame cfbf7da75b Make sure --record=false is acknowledged when passed to commands 2016-07-15 11:24:05 -04:00
k8s-merge-robot 423106ccee Merge pull request #28512 from smarterclayton/multirestmapper
Automatic merge from submit-queue

Implement a RESTMappings method

With the introduction of batch/v1 and batch/v2alpha1, any
MultiRESTMapper that has per groupversion mappers (as a naive discovery
client would create) would end up being unable to call RESTMapping() on
batch.Jobs. As we finish up discovery we will need to be able to choose
prioritized RESTMappings based on the service discovery doc.

This change implements RESTMappings(groupversion) which returns all
possible RESTMappings for that kind.  That allows a higher level call to
prioritize the returned mappings by server or client preferred version.

@deads2k
2016-07-15 05:13:55 -07:00
Szymon Pyżalski b87ee3dff7 Validation logic applied to edited file
The file that is submitted via edit is now subject to validation
logic as any other file. The validation flags were added to the edit
command.

Fixes: #17542
2016-07-15 13:02:19 +02:00
k8s-merge-robot 98d769cf3d Merge pull request #27943 from ivan4th/refactor-printer-arguments
Automatic merge from submit-queue

Refactor Printer arguments

<!--
Checklist for submitting a Pull Request

Please remove this comment block before submitting.

1. Please read our [contributor guidelines](https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md).
2. See our [developer guide](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md).
3. If you want this PR to automatically close an issue when it is merged,
   add `fixes #<issue number>` or `fixes #<issue number>, fixes #<issue number>`
   to close multiple issues (see: https://github.com/blog/1506-closing-issues-via-pull-requests).
4. Follow the instructions for [labeling and writing a release note for this PR](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes) in the block below.
-->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
Fixes #21260
2016-07-14 08:03:40 -07:00
k8s-merge-robot 50172148e4 Merge pull request #25273 from ncdc/exec-sigwinch
Automatic merge from submit-queue

Support terminal resizing for exec/attach/run

```release-note
Add support for terminal resizing for exec, attach, and run. Note that for Docker, exec sessions
inherit the environment from the primary process, so if the container was created with tty=false,
that means the exec session's TERM variable will default to "dumb". Users can override this by
setting TERM=xterm (or whatever is appropriate) to get the correct "smart" terminal behavior.
```

Fixes #13585
2016-07-14 07:26:49 -07:00
Ivan Shvedunov 5ed881c6c4 Refactor Printer arguments
Fixes #21260
2016-07-14 16:23:02 +03:00
Clayton Coleman c077bac341
Implement a RESTMappings method
With the introduction of batch/v1 and batch/v2alpha1, any
MultiRESTMapper that has per groupversion mappers (as a naive discovery
client would create) would end up being unable to call RESTMapping() on
batch.Jobs. As we finish up discovery we will need to be able to choose
prioritized RESTMappings based on the service discovery doc.

This change implements RESTMappings(groupversion) which returns all
possible RESTMappings for that kind.  That allows a higher level call to
prioritize the returned mappings by server or client preferred version.
2016-07-13 21:18:53 -04:00