Skip to content

Commit

Permalink
Merge pull request #457 from antwacky/use-head-to-query-registry
Browse files Browse the repository at this point in the history
Change registry query from GET to HEAD to avoid Dockerhub API rate li…
  • Loading branch information
joaopapereira authored Feb 21, 2024
2 parents 42fe6e3 + 2607529 commit e9d42c9
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pkg/kbld/registry/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,16 @@ func (i Registry) Generic(ref regname.Reference) (regv1.Descriptor, error) {
return regv1.Descriptor{}, err
}

desc, err := regremote.Get(ref, i.opts...)
desc, err := regremote.Head(ref, i.opts...)
if err != nil {
return regv1.Descriptor{}, err
getDesc, err := regremote.Get(ref, i.opts...)
if err != nil {
return regv1.Descriptor{}, err
}
return getDesc.Descriptor, err
}

return desc.Descriptor, nil
return *desc, nil
}

func (i Registry) Image(ref regname.Reference) (regv1.Image, error) {
Expand Down

0 comments on commit e9d42c9

Please sign in to comment.