-
Notifications
You must be signed in to change notification settings - Fork 38
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
Installing the stack using helm fails: ’,’ should be escaped #29
Comments
Hi @mgrzybek, thanks for raising the issue. Could you share the output of the kubectl command to get podCIDR? |
Hi, The output is: $ kubectl get nodes -o jsonpath='{.items[*].spec.podCIDR}' | tr ' ' ','
10.244.3.0/24,10.244.2.0/24,10.244.5.0/24,10.244.0.0/24,10.244.1.0/24,10.244.4.0/24 Output of my script:
|
TIL you can set multiple values with |
@mgrzybek the fix you raised looks good if you'd like to re-open. |
I think my patch was wrong. The commas were not escaped by Helm interpretor. According to https://stackoverflow.com/questions/48316330/how-to-set-multiple-values-with-helm the right way to write comma-separated lists should look like:
|
I managed to make it work using "join" in deployment.yaml $ git diff
diff --git a/tinkerbell/boots/templates/deployment.yaml b/tinkerbell/boots/templates/deployment.yaml
index 07ba8e2..8b046de 100644
--- a/tinkerbell/boots/templates/deployment.yaml
+++ b/tinkerbell/boots/templates/deployment.yaml
@@ -37,7 +37,7 @@ spec:
{{- end }}
env:
- name: TRUSTED_PROXIES
- value: {{ required "missing trustedProxies" .Values.trustedProxies | quote }}
+ value: {{ join "," .Values.trustedProxies }}
{{- range $i, $env := .Values.env }}
- name: {{ $env.name | quote }}
value: {{ $env.value | quote }}
diff --git a/tinkerbell/hegel/templates/deployment.yaml b/tinkerbell/hegel/templates/deployment.yaml
index 81432b6..eb69e4e 100644
--- a/tinkerbell/hegel/templates/deployment.yaml
+++ b/tinkerbell/hegel/templates/deployment.yaml
@@ -33,7 +33,7 @@ spec:
{{- end }}
env:
- name: HEGEL_TRUSTED_PROXIES
- value: {{ required "missing trustedProxies" .Values.trustedProxies | quote }}
+ value: {{ join "," .Values.trustedProxies }}
{{- range $i, $env := .Values.env }}
- name: {{ $env.name | quote }}
value: {{ $env.value | quote }}
diff --git a/tinkerbell/hegel/values.yaml b/tinkerbell/hegel/values.yaml
index ae6d2b6..1af08fa 100644
--- a/tinkerbell/hegel/values.yaml
+++ b/tinkerbell/hegel/values.yaml
@@ -1,5 +1,5 @@
deploy: true
-trustedProxies: ""
+trustedProxies: []
name: hegel
image: quay.io/tinkerbell/hegel:v0.10.1
imagePullPolicy: IfNotPresent
$ What do you think? |
I think we can change the proxies to arrays, that aligns with the direction we want to take the charts anyway. Could you also update Hegel values and Boots values to reflect them being arrays (just swap out the I think we also still want the |
Hey @mgrzybek, thanks for catching and reporting this! I'm able to get everything deploy successfully without any code changes by using this It seems like we could just update the docs to resolve this? |
@jacobweinstock We can update the docs instead. I still like the idea of transitioning to an array though. It removes the need for the consumer to care about argument formatting and instead focus on formatting YAML, the document they're adjusting. I think this might go hand in hand with some of the other changes we spoke about regarding exposure of configuration in values YAML. What do you think? |
Ah yeah, true. An array does feel like it improves the understand-ability. |
The PR has been closed. Another solution is on the way. |
We found a pattern that works well and is proven out in Boots. This aligns trusted proxy configuration with the approach in Hegel. Closes #29
Following the docs, I ran into this again:
Changing to the alternate syntax @jacobweinstock suggested:
Now that's better :-)
|
Expected Behaviour
The "TL;DR" provided there https://github.com/tinkerbell/charts/blob/main/tinkerbell/stack/README.md#tldr does not work.
Current Behaviour
The given shell command to create the "trusted_proxies" string does not escape the commas.
Possible Solution
The last
tr
command used inkubectl get nodes -o jsonpath='{.items[*].spec.podCIDR}' | tr ' ' ','
should escape the commas.trusted_proxies=$(kubectl get nodes -o jsonpath='{.items[*].spec.podCIDR}' | tr ' ' '\\,')
Steps to Reproduce (for bugs)
helm dependency build stack/
trusted_proxies=$(kubectl get nodes -o jsonpath='{.items[*].spec.podCIDR}' | tr ' ' ',')
helm install stack-release stack/ --create-namespace --namespace tink-system --wait --set "boots.trustedProxies=${trusted_proxies}" --set "hegel.trustedProxies=${trusted_proxies}"
The result:
Context
Your Environment
The text was updated successfully, but these errors were encountered: