mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-19 15:17:43 +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) {
|
||||
client, err := NewClient(&model.Registry{
|
||||
URL: baseURL, // specify the URL of Docker Hub
|
||||
Credential: registry.Credential,
|
||||
Insecure: registry.Insecure,
|
||||
})
|
||||
client, err := NewClient(registry)
|
||||
if err != nil {
|
||||
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 {
|
||||
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 wg sync.WaitGroup
|
||||
var wg = new(sync.WaitGroup)
|
||||
var stopped = make(chan struct{})
|
||||
var passportsPool = utils.NewPassportsPool(adp.MaxConcurrency, stopped)
|
||||
|
||||
for i, r := range repos {
|
||||
wg.Add(1)
|
||||
go func(index int, repo Repo) {
|
||||
wg.Add(1)
|
||||
defer func() {
|
||||
wg.Done()
|
||||
}()
|
||||
|
Loading…
Reference in New Issue
Block a user