mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-24 01:27:49 +01:00
Fix DockerHub adapter registry URL problem
Signed-off-by: cd1989 <chende@caicloud.io>
This commit is contained in:
parent
5f29d9a3b7
commit
254aa7e2b7
@ -27,16 +27,16 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func factory(registry *model.Registry) (adp.Adapter, error) {
|
func factory(registry *model.Registry) (adp.Adapter, error) {
|
||||||
client, err := NewClient(&model.Registry{
|
client, err := NewClient(registry)
|
||||||
URL: baseURL, // specify the URL of Docker Hub
|
|
||||||
Credential: registry.Credential,
|
|
||||||
Insecure: registry.Insecure,
|
|
||||||
})
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
dockerRegistryAdapter, err := native.NewAdapter(registry)
|
dockerRegistryAdapter, err := native.NewAdapter(&model.Registry{
|
||||||
|
URL: registryURL,
|
||||||
|
Credential: registry.Credential,
|
||||||
|
Insecure: registry.Insecure,
|
||||||
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -249,13 +249,13 @@ func (a *adapter) FetchImages(filters []*model.Filter) ([]*model.Resource, error
|
|||||||
}
|
}
|
||||||
|
|
||||||
var resources = make([]*model.Resource, len(repos))
|
var resources = make([]*model.Resource, len(repos))
|
||||||
var wg sync.WaitGroup
|
var wg = new(sync.WaitGroup)
|
||||||
var stopped = make(chan struct{})
|
var stopped = make(chan struct{})
|
||||||
var passportsPool = utils.NewPassportsPool(adp.MaxConcurrency, stopped)
|
var passportsPool = utils.NewPassportsPool(adp.MaxConcurrency, stopped)
|
||||||
|
|
||||||
for i, r := range repos {
|
for i, r := range repos {
|
||||||
go func(index int, repo Repo) {
|
|
||||||
wg.Add(1)
|
wg.Add(1)
|
||||||
|
go func(index int, repo Repo) {
|
||||||
defer func() {
|
defer func() {
|
||||||
wg.Done()
|
wg.Done()
|
||||||
}()
|
}()
|
||||||
|
Loading…
Reference in New Issue
Block a user