Skip to content

[BUG] initHelper setting of values.yaml in opensearch-cluster-3.1.0 #1039

@YeonghyeonKO

Description

@YeonghyeonKO

What is the bug?

# .../templates/cluster.yaml
  {{- with .Values.cluster.dashboards }}
  dashboards:
    {{- omit . "image" | toYaml | nindent 4 }}
    image: {{ .image }}:{{ .version }}
  {{- end }}
  {{- with .Values.cluster.general }}
  general:
    {{- omit . "image" "serviceName" | toYaml | nindent 4 }}
    image: {{ .image }}:{{ .version }}
    serviceName: {{ .serviceName | default $clusterName }}
  {{- end }}
  {{- with .Values.cluster.initHelper }}
  initHelper: {{ . | toYaml | nindent 4 }}
  {{- end }}

In the template, since spec.initHelper doesn't custom image field with version (that is different from spec.dashboards and spec.general), we cannot use the current example of opensearch-cluster-3.1.0/values.yaml chart:

# charts/opensearch-cluster/values.yaml

# initHelper configuration
initHelper:
  imagePullPolicy: "IfNotPresent“
  imagePullSecrets: []
  resources: {}

  # -- initHelper version -> won‘t work!
  version: "1.36"

Proposal

For a quick fix to this issue (without any change in templates), I used an image field in the opensearch-cluster chart and deployed it.

# initHelper configuration
initHelper:
  image: "harbor.abc.com/nexus/docker-mig/library/busybox:1.31.1"
  imagePullPolicy: IfNotPresent

However, if opensearch-k8s-operator follows the principle of specifying the version of image separately like spec.dashboards or spec.general, I would suggest to fix it by:

  {{- with .Values.cluster.dashboards }}
  dashboards:
    {{- omit . "image" | toYaml | nindent 4 }}
    image: {{ .image }}:{{ .version }}
  {{- end }}
  {{- with .Values.cluster.general }}
  general:
    {{- omit . "image" "serviceName" | toYaml | nindent 4 }}
    image: {{ .image }}:{{ .version }}
    serviceName: {{ .serviceName | default $clusterName }}
  {{- end }}
  {{- with .Values.cluster.initHelper }}
    {{- omit . "image" | toYaml | nindent 4 }}
    image: {{ .image }}:{{ .version }}
  {{- end }}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    🆕 New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions