title: Helm: Passing array values through --set
body: <p>i have a cronjob helm chat, i can define many jobs in values.yaml and cronjob.yaml will provision my jobs. I have faced an issue when setting the image tag id in command line, following command throw no errors but it wont update jobs image tag to new one.</p>
  
  <pre><code>helm upgrade cronjobs cronjobs/ --wait --set job.myservice.image.tag=b70d744
  </code></pre>
  
  <p>cronjobs will run with old image tag how can i resolve this?</p>
  
  <p>here is my cronjobs.yaml</p>
  
  <pre><code>{{- $chart_name := .Chart.Name }}
  {{- $chart_version := .Chart.Version | replace "+" "_" }}
  {{- $release_name := .Release.Name }}
  
  {{- range $job := .Values.jobs }}
  ---
  apiVersion: batch/v1beta1
  kind: CronJob
  metadata:
    namespace: "{{ $job.namespace }}"
    name: "{{ $release_name }}-{{ $job.name }}"
    labels:
      chart: "{{ $chart_name }}-{{ $chart_version }}"
  spec:
    concurrencyPolicy: {{ $job.concurrencyPolicy }}
    failedJobsHistoryLimit: {{ $job.failedJobsHistoryLimit }}
    suspend: {{ $job.suspend }}
    jobTemplate:
      spec:
        template:
          metadata:
            labels:
              app: {{ $release_name }}
              cron: {{ $job.name }}
          spec:
            containers:
            - image: "{{ $job.image.repository }}:{{ $job.image.tag }}"
              imagePullPolicy: {{ $job.image.imagePullPolicy }}
              ports:
                - name: http
                  containerPort: 80
                  protocol: TCP
              name: {{ $job.name }}
              args:
  {{ toYaml $job.args | indent 12 }}
              env:
  {{ toYaml $job.image.env | indent 12 }}
              volumeMounts:
              - name: nfs
                mountPath: "{{ $job.image.nfslogpath }}"
            restartPolicy: OnFailure
            imagePullSecrets:
              - name: {{ $job.image.secret }}
            volumes:
              - name: nfs
                nfs:
                  server: "{{ $job.image.server }}"
                  path: "{{ $job.image.nfspath }}"
                  readOnly: false
    schedule: {{ $job.schedule | quote }}
    successfulJobsHistoryLimit: {{ $job.successfulJobsHistoryLimit }}
    {{- end }}
  </code></pre>
  
  <p>here is my values.yaml</p>
  
  <pre><code>jobs:
    - name: myservice
      namespace: default
      image:
        repository: xxx.com/myservice
        tag: fe4544
        pullPolicy: Always
        secret: xxx
        nfslogpath: "/var/logs/"
        nfsserver: "xxx"
        nfspath: "/nfs/xxx/cronjobs/"
        nfsreadonly: false
        env:
      schedule: "*/5 * * * *"
      args:
      failedJobsHistoryLimit: 1
      successfulJobsHistoryLimit: 3
      concurrencyPolicy: Forbid
      suspend: false
  
    - name: myservice2
      namespace: default
      image:
        repository: xxxx/myservice2
        tag: 1dff39a
        pullPolicy: IfNotPresent
        secret: xxxx
        nfslogpath: "/var/logs/"
        nfsserver: "xxxx"
        nfspath: "/nfs/xxx/cronjobs/"
        nfsreadonly: false
        env:
      schedule: "*/30 * * * *"
      args:
      failedJobsHistoryLimit: 1
      successfulJobsHistoryLimit: 2
      concurrencyPolicy: Forbid
      suspend: false
  </code></pre>