Skip to content

Commit

Permalink
Merge pull request #9162 from priyawadhwa/fix-exec
Browse files Browse the repository at this point in the history
mkcmp: Better error message if binary does not exist
  • Loading branch information
priyawadhwa authored Sep 2, 2020
2 parents 78deeb5 + c91e476 commit 9e1d811
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkg/minikube/perf/binary.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"io"
"os"
"path/filepath"
"runtime"
"strconv"
"strings"

Expand Down Expand Up @@ -68,7 +69,14 @@ func (b *Binary) download() error {
return errors.Wrap(err, "getting storage client")
}
defer client.Close()
rc, err := client.Bucket(bucket).Object(fmt.Sprintf("%d/minikube-linux-amd64", b.pr)).NewReader(ctx)

// first make sure object exists
obj := client.Bucket(bucket).Object(fmt.Sprintf("%d/minikube-%s-amd64", b.pr, runtime.GOOS))
if _, err := obj.Attrs(ctx); err != nil {
return fmt.Errorf("minikube binary for pr %v does not exist in bucket", b.pr)
}

rc, err := obj.NewReader(ctx)
if err != nil {
return errors.Wrap(err, "getting minikube object from gcs bucket")
}
Expand Down

0 comments on commit 9e1d811

Please sign in to comment.