ashb commented on a change in pull request #11815:
URL: https://github.com/apache/airflow/pull/11815#discussion_r519897005
##########
File path: airflow/www/views.py
##########
@@ -924,6 +926,55 @@ def rendered(self):
title=title,
)
+ @expose('/rendered-k8s')
+ @auth.has_access(
+ [
+ (permissions.ACTION_CAN_READ, permissions.RESOURCE_DAG),
+ (permissions.ACTION_CAN_READ, permissions.RESOURCE_TASK_INSTANCE),
+ ]
+ )
+ @action_logging
+ def rendered_k8s(self):
+ """Get rendered k8s yaml."""
+ if not settings.IS_K8S_OR_K8SCELERY_EXECUTOR:
+ abort(404)
+ dag_id = request.args.get('dag_id')
+ task_id = request.args.get('task_id')
+ execution_date = request.args.get('execution_date')
+ dttm = timezone.parse(execution_date)
+ form = DateTimeForm(data={'execution_date': dttm})
+ root = request.args.get('root', '')
+ logging.info("Retrieving rendered templates.")
+ dag = current_app.dag_bag.get_dag(dag_id)
+ task = copy.copy(dag.get_task(task_id))
Review comment:
Do we need to copy this?
----------------------------------------------------------------
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]