Commit Graph

46 Commits (30fb3be4d29179cf551e3030ade37d94d9acc8c9)

Author SHA1 Message Date
Chao Xu d9920c53a5 move ref.go to its own subpackage 2017-04-13 10:02:43 -07:00
Kubernetes Submit Queue eaf3c47489 Merge pull request #42115 from justinsb/kubectl_expose_drainoptions
Automatic merge from submit-queue (batch tested with PRs 42162, 41973, 42015, 42115, 41923)

kubectl drain: make code reusable

DrainOptions requires a few fields to be set, and the expectation is
that these are set as part of construction of the object.  If they are
set, then the drain code can be reused in other kubernetes projects.

This does not create a contract that DrainOptions should fulfill going
forwards, any more than any of the other types that happen to be exposed
are part of the contract.  Instead, this merely makes use outside the
package possible.

```release-note
NONE
```
2017-02-28 22:06:03 -08:00
Justin Santa Barbara 72afd143c4 kubectl drain: make code reusable
DrainOptions requires a few fields to be set, and the expectation is
that these are set as part of construction of the object.  If they are
set, then the drain code can be reused in other kubernetes projects.

This does not create a contract that DrainOptions should fulfill going
forwards, any more than any of the other types that happen to be exposed
are part of the contract.  Instead, this merely makes use outside the
package possible.
2017-02-26 00:48:48 -05:00
Maru Newby 92d739bebc kubectl: Allow 'drain --force' to remove orphaned pods 2017-02-22 06:59:33 -08:00
deads2k 8a12000402 move client/record 2017-01-31 19:14:13 -05:00
deads2k 502bfdf944 client/restclient/fake move to client-go 2017-01-25 08:29:48 -05:00
Clayton Coleman 9a2a50cda7
refactor: use metav1.ObjectMeta in other types 2017-01-17 16:17:19 -05:00
deads2k 77b4d55982 mechanical 2017-01-16 09:35:12 -05:00
deads2k 6a4d5cd7cc start the apimachinery repo 2017-01-11 09:09:48 -05:00
Maciej Szulik 9f064c57ce Remove extensions/v1beta1 Job 2016-12-17 00:07:24 +01:00
Jordan Liggitt 6819706adf
Pass addressable values to DeepCopy 2016-12-08 14:16:01 -05:00
tanshanshan c76cd49da1 remove redundant condition 2016-12-07 08:39:40 +08:00
Clayton Coleman 3454a8d52c
refactor: update bazel, codec, and gofmt 2016-12-03 19:10:53 -05:00
Clayton Coleman 5df8cc39c9
refactor: generated 2016-12-03 19:10:46 -05:00
ymqytw b358b2df02 make drain retry forever and use new timeout 2016-11-29 14:23:40 -08:00
Clayton Coleman 35a6bfbcee
generated: refactor 2016-11-23 22:30:47 -06:00
ymqytw b73fae6c55 Fix kubectl drain for statefulset and use eviciton for drain if possible 2016-11-07 16:13:06 -08:00
Kubernetes Submit Queue 1ff0b422a8 Merge pull request #35664 from ymqytw/update_drain_test
Automatic merge from submit-queue

Update drain test

Update how int convert to string in the kubectl drain test.
It is safer to use `strconv.Itoa()` than `string()`.
2016-10-30 04:30:18 -07:00
Chao Xu fd2fdfba89 move client/unversioned/fake to client/restclient/fake 2016-10-29 14:22:02 -07:00
ymqytw 08d4d8dba5 Update drain test 2016-10-26 19:17:05 -07:00
ymqytw 8a2610c6fb fix drain test flake 2016-10-24 09:32:49 -07:00
Kubernetes Submit Queue ad9ee6a50c Merge pull request #34778 from ymqytw/safe_kubectl_drain
Automatic merge from submit-queue

wait until the pods are deleted completely

Drain the pods on a node safely by keeping polling until all pods has been deleted.

```release-note
kubectl drain now waits until pods have been delete from the Node before exiting
```

