mirror of
https://github.com/argoproj/argo-cd.git
synced 2026-02-20 01:28:45 +01:00
fix(helm): Improve error message when helm cmd fails (#26159)
Signed-off-by: Oliver Gondža <ogondza@gmail.com>
This commit is contained in:
@@ -70,11 +70,11 @@ func (c Cmd) run(ctx context.Context, args ...string) (string, string, error) {
|
||||
}
|
||||
|
||||
cmd.Env = proxy.UpsertEnv(cmd, c.proxy, c.noProxy)
|
||||
fullCommand := executil.GetCommandArgsToLog(cmd)
|
||||
|
||||
out, err := c.runWithRedactor(cmd, redactor)
|
||||
fullCommand := executil.GetCommandArgsToLog(cmd)
|
||||
if err != nil {
|
||||
return out, fullCommand, fmt.Errorf("failed to get command args to log: %w", err)
|
||||
return out, fullCommand, fmt.Errorf("failed running helm: %w", err)
|
||||
}
|
||||
return out, fullCommand, nil
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ func TestRegistryLogin(t *testing.T) {
|
||||
repo: "my.registry.com/repo",
|
||||
creds: &HelmCreds{},
|
||||
execErr: errors.New("exit status 1"),
|
||||
expectedErr: errors.New("failed to login to registry: failed to get command args to log: exit status 1"),
|
||||
expectedErr: errors.New("failed to login to registry: failed running helm: exit status 1"),
|
||||
},
|
||||
{
|
||||
name: "invalid repo",
|
||||
|
||||
Reference in New Issue
Block a user