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

Setting database to external is trying to use the capabilities from a dependency Postgresql chart #922

Open
shazada opened this issue May 4, 2023 · 6 comments
Labels
question Further information is requested

Comments

@shazada
Copy link

shazada commented May 4, 2023

I'm using chart:
alfresco-content-services-5.4.0-M2

When setting in the values file
postgresql
enabled: false

--api-versions wgpolicyk8s.io/v1alpha2/PolicyReport --include-crds failed exit status 1: Error: template: alfresco/templates/_capabilites.tpl:15:37: executing "common.capabilities.ingress.apiVersion" at <include "common.capabilities.kubeVersion" .>: error calling include: template: no template "common.capabilities.kubeVersion" associated with template "gotpl" Use --debug flag to render out invalid YAML`

This capabilty comes from:
alfresco-content-services-5.4.0-M2.tgz\alfresco-content-services\charts\postgresql\charts\common\templates_capabilites.tpl

Line 76 i quote:

{{/*
Return the appropriate apiVersion for ingress.
*/}}
{{- define "common.capabilities.ingress.apiVersion" -}}
{{- if .Values.ingress -}}
{{- if .Values.ingress.apiVersion -}}
{{- .Values.ingress.apiVersion -}}
{{- else if semverCompare "<1.14-0" (include "common.capabilities.kubeVersion" .) -}}
{{- print "extensions/v1beta1" -}}
{{- else if semverCompare "<1.19-0" (include "common.capabilities.kubeVersion" .) -}}
{{- print "networking.k8s.io/v1beta1" -}}
{{- else -}}
{{- print "networking.k8s.io/v1" -}}
{{- end }}
{{- else if semverCompare "<1.14-0" (include "common.capabilities.kubeVersion" .) -}}
{{- print "extensions/v1beta1" -}}
{{- else if semverCompare "<1.19-0" (include "common.capabilities.kubeVersion" .) -}}
{{- print "networking.k8s.io/v1beta1" -}}
{{- else -}}
{{- print "networking.k8s.io/v1" -}}
{{- end -}}
{{- end -}}

@gionn
Copy link
Member

gionn commented May 4, 2023

Error: template: alfresco/templates/_capabilites.tpl:15:37

that doesn't looks coming from this repo charts

@gionn gionn added the question Further information is requested label May 4, 2023
@shazada
Copy link
Author

shazada commented May 4, 2023

Error: template: alfresco/templates/_capabilites.tpl:15:37

that doesn't looks coming from this repo charts

I know I've locally copy and pasted that in our own template.

but you can use the current chart and set postgresql to enabled is false an it should throw the same error.

@gionn
Copy link
Member

gionn commented May 4, 2023

we don't call explicitly common.capabilities.kubeVersion anywhere (check if in yours you are calling it) and anyway can't replicate by checkouting tags/v5.4.0-M2 and running:

helm template . --set postgresql.enabled=false --set global.tracking.sharedsecret=secret --set database.external=true

@shazada
Copy link
Author

shazada commented May 5, 2023

Let me see which tag I'm using, i've forked the repo a while ago, maybe i've used another tag.
It's happening in our forked repo:
https://github.com/Contezza/acs-deployment

Here is the reference to the tag where it seems to go wrong.
https://github.com/Alfresco/acs-deployment/blob/v5.4.0-M2/helm/alfresco-content-services/templates/ingress-share.yaml#L3

But i'll checkout the tag again to see if maybe I have made a mistake in our changes.

@gionn
Copy link
Member

gionn commented May 5, 2023

ok, helm errors sometimes never helps.

So it looks like we are using in different ingresses:

apiVersion: {{ template "common.capabilities.ingress.apiVersion" . }}

which is a named template made available via the bitnami common chart which is not a direct dependency of our chart but just a transitive dependency and that's the reason why you are triggering it when disabling in-cluster postgresql.

A quick workaround can be to redefine every ingress apiVersion to apiVersion: networking.k8s.io/v1 which is stable since Kubernetes v1.19 and is probably not going to change soon.

I think in the upcoming major chart version we have already solved this by making sure we always include the bitnami common chart as a direct dependency of alfresco-common chart.

Thanks for reporting it!

@shazada
Copy link
Author

shazada commented May 5, 2023

For now I've copy and pasted both tpl files, _capabilites.tpl & _ingress.tpl to the main chart and that seems to work as a workaround.

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

No branches or pull requests

2 participants