Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix fsfreeze_info looking for PVCs in wrong namespace #159

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def _determine_fsfreeze_info(pvc_namespace: str, pvc_name: str, image: str) -> T
service_account_namespace = benji.k8s_tools.kubernetes.service_account_namespace()
if hasattr(pvc.metadata,
'annotations') and FSFREEZE_ANNOTATION in pvc.metadata.annotations and pvc.metadata.annotations[FSFREEZE_ANNOTATION] == 'yes':
pods = core_v1_api.list_namespaced_pod(service_account_namespace, watch=False).items
pods = core_v1_api.list_namespaced_pod(pvc_namespace, watch=False).items
for pod in pods:
if pv_fsfreeze:
break
Expand All @@ -57,8 +57,7 @@ def _determine_fsfreeze_info(pvc_namespace: str, pvc_name: str, image: str) -> T
break

if pv_fsfreeze:
pods = core_v1_api.list_namespaced_pod(benji.k8s_tools.kubernetes.service_account_namespace(),
label_selector=FSFREEZE_POD_LABEL_SELECTOR).items
pods = core_v1_api.list_namespaced_pod(service_account_namespace, label_selector=FSFREEZE_POD_LABEL_SELECTOR).items

if not pods:
logger.error('No fsfreeze pods found (label selector {FSFREEZE_POD_LABEL_SELECTOR}).')
Expand Down