Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change registry query from GET to HEAD to avoid Dockerhub API rate li… #457

Merged
merged 11 commits into from
Feb 21, 2024
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
Loading