Skip to content

Refer to a loop object? #733

Answered by strowi
strowi asked this question in Q&A
Discussion options

You must be logged in to vote

Ok after a lot of testing i can answer this myself.;)

{
...
  app(name):: {
    local this = self,
    deployment:
      deployment.new(
        name=instance.name,
      )
      + deploy.configMapVolumeMount(this.configMap, '/config.yml', k.core.v1.volumeMount.withSubPath('config.yml'))
  ....
    configMap:
      configMap.new('config-' + instance.name, {
        'config.yml': (importstr 'files/config.yml') % {
          name: instance.name,
        }
      }
   },
  deploys: [$.app(instance) for instance in $._config.app.instances],
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by strowi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant