<p>Confused by <code>helm repo add</code> behavior</p>
<pre class="lang-sh prettyprint-override"><code>➜ helm repo add eks https://aws.github.io/eks-charts            
&quot;eks&quot; already exists with the same configuration, skipping

➜ echo $?
0

➜ helm repo add karpenter https://charts.karpenter.sh            
Error: repository name (karpenter) already exists, please specify a different name

✗  echo $?
1
</code></pre>
<p>so in one case this is just stdout message and error = 0, and in the latter it's stderr and error exit code = 1</p>
<p>I thought the behavior should be consistent, but it seems it depends on something else?</p>

DmitrySemenov
<p>try</p>
<pre><code>helm repo list
</code></pre>
<p>I would imagine the return code is different since when you're trying to add eks there is already a helm config with the name <code>eks</code> that points to the same repo that you provided. So even though it cant add it (since its already there) its still considered success since the config for <code>eks</code> is the same as the parameter that you provided.</p>
<p>Whereas <code>karpenter</code> is likely a key that exists in your helm config but it points to a different repo than the parameter that you provided. So it cant add it and that's considered an error</p>
