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>
(cherry picked from commit 1e54bca833
)
Signed-off-by: Cory Snider <csnider@mirantis.com>
This commit is contained in:
parent
f8211f7f80
commit
dc4e6835b7
|
@ -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