Skip to content

Commit

Permalink
cluster: improved error for missing tar
Browse files Browse the repository at this point in the history
  • Loading branch information
dveeden committed Jan 21, 2025
1 parent 0791a28 commit 81c5bd7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/cluster/task/install_package.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
package task

import (
"bytes"
"context"
"fmt"
"path"
Expand Down Expand Up @@ -51,7 +52,11 @@ func (c *InstallPackage) Execute(ctx context.Context) error {

_, stderr, err := exec.Execute(ctx, cmd, false)
if err != nil {
return errors.Annotatef(err, "stderr: %s", string(stderr))
if bytes.Contains(stderr, []byte("command not found")) {
return errors.New("tar command was not found, please install it")
} else {
return errors.Annotatef(err, "stderr: %s", string(stderr))
}
}
return nil
}
Expand Down

0 comments on commit 81c5bd7

Please sign in to comment.