Skip to content

Commit

Permalink
Merge pull request kubernetes#14367 from chases2/configurator-errors
Browse files Browse the repository at this point in the history
Handle GCS Error in Configurator
  • Loading branch information
k8s-ci-robot authored Sep 17, 2019
2 parents c15a9f0 + 715fbaa commit 561122a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions testgrid/cmd/configurator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,11 +324,14 @@ func main() {
return
}

// Setup GCS client
// Set up GCS client if output is to GCS
var client *storage.Client
if opt.output != "" {
// Error returned if outputting to file; ignore for now
client, _ = gcs.ClientWithCreds(ctx, opt.creds)
if strings.HasPrefix(opt.output, "gs://") {
var err error
client, err = gcs.ClientWithCreds(ctx, opt.creds)
if err != nil {
log.Fatalf("failed to create gcs client: %v", err)
}
}

// Oneshot mode, write config and exit
Expand Down

0 comments on commit 561122a

Please sign in to comment.