Commit Graph

13 Commits

Author SHA1 Message Date
Mike Danese 71d8052cb0 generated: run refactor
Kubernetes-commit: 3aa59f7f3077642592dc8a864fcef8ba98699894
2020-02-07 18:16:47 -08:00
Michael Gugino a17d91f9f5 kubectl: remove unreachable code
This code cannot be reached and causes some external linters
to fail.

Kubernetes-commit: 46fd8fce45cfbbe5681a44872602da6daea80cf6
2019-10-23 11:20:40 -04:00
Michael Gugino ebda9f6262 kubectl/drain: add option skip-wait-for-delete-timeout
Currently, some circumstances may cause waitForDelete to
never succeed after the pod has been marked for deletion.
In particular, Nodes that are unresponsive and have
pods with local-storage will not be able to
successfully drain.

We should allow drain to ignore pods that have a
DeletionTimestamp older than a user-provided age.
This will allow controllers utilizing kubectl/drain
to optionally account for a pod that cannot be
removed due to a misbehaving node.

Kubernetes-commit: da53044abdf8c8a9771a5c3dfd861f0c4ec78c40
2019-11-23 20:00:06 -05:00
Sally O'Malley 6d309ed99e When running `kubectl drain` in dry-run, list warnings and pods that would be deleted.
Kubernetes-commit: 909300b8be909c48a68900c407de03be95555409
2019-09-12 14:31:09 -04:00
Michael Gugino feccbe3c28 kubectl/drain: add disable-eviction option
Currently, if eviction is supported during a drain operation,
eviction is always used.

This commit allows the user to specify disabling eviction.
This is particularly useful when you wish to ignore
PodDisruptionBudgets after a normal drain has failed for
some time.

Kubernetes-commit: 6c1d587d5142b95e6c169a198a086332a7e4d8ad
2019-11-23 11:18:52 -05:00
Michael Gugino fe592e7f80 kubectl/drain: Add context support
This commits allows specifying a context.Context
in the Helper type. This context is utilized to
cancel waitForDelete.

Kubernetes-commit: 8682e902f5487e04b893da7230125db0d7ae66b4
2019-11-23 13:58:59 -05:00
Ted Yu eb7c1bf189 Only put un-filtered pod in podDeleteList
Kubernetes-commit: 65c2f61806468d25795516d6077ce0c31c83adcd
2019-10-30 09:55:34 -07:00
ritho b0cd1c2290 Do some Kubectl optimizations suggested by the golangci linter
The tool golangci-lint gives a bunch of warnings. This PR solves the easier/less controversial ones, so the code is simpler and a little bit more optimal, since it removes some if conditions.

Kubernetes-commit: cd2adbe760641f844d84d411f9adcf17fb6982ff
2019-06-04 01:25:43 -05:00
Michael Gugino ff5adba11b Add timeout info to kubectl drain logging
Kubernetes-commit: 0088a9e6a8c47b2710fc49b82a912861cda8a554
2019-10-21 15:21:26 -04:00
Michael Gugino e09feee202 kubectl drain: avoid leaking goroutines
Recently, kubectl drain has been refactored to be consumeable
as a library.  Currently, if a pod cannot be evicted due
to PDBs, we will leak a goroutine.

This commit ensures the goroutine always exists.

Related-bug: https://github.com/kubernetes/kubernetes/issues/81333

Kubernetes-commit: 0e8998a040efe5dd82592911e739fe2e2258cfa3
2019-10-15 15:24:27 -04:00
Justin SB 75fdf29ade Add tests for newly exposed drain code
Kubernetes-commit: 4bba4449ae41a7889ad29da4bd1704ae8d19d126
2019-08-19 16:22:04 -04:00
Justin SB 3989dccd8b Make drain library more reusable
Move more functionality from the kubectl cmd to a package with
fewer dependencies.

Kubernetes-commit: c74f2f6a72bf6fe2718d1e386e4e08747f34fe7b
2019-07-11 13:28:25 -04:00
Sean Sullivan 200ba9edb8 Move pkg/kubectl/drain to staging
Kubernetes-commit: eaea71cf8449a804c762b96f6d278064c0926ae4
2019-07-24 21:10:54 -07:00