mirror of
https://github.com/helmfile/helmfile.git
synced 2026-10-21 09:12:13 +02:00
Fix panic when helm isn't installed (#2169)
Return error instead of panic Signed-off-by: Nick Neisen <nwneisen@gmail.com>
This commit is contained in:
@@ -122,11 +122,10 @@ func redactedURL(chart string) string {
|
||||
}
|
||||
|
||||
// New for running helm commands
|
||||
func New(helmBinary string, options HelmExecOptions, logger *zap.SugaredLogger, kubeconfig string, kubeContext string, runner Runner) *execer {
|
||||
// TODO: proper error handling
|
||||
func New(helmBinary string, options HelmExecOptions, logger *zap.SugaredLogger, kubeconfig string, kubeContext string, runner Runner) (*execer, error) {
|
||||
version, err := GetHelmVersion(helmBinary, runner)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if version.Prerelease() != "" {
|
||||
@@ -143,7 +142,7 @@ func New(helmBinary string, options HelmExecOptions, logger *zap.SugaredLogger,
|
||||
kubeContext: kubeContext,
|
||||
runner: runner,
|
||||
decryptedSecrets: make(map[string]*decryptedSecret),
|
||||
}
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (helm *execer) SetExtraArgs(args ...string) {
|
||||
|
||||
Reference in New Issue
Block a user