georchestra / helm-georchestra

geOrchestra helm chart
3 stars 6 forks source link

[DB] init configmap's name does not match the name in Values.yaml #48

Open jeanpommier opened 1 year ago

jeanpommier commented 1 year ago

The configmap's name is defined like this: name: {{ include "georchestra.fullname" . }}-database-init When georchestra.fullname, defined in _helpers.tpl will most of the time be of the form .Release.Name-$name

While in the Values.yaml, it is called like this: name: "{{ .Release.Name }}-database-init"

So, there is a mismatch and the database won't start, because it can't find the configmap

jeanpommier commented 1 year ago

I don't think we can get the database subchart to use the georchestra's chart name. So hardcoding it in the values file might be a solution. What do you think of replacing by name: "{{ .Release.Name }}-georchestra-database-init" in the values.yaml file ?

edevosc2c commented 1 year ago

What about changing in https://github.com/georchestra/helm-georchestra/blob/main/templates/database/database-configmap-init.yaml

From:

name: {{ include "georchestra.fullname" . }}-database-init

To:

name: {{ .Release.Name }}-database-init
jeanpommier commented 1 year ago

I'd say it doesn't exactly follow the naming logic, but fine for me

edevosc2c commented 1 year ago

Technical note and answer to this question:

I don't think we can get the database subchart to use the georchestra's chart name.

This is because the bitnami postgresql chart is not aware of the helpers of the georchestra helm chart. It means this can't be done like this because it won't work:

extraVolumes:
      - name: "00-initsql"
        configMap:
          name: "{{ include "georchestra.fullname" . }}-database-init"
edevosc2c commented 1 year ago

I'm letting this issue opened if that's ok. If one day in the future I find a better solution.

jeanpommier commented 1 year ago

Well, an alternative that, for me, would be quite acceptable (and was my first proposal) would be to simply hardcode the chart's name in the dbinit config, in values.yaml:

...
    extraVolumes:
      - name: "00-initsql"
        configMap:
          name: "{{ .Release.Name }}-georchestra-database-init"
...

This is not perfect, but very simple to adjust when changing the default name of the chart