Commit Graph

2198 Commits (7f528c67ca17a186d111ae409ab0e63a8068ca00)

Author SHA1 Message Date
Kubernetes Submit Queue a13efbc01a Merge pull request #30070 from deads2k/fix-alias
Automatic merge from submit-queue

replace improper create quota alias

`q` is not a shortname for `resourcequota`, so it shouldn't be an alias for `kubectl create resourcequota`.

@sttts ptal
2016-08-05 02:36:44 -07:00
Kubernetes Submit Queue e7d01097dc Merge pull request #29971 from caesarxuchao/fix-kubectl-rolling-update-with-gc
Automatic merge from submit-queue

[GarbageCollector] Fix kubectl rolling-update to work with GC

This changes the order of the [Rename()](https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/rolling_updater.go#L532) function. After the change, Rename() first deletes the old RC and orphans its pods, then creates the new RC, which will then have a chance to adopt the orphaned pods.

This also fixes the "should support rolling-update to same image" [test](https://github.com/kubernetes/kubernetes/blob/master/test/e2e/kubectl.go#L915) when the garbage collector is on.

Here is the detailed explanation on why the test would have failed:
`kubectl rolling-update` will [rename](https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/rolling_updater.go#L532-L546) the RC. It first creates the an identical RC (including spec.selectors) with the new name, then it deletes the existing RC. When GC is turned on, the newly created RC cannot adopt the existing pod, because it has a controllerRef pointing to the exising RC, so the new RC will create new pods and expect to see the creation. However, the new RC and the old RC have the same selector, so sometimes the old RC, instead of the new RC, has its [expectation lowered](https://github.com/kubernetes/kubernetes/blob/master/pkg/controller/replication/replication_controller.go#L346-L362), the new RC's expectation will stuck forever. The e2e test then times out when executing `kubectl delete newRC`, because there is the new RC will not scale down as its expectation is not fulfilled.

A side-note, we should fix [rm.getPodController()](https://github.com/kubernetes/kubernetes/blob/master/pkg/controller/replication/replication_controller.go#L346) to respect pod's controllerref, that will prevent similar bugs.

Also note that an old version `kubectl rolling-update` will not work with the GC. We cannot fix that.
2016-08-04 20:48:10 -07:00
Kubernetes Submit Queue 7921a9ce67 Merge pull request #25816 from soltysh/scheduledjob_kubectl
Automatic merge from submit-queue

ScheduledJob kubectl

@erictune the last part (kubectl) of the ScheduledJob, as usual builds on top of previous PRs, so only last 2 commits matter (the kubectl one and storage leftovers).

```release-note
* Introducing ScheduledJobs as described in [the proposal](https://github.com/kubernetes/kubernetes/blob/master/docs/proposals/scheduledjob.md) as part of `batch/v2alpha1` version (experimental feature).
```
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
2016-08-04 17:36:07 -07:00
Kubernetes Submit Queue b8dbb3e34a Merge pull request #30045 from lojies/addalias
Automatic merge from submit-queue

add alias for createconfigmap

add Aliases for cmd create configmap.
this is a supplement for [https://github.com/kubernetes/kubernetes/pull/29652]
2016-08-04 16:25:58 -07:00
Kubernetes Submit Queue 8770b2e237 Merge pull request #29319 from juanvallejo/jvallejo_bugfix/single-resource-version-flag
Automatic merge from submit-queue

fix annotate.go single resource check

```release-note
Fix issue with kubectl annotate when --resource-version is provided.
```

When using `kubectl annotate` with a `--resource-version` on a resource, such as `kubectl annotate pod <pod_name> --resource-version=1820 description='myannotation'`, the command fails with the error: `error: --resource-version may only be used with a single resource`.

Upon printing the output of `resources` that the annotate command receives from cli args, it prints: `Resources:[pod <pod_name>]`. In other words, it treats the name of the resource as a second resource. This PR addresses this issue by using the resource builder `Singular` flag to determine if only a single resource was passed.
2016-08-04 13:26:50 -07:00
deads2k 0beca8e6be replace improper create quota alias 2016-08-04 08:02:14 -04:00
Kubernetes Submit Queue c2614aee9a Merge pull request #29500 from lixiaobing10051267/masterFound
Automatic merge from submit-queue

Check all places to break the loop when object found

Check all places to break the loop when object found.
2016-08-03 20:05:15 -07:00
lojies 4426c5fd6f add alias for createconfigmap 2016-08-04 10:35:15 +08:00
Chao Xu 96c84303bd fix kubectl rolling-update when GC is enabled 2016-08-03 15:57:03 -07:00
Kubernetes Submit Queue 207e8836c0 Merge pull request #29921 from andreykurilin/kubectl_typos
Automatic merge from submit-queue

Fix various typos in kubectl
2016-08-03 13:43:32 -07:00
Maciej Szulik b5c68a9015 ScheduledJob kubectl changes 2016-08-03 17:25:37 +02:00
Kubernetes Submit Queue 1ac1865dd7 Merge pull request #29484 from kargakis/fix-scaler-error
Automatic merge from submit-queue

kubectl: notfound errors should not error out

Fixes the flake in https://github.com/kubernetes/kubernetes/issues/28378#issuecomment-234677846

@pwittrock ptal
2016-08-03 03:13:19 -07:00
Kubernetes Submit Queue 24216fe02f Merge pull request #26958 from resouer/util-line
Automatic merge from submit-queue

Refactoring runner resource container linedelimiter to it's own pkg

Continuing my work ref #15634

Anyone is ok to review this fix.
2016-08-03 02:26:12 -07:00
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
Andrey Kurilin 91cace347d Fix various typos in kubectl 2016-08-02 19:51:51 +03: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
Harry Zhang 15d0f5cfd5 Move linedelimiter to it's own pkg
Refactoring resource container
2016-07-29 02:29:26 -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
juanvallejo 1e71359a77 fix annotate.go single resource check 2016-07-27 10:41:05 -04: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
Michail Kargakis 36522378f4 kubectl: notfound errors should not error out 2016-07-24 12:46:38 +02:00
lixiaobing10051267 be8d081539 Check all places to break the loop when object found 2016-07-23 13:49:04 +08: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