Skip to content

Commit

Permalink
[AIRFLOW-6048] Make K8s Pod Operator's _set_* methods static (#6645)
Browse files Browse the repository at this point in the history
  • Loading branch information
kaxil authored and XD-DENG committed Nov 23, 2019
1 parent e37ec9a commit 09ccf29
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions airflow/contrib/operators/kubernetes_pod_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,11 @@ def execute(self, context):
except AirflowException as ex:
raise AirflowException('Pod Launching failed: {error}'.format(error=ex))

def _set_resources(self, resources):
@staticmethod
def _set_resources(resources):
return [Resources(**resources) if resources else Resources()]

def _set_name(self, name):
@staticmethod
def _set_name(name):
validate_key(name, max_length=63)
return re.sub(r'[^a-z0-9.-]+', '-', name.lower())

0 comments on commit 09ccf29

Please sign in to comment.