<p>I have a truststore file(a binary file) that I need to provide during helm upgrade. This file is different for each target env(dev,qa,staging or prod). So I can only provide this file at time of  deployment. <code>helm upgrade</code> <code>--set-file</code> does not take a binary file. This seem to be the issue I found here: <a href="https://github.com/helm/helm/issues/3276" rel="nofollow noreferrer">https://github.com/helm/helm/issues/3276</a>. This truststore files are stored in Jenkins Credential store.</p>

alltej
<p>As the command itself is described below:</p>

<pre><code>--set-file stringArray     set values from respective files specified via the command line (can specify multiple or separate values with commas: key1=path1,key2=path2)
</code></pre>

<p>it is also important to know <a href="https://v2.helm.sh/docs/using_helm/#the-format-and-limitations-of-set" rel="nofollow noreferrer">The Format and Limitations of
--set</a>.</p>

<p>The error you see: <code>Error: failed parsing --set-file data...</code> means that the file you are trying to use does not meet the requirements. See the example below:</p>

<blockquote>
  <p><code>--set-file key=filepath</code> is another variant of <code>--set</code>. It reads the
  file and use its content as a value. An example use case of it is to
  inject a multi-line text into values without dealing with indentation
  in YAML. Say you want to create a brigade project with certain value
  containing 5 lines JavaScript code, you might write a values.yaml
  like:</p>

<pre><code>defaultScript: |
  const { events, Job } = require("brigadier")
  function run(e, project) {
    console.log("hello default script")
  }
  events.on("run", run)
</code></pre>
  
  <p>Being embedded in a YAML, this makes it harder for you to use IDE
  features and testing framework and so on that supports writing code.
  Instead, you can use <code>--set-file defaultScript=brigade.js</code> with
  <code>brigade.js</code> containing:</p>

<pre><code>const { events, Job } = require("brigadier")
function run(e, project) {
  console.log("hello default script")
}
events.on("run", run)
</code></pre>
</blockquote>

<p>I hope it helps. </p>
