mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
Merge pull request #49015 from thaJeztah/registry_test_cleanups
registry: remove assignment of default values in some tests
This commit is contained in:
@@ -335,41 +335,27 @@ func testNewPuller(t *testing.T, rawurl string) *puller {
|
||||
t.Helper()
|
||||
|
||||
uri, err := url.Parse(rawurl)
|
||||
if err != nil {
|
||||
t.Fatalf("could not parse url from test server: %v", err)
|
||||
}
|
||||
assert.NilError(t, err, "could not parse url from test server: %v", rawurl)
|
||||
|
||||
n, err := reference.ParseNormalizedNamed("testremotename")
|
||||
assert.NilError(t, err)
|
||||
|
||||
endpoint := registry.APIEndpoint{
|
||||
Mirror: false,
|
||||
URL: uri,
|
||||
Official: false,
|
||||
TrimHostname: false,
|
||||
TLSConfig: nil,
|
||||
}
|
||||
n, _ := reference.ParseNormalizedNamed("testremotename")
|
||||
repoInfo := ®istry.RepositoryInfo{
|
||||
Name: n,
|
||||
Index: ®istrytypes.IndexInfo{
|
||||
Name: "testrepo",
|
||||
Mirrors: nil,
|
||||
Secure: false,
|
||||
Official: false,
|
||||
Name: "testrepo",
|
||||
},
|
||||
Official: false,
|
||||
}
|
||||
imagePullConfig := &ImagePullConfig{
|
||||
Config: Config{
|
||||
MetaHeaders: http.Header{},
|
||||
AuthConfig: ®istrytypes.AuthConfig{
|
||||
RegistryToken: secretRegistryToken,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
p := newPuller(endpoint, repoInfo, imagePullConfig, nil)
|
||||
p := newPuller(registry.APIEndpoint{URL: uri}, repoInfo, imagePullConfig, nil)
|
||||
p.repo, err = newRepository(context.Background(), p.repoInfo, p.endpoint, p.config.MetaHeaders, p.config.AuthConfig, "pull")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.NilError(t, err)
|
||||
return p
|
||||
}
|
||||
|
||||
@@ -41,22 +41,15 @@ func testTokenPassThru(t *testing.T, ts *httptest.Server) {
|
||||
}
|
||||
|
||||
endpoint := registrypkg.APIEndpoint{
|
||||
Mirror: false,
|
||||
URL: uri,
|
||||
Official: false,
|
||||
TrimHostname: false,
|
||||
TLSConfig: nil,
|
||||
}
|
||||
n, _ := reference.ParseNormalizedNamed("testremotename")
|
||||
repoInfo := ®istrypkg.RepositoryInfo{
|
||||
Name: n,
|
||||
Index: ®istry.IndexInfo{
|
||||
Name: "testrepo",
|
||||
Mirrors: nil,
|
||||
Secure: false,
|
||||
Official: false,
|
||||
Name: "testrepo",
|
||||
},
|
||||
Official: false,
|
||||
}
|
||||
imagePullConfig := &ImagePullConfig{
|
||||
Config: Config{
|
||||
|
||||
Reference in New Issue
Block a user