Skip to content

Commit

Permalink
Remove the --push option from the collect command (#67)
Browse files Browse the repository at this point in the history
The option to make the `collect` command push the snapshot to remote
storage isn't used, and make our API more confusing. Let's remove it,
at least for now.
  • Loading branch information
mikberg authored Mar 21, 2022
1 parent 5dc0252 commit 5585900
Showing 1 changed file with 1 addition and 20 deletions.
21 changes: 1 addition & 20 deletions snapshots/go/cmd/snapshots/collect.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ type collectConfig struct {
bazelCacheGRPCInsecure bool
bazelStderr bool
outPath string
push bool
noPrint bool
}

Expand Down Expand Up @@ -82,28 +81,10 @@ func runCollect(args []string) error {
log.Println("out path: ", cc.outPath)

// run the command
ctx := context.Background()
manifest, err := collect(cc)
if err != nil {
if _, err := collect(cc); err != nil {
return fmt.Errorf("failed to collect: %w", err)
}

if cc.push {
pc := getPushConfig(c)
pc.snapshot = manifest

obj, err := push(ctx, pc)
if err != nil {
return fmt.Errorf("failed to push snapshot: %w", err)
}

contentLenght, isOk := obj.GetContentLength()
if !isOk {
log.Printf("failed to get contentLenght of pushed snapshot: %s", obj.Path)
}
log.Printf("pushed snapshot of %d bytes: %s", contentLenght, obj.Path)
}

return nil
}

Expand Down

0 comments on commit 5585900

Please sign in to comment.