add default scheme if endpoint no scheme

Signed-off-by: yang yang <yang8518296@163.com>
This commit is contained in:
yang yang
2020-04-17 17:30:46 +08:00
parent 61b7af7564
commit d07f7f167a
2 changed files with 38 additions and 0 deletions

View File

@@ -227,6 +227,23 @@ func TestRegistryEndpoints(t *testing.T) {
"https://registry-3.io/path",
},
},
"miss scheme endpoint in list with path": {
mirrors: map[string]criconfig.Mirror{
"registry-3.io": {
Endpoints: []string{
"https://registry-3.io",
"registry-1.io",
"127.0.0.1:1234",
},
},
},
host: "registry-3.io",
expected: []string{
"https://registry-3.io",
"https://registry-1.io",
"http://127.0.0.1:1234",
},
},
} {
t.Logf("TestCase %q", desc)
c := newTestCRIService()