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

Handling Added events #212

Merged
merged 2 commits into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
make_target: [test, tox_integration, tox_docs]
make_target: [test, tox_docs]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
make_target: [test, tox_integration, tox_docs]
make_target: [test, tox_docs]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
Expand Down
9 changes: 5 additions & 4 deletions task_processing/plugins/kubernetes/kubernetes_pod_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,12 +205,13 @@ def __update_modified_pod(self, pod: V1Pod, event: Optional[PodEvent]) -> None:
"""Called during reconciliation and normal event handling"""
pod_name = pod.metadata.name
task_metadata = self.task_metadata[pod_name]
event_type = event["type"] if event else "null"

raw_event = event["raw_object"] if event else None

if pod.status.phase not in SUPPORTED_POD_MODIFIED_EVENT_PHASES:
logger.debug(
f"Got a MODIFIED event for {pod_name} for unhandled phase: "
f"Got a {event_type} event for {pod_name} for unhandled phase: "
f"{pod.status.phase} - ignoring."
)
return
Expand Down Expand Up @@ -319,7 +320,7 @@ def __update_modified_pod(self, pod: V1Pod, event: Optional[PodEvent]) -> None:
and task_metadata.task_state is not KubernetesTaskState.TASK_LOST
):
logger.info(
f"Got a MODIFIED event for {pod_name} with unknown phase, host likely "
f"Got a {event_type} event for {pod_name} with unknown phase, host likely "
"unexpectedly died"
)
self.task_metadata = self.task_metadata.set(
Expand Down Expand Up @@ -357,7 +358,7 @@ def __update_modified_pod(self, pod: V1Pod, event: Optional[PodEvent]) -> None:
)
else:
logger.info(
f"Ignoring MODIFIED event for {pod_name} as it did not result "
f"Ignoring {event_type} event for {pod_name} as it did not result "
"in a state transition",
)

Expand Down Expand Up @@ -388,7 +389,7 @@ def _process_pod_event(self, event: PodEvent) -> None:
elif event["type"] == "DELETED":
self.__handle_deleted_pod_event(event)

elif event["type"] == "MODIFIED":
elif event["type"] in {"MODIFIED", "ADDED"}:
self.__handle_modified_pod_event(event)

else:
Expand Down
Loading