mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-22 18:41:37 +00:00
add default config and cache dir, initially use for trust
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
This commit is contained in:
parent
dd60edc884
commit
46b77f699f
@ -10,7 +10,7 @@ import (
|
|||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"os"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -62,14 +62,8 @@ func TrustedReference(image string) (reference.Reference, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
tmpTrustDir, err := ioutil.TempDir("", "notary")
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
defer os.Remove(tmpTrustDir)
|
|
||||||
|
|
||||||
nRepo, err := notaryClient.NewNotaryRepository(
|
nRepo, err := notaryClient.NewNotaryRepository(
|
||||||
tmpTrustDir,
|
trustDirectory(),
|
||||||
gun,
|
gun,
|
||||||
server,
|
server,
|
||||||
rt,
|
rt,
|
||||||
@ -107,6 +101,10 @@ func getTrustServer(gun string) (string, error) {
|
|||||||
return "", errors.New("non-hub images not yet supported")
|
return "", errors.New("non-hub images not yet supported")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func trustDirectory() string {
|
||||||
|
return filepath.Join(MobyDir, "trust")
|
||||||
|
}
|
||||||
|
|
||||||
type credentialStore struct {
|
type credentialStore struct {
|
||||||
username string
|
username string
|
||||||
password string
|
password string
|
||||||
|
Loading…
Reference in New Issue
Block a user