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

Fix comparison issue #909

Merged
merged 1 commit into from
Jan 2, 2019
Merged

Fix comparison issue #909

merged 1 commit into from
Jan 2, 2019

Conversation

carrodher
Copy link
Contributor

Fixes bitnami/charts#1007:

at <ne .path "/">: error calling ne: invalid type for comparison

This error appears because if a value is unset, it is returned as a nil value, so we need to replace

-{{- if ne .path "/" -}}
+{{- if (.path) and ne .path "/" -}}

@prydonius
Copy link
Contributor

Hmm, that value is set by default. What values are you using that make it unset? I'm wondering if we should be okay requiring that to be set.

@carrodher
Copy link
Contributor Author

Hmm, that value is set by default. What values are you using that make it unset? I'm wondering if we should be okay requiring that to be set.

Using

helm install --name kubeapps --namespace kubeapps bitnami/kubeapps \
   --set ingress.enabled=true \
   --set ingress.certManager=true \
   --set ingress.hosts[0].name=kubeapps.mydomain.com \
   --set ingress.hosts[0].tls=true \
   --set ingress.hosts[0].tlsSecret=kubeapps-tls

as it is indicated in the readme, it doesn't work

Copy link
Contributor

@migmartri migmartri left a comment

Choose a reason for hiding this comment

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

Thanks for the fix!

I always forget that since we are using an array of ingresses you need to put all the fields during overrides.

Out of curiosity, why are we supporting in our charts more than one ingress? Is this something that people have been asking for?

@migmartri migmartri merged commit 3b6a997 into vmware-tanzu:master Jan 2, 2019
Copy link
Contributor

@prydonius prydonius left a comment

Choose a reason for hiding this comment

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

Another option here would have been to update the readme to correctly set path btw, I think it can make sense to error out if that isn't set.

@@ -138,7 +138,7 @@ Trailing / is required for the react app to work
*/}}
{{- define "kubeapps.ingressRewrites" -}}
{{ range .Values.ingress.hosts -}}
{{- if ne .path "/" -}}
{{- if (.path) and ne .path "/" -}}
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like this condition is wrong and is producing the rewrite rule even when path = "/", which ends up causing a redirect loop in Kubeapps. Just checked and the correct way to do this is:

{{- if .path -}}
{{- if ne .path "/" -}}
      rewrite ^({{ .path }})$ $1/ permanent;
{{- end -}}
{{- end -}}

However with #910, we may not need to fix this condition.

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.

3 participants