mirror of
https://github.com/clearlinux/rkt.git
synced 2026-11-25 21:42:50 +00:00
Merge pull request #379 from jonboulle/skipverify
fetch: do not build keystore if InsecureSkipVerify
This commit is contained in:
+1
-2
@@ -53,8 +53,7 @@ func runFetch(args []string) (exit int) {
|
||||
}
|
||||
|
||||
ds := cas.NewStore(globalFlags.Dir)
|
||||
ks := keystore.New(nil)
|
||||
|
||||
ks := getKeystore()
|
||||
for _, img := range args {
|
||||
hash, err := fetchImage(img, ds, ks)
|
||||
if err != nil {
|
||||
|
||||
@@ -20,6 +20,8 @@ import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"text/tabwriter"
|
||||
|
||||
"github.com/coreos/rocket/pkg/keystore"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -113,3 +115,10 @@ func containersDir() string {
|
||||
func garbageDir() string {
|
||||
return filepath.Join(globalFlags.Dir, "garbage")
|
||||
}
|
||||
|
||||
func getKeystore() *keystore.Keystore {
|
||||
if globalFlags.InsecureSkipVerify {
|
||||
return nil
|
||||
}
|
||||
return keystore.New(nil)
|
||||
}
|
||||
|
||||
+1
-1
@@ -121,7 +121,7 @@ func runRun(args []string) (exit int) {
|
||||
}
|
||||
|
||||
ds := cas.NewStore(globalFlags.Dir)
|
||||
ks := keystore.New(nil)
|
||||
ks := getKeystore()
|
||||
imgs, err := findImages(args, ds, ks)
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "%v\n", err)
|
||||
|
||||
Reference in New Issue
Block a user