KafkaOtto commented on code in PR #72511:
URL: https://github.com/apache/airflow/pull/72511#discussion_r3966192233


##########
providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/utils/pod_manager.py:
##########
@@ -1270,3 +1283,63 @@ def _emit_container_logs(self, logs: list[str], now: 
DateTime, container_name: s
                 else:
                     level = _parse_log_level(message_to_log)
                     self.log.log(level, "[%s] %s", container_name, 
message_to_log)
+
+    def get_init_container_names(self, pod: V1Pod) -> list[str]:
+        """
+        Return init container names from the pod spec.
+
+        :meta private:
+        """
+        return [container_spec.name for container_spec in 
pod.spec.init_containers or []]

Review Comment:
   Added a test (test_get_init_container_names_when_pod_has_no_init_containers) 
covering the case when pod.spec.init_containers is None. Thanks for the catch!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to