mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-20 01:29:07 +00:00
trust: use a tempdir and remove after build
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
This commit is contained in:
parent
e8dc61e910
commit
92aa526b9d
@ -10,6 +10,7 @@ import (
|
||||
"net"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@ -61,8 +62,14 @@ 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,
|
||||
gun,
|
||||
server,
|
||||
rt,
|
||||
|
Loading…
Reference in New Issue
Block a user