Closed Boran closed 8 years ago
+1 for this; Right now it seems like I can only tell if an ENV exists or not. I have not been able to figure out any way to do comparisons.
FYI, for anybody that might have a similar issue
{{ if $app.Env.BAMBOO_STICK_SESSION }}
{{ if eq $app.Env.BAMBOO_STICK_SESSION "foobar" }}
# foobar
{{ end }}
{{ end }}
This works. You have to check for the existence of the var prior to comparing it.
Ah, good point! thx.
FYI, for anybody that might have a similar issue THIS ALSO WORKS
{{ if eq (or $app.Env.BAMBOO_STICK_SESSION "some useless value or nothing at all") "foobar" }}
# foobar
{{ end }}
This works. You have to check for the existence of the var prior to comparing it.
what seems to be happening... is that {{ if eq $app.Env.BAMBOO_STICK_SESSION "foobar" }}
if $app.Env.BAMBOO_STICK_SESSION
resolves to undefined then an exception is thrown, however, in my example if the variable is empty or nil then it is assigned the or value.
While trying to add conditional lines to the frontend http-in section of haproxy_template.cfg based on an Env variable from marathon, the following code:
gives "error calling eq: invalid type for comparison"
Searching the net has not been fruitful, any suggestions please?