You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/11/09 09:08:27 UTC

[GitHub] [airflow] ashb commented on a change in pull request #12171: KubernetesPodOperator: use randomized name to get the failure status

ashb commented on a change in pull request #12171:
URL: https://github.com/apache/airflow/pull/12171#discussion_r519651492



##########
File path: airflow/providers/cncf/kubernetes/operators/kubernetes_pod.py
##########
@@ -310,7 +310,7 @@ def execute(self, context) -> Optional[str]:
                 self.log.info("creating pod with labels %s and launcher %s", labels, launcher)
                 final_state, _, result = self.create_new_pod_for_operator(labels, launcher)
             if final_state != State.SUCCESS:
-                status = self.client.read_namespaced_pod(self.name, self.namespace)
+                status = self.client.read_namespaced_pod(self.pod.metadata.name, self.namespace)
                 raise AirflowException(f'Pod returned a failure: {status}')

Review comment:
       ```suggestion
                   raise AirflowException(f'Pod {self.pod.metadata.name} returned a failure: {status}')
   ```
   
   Lets include the name of the pod that failed too




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org