<p>I'm doing a very simple chart with helm. 
It consists on deploying a chart with just one object ("/templates/pod.yaml"), that have to be deployed just if a  parameter of file Values.yaml is true. 
To provide an example of my case, this is what I have:</p>

<p><strong>/templates/pod.yaml</strong></p>

<pre><code>{{- if eq .Values.shoudBeDeployed true }}
apiVersion: v1
kind: Pod
metadata:
  name: nginx
  labels:
    name: nginx
spec:
  containers:
  - name: nginx
    image: nginx
    ports:
    - containerPort: 80
{{- end}}
</code></pre>

<p><strong>Values.yaml</strong></p>

<pre><code>shoudBeDeployed: true
</code></pre>

<p>So when I use shoudBeDeployed with <code>true</code> value, helm installs it correctly. </p>

<p>My problem is that when shoudBeDeployed is <code>false</code>, helm doesn't deploy anything (as I expected), but helm shows the following message:</p>

<p><code>Error: release CHART_NAME failed: no objects visited</code> </p>

<p>And if I execute <code>helm ls</code> I get that CHART_NAME is deployed with <code>STATUS FAILED</code>.</p>

<p>My question is if there is a way to not have it as a failed helm deploy. So I would like to not see it when using the command <code>helm ls</code></p>

<p>I know that I could move the logic of shoudBeDeployed variable outside the chart, and then deploy the chart or not depending on its value, but I would like to know if there is a solution just using helm.</p>

<p>@pcampana I think there is no way to stop helm deployment if there is nothing to deploy. But here is a trick that you can use to delete a helm chart if it is
 FAILED.</p>

<blockquote>
  <p>helm install --name temp demo --atomic</p>
</blockquote>

<p>where demo is the helm chart directory and temp is release name . 
release name is mandatory for this to work.</p>

<p>One scenario is when you see error </p>

<blockquote>
  <p>Error: release temp failed: no objects visited</p>
</blockquote>

<p>you can use above command to deploy helm chart.</p>

<p>I think this might be useful for you. </p>
