Merge pull request #4042 from milosgajdos/libtrust-handlers

Remove libtrust from handler tests
This commit is contained in:
Wang Yan 2023-09-05 15:59:38 +08:00 committed by GitHub
commit 90939f1173
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -31,7 +31,6 @@ import (
_ "github.com/distribution/distribution/v3/registry/storage/driver/inmemory" _ "github.com/distribution/distribution/v3/registry/storage/driver/inmemory"
"github.com/distribution/distribution/v3/testutil" "github.com/distribution/distribution/v3/testutil"
"github.com/distribution/reference" "github.com/distribution/reference"
"github.com/docker/libtrust"
"github.com/gorilla/handlers" "github.com/gorilla/handlers"
"github.com/opencontainers/go-digest" "github.com/opencontainers/go-digest"
) )
@ -2128,7 +2127,6 @@ func testManifestDelete(t *testing.T, env *testEnv, args manifestArgs) {
} }
type testEnv struct { type testEnv struct {
pk libtrust.PrivateKey
ctx context.Context ctx context.Context
config configuration.Configuration config configuration.Configuration
app *App app *App
@ -2186,13 +2184,7 @@ func newTestEnvWithConfig(t *testing.T, config *configuration.Configuration) *te
t.Fatalf("error creating url builder: %v", err) t.Fatalf("error creating url builder: %v", err)
} }
pk, err := libtrust.GenerateECP256PrivateKey()
if err != nil {
t.Fatalf("unexpected error generating private key: %v", err)
}
return &testEnv{ return &testEnv{
pk: pk,
ctx: ctx, ctx: ctx,
config: *config, config: *config,
app: app, app: app,