mirror of
https://github.com/ansible-collections/kubernetes.core.git
synced 2026-05-08 05:52:37 +00:00
[backport/2.2] Fix k8s_drain failing when pod has local storage (#332)
This commit is contained in:
@@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
bugfixes:
|
||||||
|
- k8s_drain - fix error caused by accessing an undefined variable when pods have local storage (https://github.com/ansible-collections/kubernetes.core/issues/292).
|
||||||
@@ -183,6 +183,7 @@ def filter_pods(pods, force, ignore_daemonset):
|
|||||||
|
|
||||||
# local storage
|
# local storage
|
||||||
if localStorage:
|
if localStorage:
|
||||||
|
pod_names = ",".join([pod[0] + "/" + pod[1] for pod in localStorage])
|
||||||
errors.append("cannot delete Pods with local storage: {0}.".format(pod_names))
|
errors.append("cannot delete Pods with local storage: {0}.".format(pod_names))
|
||||||
|
|
||||||
# DaemonSet managed Pods
|
# DaemonSet managed Pods
|
||||||
|
|||||||
Reference in New Issue
Block a user