mirror of https://github.com/docker/cli.git
cli/trust: remove deprecated io/ioutil and use t.TempDir()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
58cf16da45
commit
1e54bca833
|
@ -1,8 +1,6 @@
|
||||||
package trust
|
package trust
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"io/ioutil"
|
|
||||||
"os"
|
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/docker/distribution/reference"
|
"github.com/docker/distribution/reference"
|
||||||
|
@ -49,11 +47,7 @@ func TestGetDigest(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestGetSignableRolesError(t *testing.T) {
|
func TestGetSignableRolesError(t *testing.T) {
|
||||||
tmpDir, err := ioutil.TempDir("", "notary-test-")
|
notaryRepo, err := client.NewFileCachedRepository(t.TempDir(), "gun", "https://localhost", nil, passphrase.ConstantRetriever("password"), trustpinning.TrustPinConfig{})
|
||||||
assert.NilError(t, err)
|
|
||||||
defer os.RemoveAll(tmpDir)
|
|
||||||
|
|
||||||
notaryRepo, err := client.NewFileCachedRepository(tmpDir, "gun", "https://localhost", nil, passphrase.ConstantRetriever("password"), trustpinning.TrustPinConfig{})
|
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
target := client.Target{}
|
target := client.Target{}
|
||||||
_, err = GetSignableRoles(notaryRepo, &target)
|
_, err = GetSignableRoles(notaryRepo, &target)
|
||||||
|
|
Loading…
Reference in New Issue