Skip to content

Commit

Permalink
Merge pull request #1009 from openshift-cherrypick-robot/cherry-pick-…
Browse files Browse the repository at this point in the history
…1006-to-release-4.15

[release-4.15] OCPBUGS-29983: cmd/move-blobs: log and exit 1 on error instead of panic
  • Loading branch information
openshift-merge-bot[bot] committed Feb 29, 2024
2 parents 5da92bd + 71996a4 commit f122f0b
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions cmd/move-blobs/main.go
Expand Up @@ -3,6 +3,7 @@ package main
import (
"context"
"fmt"
"log"
"net/url"
"os"
"strings"
Expand All @@ -22,7 +23,7 @@ import (
func main() {
opts := getConfigOpts()
if err := validate(opts); err != nil {
panic(err)
log.Fatal(err)
}

// if the environment specific configs are not given, assume
Expand All @@ -32,25 +33,25 @@ func main() {
}

if err := createASHEnvironmentFile(opts); err != nil {
panic(err)
log.Fatal(err)
}

cloudConfig, err := getCloudConfig(opts.environment)
if err != nil {
panic(err)
log.Fatal(err)
}

client, err := getClient(cloudConfig, opts)
if err != nil {
panic(err)
log.Fatal(err)
}
ctx := context.Background()
_, err = moveBlobs(ctx, client, &moveBlobOpts{
source: "docker",
dest: "/docker",
})
if err != nil {
panic(err)
log.Fatal(err)
}
}

Expand Down

0 comments on commit f122f0b

Please sign in to comment.