Commit Graph

8 Commits

Author SHA1 Message Date
ithrael b7a900337d fix(kubectl): delete pod declare no controllor note
Kubernetes-commit: c7549fe340dfa3c038addf84e61f7a923c6e39d5
2023-08-24 23:51:14 +08:00
W. Trevor King 5ff8356c5b kubectl drain: Generic "declare a controller" message
When it initially landed in kubernetes/kubernetes@c6e9ad066e (Initial
node drain implementation for #3885, 2015-08-30,
kubernetes/kubernetes#16698), the drain logic looked in a created-by
annotation for recognized kinds [1], so listing the set of recognized
kinds was a clear approach.

Sometime later, the source moved into ownerReferences, but the
hard-coded set of recognized controller kinds remained.

When kubernetes/kubernetes@2f1108451f (Remove hard-coded
pod-controller check, 2017-12-05, kubernetes/kubernetes#56864) removed
the hard-coded set of recognized controller kinds, it should have also
updated these messages to remove stale references to the previous
hard-coded values.  This commit catches the message strings up with
that commit.

[1]: c6e9ad066e (diff-211259b8a8ec42f105264c10897dad48029badb538684e60e43eaead68c3d219R216)

Kubernetes-commit: 587f4f04cc5fc18f4e85ed6a4a06bbf1bfee0496
2022-02-23 16:26:59 -08:00
rkilingr 1d4a9f61b6 Provides capacity for make slice
* Providing capacity for slice decreases memory allocations performed

Kubernetes-commit: dfe29ae7f84dccb3a989ed1f5d73bde3f58d4ed8
2021-01-31 20:56:11 +05:30
Douglas Schilling Landgraf 56ea9621b7 kubectl: deprecate --delete-local-data
The option --delete-local-data according with users is not clear.
This patch deprecate --delete-local-data in favor of --delete-emptydir-data.

Reference:
https://github.com/kubernetes/kubernetes/issues/80228

Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>

Kubernetes-commit: 625e47aaa2769d221c59e5b9b05b4ac97212719b
2020-09-25 17:33:45 -04:00
Michael Gugino a28f944c90 kubectl/drain add support for custom pod filters
Currently, there is no way to supply custom pod filters to
exclude pods meeting arbitrary criteria when using drain
as a library.

This commit adds the ability for developers to add custom
filters to the drain operation when utilizing drain
as a library.

This commit exports certain types that were previously
private to allow for better code reuse.

This commit also adds appropriate unit tests.

Kubernetes-commit: 85004f030dc3dceb9d15f41fdd607545758d5da2
2020-02-18 19:15:07 -05:00
Mike Danese 71d8052cb0 generated: run refactor
Kubernetes-commit: 3aa59f7f3077642592dc8a864fcef8ba98699894
2020-02-07 18:16:47 -08: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
Sean Sullivan 200ba9edb8 Move pkg/kubectl/drain to staging
Kubernetes-commit: eaea71cf8449a804c762b96f6d278064c0926ae4
2019-07-24 21:10:54 -07:00