mirror of
https://github.com/ansible-collections/kubernetes.core.git
synced 2026-05-07 21:42:38 +00:00
Fix k8s_drain failing when pod has local storage (#295)
Fix k8s_drain failing when pod has local storage SUMMARY The module fails to define the pod_names variable before using it for pods with local storage. Fixes #292 ISSUE TYPE Bugfix Pull Request COMPONENT NAME k8s_drain ADDITIONAL INFORMATION Reviewed-by: Abhijeet Kasurde <None> Reviewed-by: None <None> Reviewed-by: None <None>
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).
|
||||||
@@ -197,6 +197,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