Merge pull request #379 from jonboulle/skipverify

fetch: do not build keystore if InsecureSkipVerify
This commit is contained in:
Kelsey Hightower
2015-01-13 14:06:19 -08:00
3 changed files with 11 additions and 3 deletions
+1 -2
View File
@@ -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 {
+9
View File
@@ -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
View File
@@ -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)