mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-20 17:49:10 +00:00
Merge pull request #62 from riyazdf/config-dir-trust
add default trust config and cache dir
This commit is contained in:
commit
d599aedb7f
@ -10,7 +10,7 @@ import (
|
||||
"net"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@ -62,14 +62,8 @@ func TrustedReference(image string) (reference.Reference, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
tmpTrustDir, err := ioutil.TempDir("", "notary")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer os.Remove(tmpTrustDir)
|
||||
|
||||
nRepo, err := notaryClient.NewNotaryRepository(
|
||||
tmpTrustDir,
|
||||
trustDirectory(),
|
||||
gun,
|
||||
server,
|
||||
rt,
|
||||
@ -107,6 +101,10 @@ func getTrustServer(gun string) (string, error) {
|
||||
return "", errors.New("non-hub images not yet supported")
|
||||
}
|
||||
|
||||
func trustDirectory() string {
|
||||
return filepath.Join(MobyDir, "trust")
|
||||
}
|
||||
|
||||
type credentialStore struct {
|
||||
username string
|
||||
password string
|
||||
|
Loading…
Reference in New Issue
Block a user