dbx icon indicating copy to clipboard operation
dbx copied to clipboard

Using include within configuration as yaml file.

Open goldstein0101 opened this issue 2 years ago • 1 comments
trafficstars

Hey, so lets say i have something like this:

include/notifications.yaml
# start of the file, notice the spaces here. This spaces are how many spaces would be required in deployment.yaml.
        email_notifications:
          on_start: [ "email1" ]
          on_success: [ "email2" ]
          on_failure: [ "email3" ]

deployment.yaml
      - name: "workflow_name"
        job_clusters:
          - job_cluster_key: "cluster_key"
{% include 'include/notifications.yaml' %}
       tasks: ...

So the only way that i can deploy with include inside yaml files is when i include spaces in include files, while i put include statements in deployment.yaml without indendtation. Can u test this out? Since i would like to use something like this, i mean i guess everyone would:

include/notifications.yaml
# Now inside include file, i start from beginning without indentation.
email_notifications:
  on_start: [ "email1" ]
  on_success: [ "email2" ]
  on_failure: [ "email3" ]

deployment.yaml
      - name: "workflow_name"
        job_clusters:
          - job_cluster_key: "cluster_key"
       {% include 'include/notifications.yaml' %} # now its on level for a workflow, not at beginning of a yaml file.
        tasks: ...

goldstein0101 avatar Dec 07 '22 23:12 goldstein0101

Hi, does anyone know if this feature will be reviewed? I want to apply DRY principles with my .yaml templates and this option will be awesome.

cristian-rincon avatar Sep 21 '23 20:09 cristian-rincon