dsaiztc commented on a change in pull request #6523:
URL: https://github.com/apache/airflow/pull/6523#discussion_r422708666



##########
File path: airflow/contrib/operators/kubernetes_pod_operator.py
##########
@@ -158,17 +167,17 @@ def execute(self, context):
                 raise AirflowException(
                     'Pod returned a failure: {state}'.format(state=final_state)
                 )
-            if self.xcom_push:
+            if self.do_xcom_push:
                 return result
         except AirflowException as ex:
             raise AirflowException('Pod Launching failed: 
{error}'.format(error=ex))
 
     def _set_resources(self, resources):
-        inputResource = Resources()
-        if resources:
-            for item in resources.keys():
-                setattr(inputResource, item, resources[item])
-        return inputResource
+        return Resources(**resources) if resources else Resources()
+
+    def _set_name(self, name):
+        validate_key(name, max_length=63)

Review comment:
       Sorry, I'm not an expert in Kubernetes.
   
   I was creating the POD names in `KubernetesPodOperator` just concatenating 
the DAG name with the task name and haven't had any issue whatsoever. Suddenly 
when updating Airflow I started to see how many of my DAGs wouldn't be working 
as they didn't pass the newly-added validation.
   
   Might we be confusing the limit on the _labels_ (`63` characters) and the 
_subdomains_ (`253` characters)?
   
   I cannot get a clear view reading the docs:
   - [Object Names and 
IDs](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/)
   - [Identifiers and Names in 
Kubernetes](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/architecture/identifiers.md)
   
   Also the [_unofficial Kubernetes_ mentions a limit of `253` 
characters](https://unofficial-kubernetes.readthedocs.io/en/latest/concepts/overview/working-with-objects/names/).
 
   
   




----------------------------------------------------------------
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:
[email protected]


Reply via email to