Install helm chart automatically
The error from ioutil.TempFile is unhandled, should also return err since everything after it won't work if the temporary file
couldn't be created.
The strings.Contains check is definitely the least preferred option
to check for the kind of error.  If at all possible avoid it since
it's actually fairly easy for that string to change with, say, a
library upgrade without any notice, which would break the logic here.
Same with status.Info.Status.String() == release.StatusFailed - are
you sure it can't just be compared without the String() conversion?
tmpfile.Name() is used twice, could already be moved to a variable.
In fact, one of tmpfile and kcfgFilePath is redundant, I'd suggest
directly assigning to kcfgFilePath.
IMO new is obsolete and could very well be replaced by a regular
variable declaration.
statusAction could be inlined.

Actually it would be great if the imports were mentioned, that would
give readers a chance to find the actual signatures and such.  Without
that I'll leave it at those points.
Apart from these details it looks okay, though at some point you might
want to refactor things into smaller functions to bring a little order
into it.  Right now it's still a rather long block of code.  E.g. it
might be worth moving the inner part of the loop into a new function.
Or creating functions for each &quot;action&quot; that's currently only marked
with a comment, say runInstall, runUpgrade.  The temporary file bit
at the start could also very well be its own function (keeping the
os.Remove call at this level of course).
Edit: As requested to elaborate on the second point, it's better to do a
direct comparison of error values instead of string comparisons, since
they're just values too, this will be faster and not depend on string
values which might change in unexpected ways, like so:
// this is defined in the helm API
var ErrReleaseNotFound error = errors.New(&quot;release: not found&quot;)

// ...

// some time later, we get an error
{
    statusAction := action.NewStatus(ac)
    status, err := statusAction.Run(releaseName)
    if err != nil {
        if err == driver.ErrReleaseNotFound {
            releasePresent = false
        } else {
            return err
        }
    }

    // ...
}

But, actually, we should all probably start using
errors.Is so that even nested
errors would be correctly handled:
// ...
if errors.Is(err, ErrReleaseNotFound) {
    releasePresent = false
} else {
    return err
}
// ...