Fixes: #34782
2016-10-20 04:45:45 -07:00
ymqytw e8fd8d50a5 address comments 2016-10-19 17:09:11 -07:00
ymqytw 55c6116d66 address comments and add tests 2016-10-18 22:55:15 -07:00
ymqytw 3bd3c9570f fix test 2016-10-18 16:01:51 -07:00
Angus Salkeld d58554a647 Move the common test functions from cmd_test.go to cmd/testing/fake.go
This is so that we can use NewAPIFactory() from cmd/set/*test.go
Up until now we would get a import loop error.

This commit also adds a basic unit test case for cmd/set/set_image.go
2016-10-19 08:53:26 +10:00
AdoHe b2280a646a update various commands to adapt the new Factory interface 2016-10-13 21:01:14 +08:00
deads2k 9d43f7e52c convert more command to use a generated clientset 2016-09-12 07:38:34 -04:00
bindata-mockuser 6dcb0c9130 Rectify kubectl error output 2016-08-20 15:58:10 +02:00
Wojciech Tyczynski 7403564366 Remove Codec from ContentConfig. 2016-07-08 13:53:09 +02:00
k8s-merge-robot 739e3dd1b1 Merge pull request #26237 from duglin/UseConstant
Automatic merge from submit-queue

Use `CreatedByAnnotation` constant

A nit but didn't want the strings to get out of sync.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2016-07-01 16:55:39 -07:00
Doug Davis 930332751b Use `CreatedByAnnotation` contant
A nit but didn't want the strings to get out of sync.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2016-06-30 10:12:26 -07:00
David McMahon ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
Matt Liggett d09af4a1d6 Stop 'drain' deleting pods with local storage.
Unless forced with --delete-local-data.  Also a refactoring of the
kubectl drain logic that selects/rejects pods and produces error/warning
messages.
2016-06-08 14:59:03 -07:00
Wojciech Tyczynski 5d046fed41 Fix tests for renegotiation 2016-05-12 08:21:11 +02:00
Maciej Szulik a3b4447305 Move internal types of job from pkg/apis/extensions to pkg/apis/batch 2016-04-25 11:03:54 +02:00
Marc Lough fdf409861a Drain pods created from ReplicaSets 2016-04-15 08:51:40 +01:00
goltermann 32d569d6c7 Fixing all the "composite literal uses unkeyed fields" Vet errors. 2016-03-25 15:25:09 -07:00
Kris e664ef922f Move restclient to its own package 2016-02-29 12:05:13 -08:00
k8s-merge-robot 6c5540baae Merge pull request #20232 from mml/daemonset-warn
Auto commit by PR queue bot
2016-02-05 23:12:51 -08:00
Eric Tune 6133cb1f21 Move extensions.LabelSelector to unversioned.
Move type LabelSelector and type LabelSelectorRequirement from pkg/apis/extensions
This avoids an import loop when Job (and later DaemonSet, Deployment, ReplicaSet)
are moved out of extensions to new api groups.

Also Move LabelSelectorAsSelector utility from pkg/apis/extensions/ to pkg/api/unversioned/
Also its test.
Also LabelSelectorOp* constants.
Also the pkg/apis/extensions/validation functions ValidateLabelSelectorRequirement and
ValidateLabelSelector move to pkg/api/unversioned

The related type in pkg/apis/extensions/v1beta1/ is staying there.  I might move
it in another PR if neccessary.
2016-02-04 13:46:34 -08:00
Matt Liggett f2d5375bc0 Stop deleting DaemonSet pods during drain.
We do this because they will be recreated immediately by the
DaemonSet Controller.  In addition, we also require a specific flag
(--ignore-daemonsets) when there are DaemonSet pods on the node.
2016-02-02 11:13:29 -08:00
Matt Liggett d4b02466b7 Add support for Job-managed pods to drain. 2016-01-28 13:23:12 -08:00
Clayton Coleman 38c7eded99 Prepare for content-type negotiation
Combine the fields that will be used for content transformation
(content-type, codec, and group version) into a single struct in client,
and then pass that struct into the rest client and request. Set the
content-type when sending requests to the server, and accept the content
type as primary.

Will form the foundation for content-negotiation via the client.
2016-01-26 17:44:30 -05:00
Clayton Coleman 33085c0cf2 Update tests to handle codec changes 2016-01-22 13:27:26 -05:00
Matt Liggett c6e9ad066e Initial node drain implementation for #3885.
It cordons (marks unschedulable) the given node, and then deletes every
pod on it, optionally using a grace period.  It will not delete pods
managed by neither a ReplicationController nor a DaemonSet without the
use of --force.

Also add cordon/uncordon, which just toggle node schedulability.
2016-01-06 17:28:18 -08:00