<p>I´m trying to retrieve some code from gitlab in my yaml.
Unfortunatly the job fails to initalize the pod. I have checked all the logs and it fails with the following message:</p>

<pre><code>0 container "filter-human-genome-and-create-mapping-stats" in pod "create-git-container-5lhp2" is waiting to start: PodInitializing
</code></pre>

<p>Here is the yaml file:</p>

<pre><code>apiVersion: batch/v1
kind: Job
metadata:
  name: create-git-container
  namespace: diag
spec:
  template:
    spec:
      initContainers:
        - name:  bash-script-git-downloader
          image: alpine/git
          volumeMounts:
            - mountPath: /bash_scripts
              name: bash-script-source
          command: ["/bin/sh","-c"]
          args: ["git", "clone", "https://.......@gitlab.com/scripts.git" ]
      containers:
        - name: filter-human-genome-and-create-mapping-stats
          image: myimage
           env:
             - name: OUTPUT
               value: "/output"
          command: ["ls"]
         volumeMounts:
           - mountPath: /bash_scripts
             name: bash-script-source
           - mountPath: /output
             name: output
      volumes:
        - name: bash-script-source
          emptyDir: {}
        - name: output
          persistentVolumeClaim:
            claimName: output
      restartPolicy: Never
</code></pre>

david
<p>If you use <code>bash -c</code>, it expects only one argument. So you have to pass your <code>args[]</code> as one argument. There are ways to do it:</p>

<pre><code>command: ["/bin/sh","-c"]
args: ["git clone https://.......@gitlab.com/scripts.git"]
</code></pre>

<p>or</p>

<pre><code>command: ["/bin/sh","-c", "git clone https://.......@gitlab.com/scripts.git"]
</code></pre>

<p>or</p>

<pre><code>args: ["/bin/sh","-c", "git clone https://.......@gitlab.com/scripts.git"]
</code></pre>

<p>or</p>

<pre><code>command:
- /bin/sh
- -c
- |
  git clone https://.......@gitlab.com/scripts.git
</code></pre>

<p>or</p>

<pre><code>args:
- /bin/sh
- -c
- |
  git clone https://.......@gitlab.com/scripts.git
</code></pre>
