Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kots repl syntax not taking values #2592

Open
gauravkcldcvr opened this issue Mar 7, 2022 · 3 comments
Open

kots repl syntax not taking values #2592

gauravkcldcvr opened this issue Mar 7, 2022 · 3 comments

Comments

@gauravkcldcvr
Copy link

We have defined two conditions in kots manifest values.yaml that is being used in helm charts, but it is not taking the both the conditions at once, is there any way we can use AND operator in the syntax or can use two conditions one after the another which seems to be not in working, or am I using it wrongly?

Need help regarding this. Thanks in advance!

condition 1:

#     {{repl if ConfigOptionNotEquals "DOMAIN" ""}}
        hosts:
        - repl{{ ConfigOption `DOMAIN` }} 
        tls:
        - hosts:
          - repl{{ ConfigOption `DOMAIN` }}
#     {{repl end}}

condition 2:

#     {{repl if ConfigOptionEquals "SecretName" "true"}}
        tls:
        - secretName: tls-cert
#     {{repl end}}
@sgalsaleh
Copy link
Member

hi @gauravkcldcvr, could you please share the relevant parts of the config yaml file?

@sgalsaleh
Copy link
Member

if you'd like to use an AND operation, you can do something like this

'{{repl and (ConfigOptionNotEquals "DOMAIN" "") (ConfigOptionEquals "SecretName" "true")}}'

if the "SecretName" config option is of type "bool", then you'd wanna use "1"/"0" instead of "true"/"false" https://kots.io/reference/v1beta1/config/#bool

@gauravkcldcvr
Copy link
Author

we have a manifest kots values.yaml file which looks like this below. But it's not taking both of the below conditions at once like mentioned below. Should validate both conditions. Can we not use multiple if blocks one after the another?

  values:
      ingress:
        enabled: true

        annotations: 
          kubernetes.io/ingress.class: nginx
          nginx.ingress.kubernetes.io/ssl-redirect: "{{repl ConfigOptionEquals `tlsEnabled` `true` }}"
          nginx.ingress.kubernetes.io/configuration-snippet: |
            rewrite ^/services/monitor/(.*)$ /$1 break;
            proxy_set_header Authorization "";

#     {{repl if ConfigOptionNotEquals "DOMAIN" ""}}
        hosts:
        - repl{{ ConfigOption `DOMAIN` }} 
        tls:
        - hosts:
          - repl{{ ConfigOption `DOMAIN` }}
#     {{repl end}}

#     {{repl if ConfigOptionEquals "SecretName" "true"}}
        tls:
        - secretName: tls-cert
#     {{repl end}}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants