<p dir="auto"><strong>What keywords did you search in Kubernetes issues before filing this one?</strong>:</p>
<ul dir="auto">
<li>duplicate volumes</li>
<li>volumes</li>
</ul>
<hr>
<p dir="auto"><strong>Is this a BUG REPORT or FEATURE REQUEST?</strong> (choose one):</p>
<ul dir="auto">
<li>BUG REPORT</li>
</ul>
<p dir="auto">--&gt;</p>
<p dir="auto"><strong>Kubernetes version</strong> (use <code class="notranslate">kubectl version</code>):<br>
Server: v1.3.4<br>
Client: v1.3.0</p>
<p dir="auto"><strong>Environment</strong>:</p>
<ul dir="auto">
<li><strong>Cloud provider or hardware configuration</strong>:</li>
<li>GKE</li>
<li><strong>OS</strong> (e.g. from /etc/os-release):</li>
<li>GKE container-vm  image</li>
<li><strong>Kernel</strong> (e.g. <code class="notranslate">uname -a</code>):</li>
<li><strong>Install tools</strong>:</li>
<li><strong>Others</strong>:</li>
</ul>
<p dir="auto"><strong>What happened</strong>:<br>
When using "source" as volume name in a pod or deployment spec, it fails with the "spec.template.spec.containers[0].volumeMounts[0].name: Not found: "source"".</p>
<p dir="auto"><strong>What you expected to happen</strong>:<br>
kubectl apply -f should not have thrown an error, but deployed the latest volume.</p>
<p dir="auto"><strong>How to reproduce it</strong> (as minimally and precisely as possible):</p>
<ul dir="auto">
<li>Create a pod with at least 2 containers (including init containers)</li>
<li>use an emptyDir volume named "source"</li>
<li>create this pod or deployment</li>
</ul>
<p dir="auto"><strong>Anything else do we need to know</strong>:<br>
When adding a second volume definition with the same name it works.</p>
<p dir="auto">Does not work:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="      - name: source
        emptyDir: {}"><pre lang="volumes:" class="notranslate"><code class="notranslate">      - name: source
        emptyDir: {}
</code></pre></div>
<p dir="auto">Does work:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="      - name: source
        emptyDir: {}
      - name: source
        emptyDir: {}"><pre lang="volumes:" class="notranslate"><code class="notranslate">      - name: source
        emptyDir: {}
      - name: source
        emptyDir: {}
</code></pre></div>
<p dir="auto">Does also work:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="      - name: source2
        emptyDir: {}"><pre lang="volumes:" class="notranslate"><code class="notranslate">      - name: source2
        emptyDir: {}
</code></pre></div>
<p dir="auto">As a sidenote. Applying the duplicate volumes works and getting the yaml from the apiserver actually only returns one volume.</p>
<p dir="auto">We leave tons of dead containers around when kubecfg deletes pods. We should cleanup those dead containers.</p>
<p dir="auto">I have a pending PR for this.</p>