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

helm: translate the edgeDNSServer -> edgeDNSServers using a tempate #706

Merged
merged 1 commit into from
Oct 29, 2021

Conversation

jkremser
Copy link
Member

@jkremser jkremser commented Oct 27, 2021

When deploying 0.8.3 with using old value.yaml file, the .Values.k8gb.edgeDNSServer would not be passed correctly to the deployment as env var. (it's basically not read anywhere in the current helm chart and thrown away)

Hiding the ugliness into _helpers.tpl as impl detail

the logic is following:
when edgeDNSServers is set in values.yaml or using --set .., then these values are being used, otherwise edgeDNSServer is tried

edit: if edgeDNSServers contains only one entry with "1.1.1.1" (default value coming from our values.yaml) and the edgeDNSServer is not empty, then edgeDNSServer wins

some examples:

# simulating using outdated custom value file (translation done properly, even if the 1.1.1.1 was coming from the defaults)
helm template .  --set k8gb.edgeDNSServer=1.1.1.2 | grep EDGE_DNS_SERVERS -A1
            - name: EDGE_DNS_SERVERS
              value: 1.1.1.2

# if not specified, using the 1.1.1.1 from defaults values.yaml bundled w/ the chart
helm template . | grep EDGE_DNS_SERVERS -A1
            - name: EDGE_DNS_SERVERS
              value: 1.1.1.1

# suggested usage - using the new option and forgot the old one
helm template .  --set k8gb.edgeDNSServers={1.1.1.2} | grep EDGE_DNS_SERVERS -A1
            - name: EDGE_DNS_SERVERS
              value: 1.1.1.2

# hybrids
helm template .  --set k8gb.edgeDNSServer=1.1.1.3 --set k8gb.edgeDNSServers={1.1.1.2} | grep EDGE_DNS_SERVERS -A1
            - name: EDGE_DNS_SERVERS
              value: 1.1.1.2

helm template .  --set k8gb.edgeDNSServer=1.1.1.3 --set k8gb.edgeDNSServers={1.1.1.1} | grep EDGE_DNS_SERVERS -A1
            - name: EDGE_DNS_SERVERS
              value: 1.1.1.3

helm template .  --set k8gb.edgeDNSServer=1.1.1.3 --set k8gb.edgeDNSServers="{1.1.1.1,1.2.3.4}" | grep EDGE_DNS_SERVERS -A1
            - name: EDGE_DNS_SERVERS
              value: 1.1.1.1,1.2.3.4

Signed-off-by: Jirka Kremser [email protected]

kuritka
kuritka previously approved these changes Oct 27, 2021
Copy link
Contributor

@somaritane somaritane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, @jkremser !

Copy link
Collaborator

@k0da k0da left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jkremser jkremser merged commit 9076d28 into k8gb-io:master Oct 29, 2021
@jkremser jkremser deleted the helm-compat branch October 29, 2021 13:12
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

Successfully merging this pull request may close these issues.

5 participants