Hello.

Kubernetes generates a unique pod name.
https://github.com/apache/airflow/blob/736a62f824d9062b52983633528e58c445d8cc56/airflow/kubernetes/pod_generator.py#L434-L458
It would be great if the pod name was available in Airflow after completing the task, so that, for example, we could use it to add [extra links](http://airflow.apache.org/docs/apache-airflow/stable/howto/define_extra_link.html) or use it as an argument in downstream tasks. To do this, we should save this name in XCOM table.

The operator for BigQuery works in a similar way.
https://github.com/apache/airflow/blob/736a62f824d9062b52983633528e58c445d8cc56/airflow/providers/google/cloud/operators/bigquery.py#L730
Thanks to this, we have links to the BigQuery console.
https://github.com/apache/airflow/blob/736a62f824d9062b52983633528e58c445d8cc56/airflow/providers/google/cloud/operators/bigquery.py#L600-L605
https://github.com/apache/airflow/blob/736a62f824d9062b52983633528e58c445d8cc56/airflow/providers/google/cloud/operators/bigquery.py#L57-L86

Best regards,
Kamil Breguła


kubernetes_tests/test_kubernetes_pod_operator.py
name="test",
            task_id=name,
            in_cluster=False,
            do_xcom_push=False,
            is_delete_operator_pod=False,
            termination_grace_period=0,
        )
        context = create_context(k)
        with mock.patch(
            "airflow.providers.cncf.kubernetes.utils.pod_launcher.PodLauncher.monitor_pod"
        ) as monitor_mock:
            monitor_mock.return_value = (State.SUCCESS, None)
            k.execute(context)
            name = k.pod.metadata.name
            pod = client.read_namespaced_pod(name=name, namespace=namespace)
            while pod.status.phase != "Failed":
                pod = client.read_namespaced_pod(name=name, namespace=namespace)
        with pytest.raises(AirflowException):
            k.execute(context)
        pod = client.read_namespaced_pod(name=name, namespace=namespace)
        assert pod.metadata.labels["already_checked"] == "True"
        with mock.patch(
            "airflow.providers.cncf.kubernetes"
            ".operators.kubernetes_pod.KubernetesPodOperator"
            ".create_new_pod_for_operator"
        ) as create_mock:
            create_mock.return_value = ("success", {}, {})
            k.execute(context)
            create_mock.assert_called_once()