`.locals` do not support go templates?
# atmos
p
.locals
do not support go templates?
pepe: 'go template generated value'
a
did you enable Go templates in
atmos.yaml
?
please share your config, we'll take a look
note that
locals
are experimental, and we know it's not working yet for some cases - we are improving it now and a better implementation will be available in the next release
p
we use go templates
already
but we are in version 1.200.0
and I think this got enhanced later?
I'm trying to do something like this
Copy code
locals:
  pr_number: !env PR_NUMBER
  datastream_name: '{{ if .locals.pr_number }}datastreampr{{ .locals.pr_number }}{{ else }}datastream{{ end }}'
  datamigration_name: '{{ if .locals.pr_number }}datamigrationpr{{ .locals.pr_number }}{{ else }}datamigration{{ end }}'
the go template syntax is way to long so when a user needs templatarize /subscription/xxx/xxx/datastream_name/xxxx/xxx/datastreamname-rg/xxxx/xx the line is huge.
it works but is just unreadable
but since that did not work I tried this
Copy code
settings:
  datastream_name: '{{if (atmos.GomplateDatasource "prnumber")}}datastreampr{{ (atmos.GomplateDatasource "prnumber") }}{{else}}datastream{{end}}'
  datamigration_name: '{{if (atmos.GomplateDatasource "prnumber")}}datamigrationpr{{ (atmos.GomplateDatasource "prnumber") }}{{else}}datamigration{{end}}'
thinking I can put it there
atmos yaml config
Copy code
templates:
  settings:
    enabled: true
    evaluations: 1
    # <https://masterminds.github.io/sprig>
    sprig:
      enabled: true
    # <https://docs.gomplate.ca>
    gomplate:
      enabled: true
      timeout: 5
      # <https://docs.gomplate.ca/datasources>
      datasources:
        prnumber:
          url: "env:/PR_NUMBER"
👀 1