Alfresco / acs-deployment

Alfresco Content Services containerized deployment (Helm and Docker Compose)

Home Page:https://alfresco.github.io/acs-deployment/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

shazada opened this issue · comments

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 -}}

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

that doesn't looks coming from this repo charts

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.

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

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.

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!

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.