You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Background: While working through some nginx-proxy issues, I found that it doesn't behave nicely if a container publishing the trigger variables isn't connected to any common networks with the proxy. I could solve this with a template update, but that update needs to get and set a variable inside of a loop that can be read outside (to open the location on the the first match in the loop, and to close the location block only if it was opened by a match inside the loop).
Feature request: Modifying a variable isn't supported in the go template language (you can replace it, but only in your current scope, which doesn't help with a loop), so helper functions are needed. Hugo has implemented something very similar with Scratch to solve this problem: https://gohugo.io/extras/scratch/. Adding similar functions to docker-gen would be useful to support more complex templates. Further background on the go template limitation can be seen in this issue: golang/go#10608
(Note, this is only a wishlist for me. I've worked around my original issue by making a unique set of trigger variables per nginx-proxy in my environment.)
The text was updated successfully, but these errors were encountered:
Background: While working through some nginx-proxy issues, I found that it doesn't behave nicely if a container publishing the trigger variables isn't connected to any common networks with the proxy. I could solve this with a template update, but that update needs to get and set a variable inside of a loop that can be read outside (to open the location on the the first match in the loop, and to close the location block only if it was opened by a match inside the loop).
Feature request: Modifying a variable isn't supported in the go template language (you can replace it, but only in your current scope, which doesn't help with a loop), so helper functions are needed. Hugo has implemented something very similar with Scratch to solve this problem: https://gohugo.io/extras/scratch/. Adding similar functions to docker-gen would be useful to support more complex templates. Further background on the go template limitation can be seen in this issue: golang/go#10608
(Note, this is only a wishlist for me. I've worked around my original issue by making a unique set of trigger variables per nginx-proxy in my environment.)
The text was updated successfully, but these errors were encountered: