Fix docker hub login error when using image ref as target

Signed-off-by: Tom Chauveau <tom.chauveau@epitech.eu>
This commit is contained in:
Tom Chauveau
2021-06-18 22:01:16 +02:00
parent f842f1ed1d
commit 7d1bbcc416
6 changed files with 28 additions and 25 deletions

View File

@@ -63,7 +63,9 @@ func (a *RegistryAuthProvider) Credentials(ctx context.Context, req *bkauth.Cred
}
func parseAuthHost(host string) (*url.URL, error) {
if host == "registry-1.docker.io" {
isDockerHub := !(strings.Contains(host, "amazonaws.com") || strings.Contains(host, "gcr.io") || strings.Contains(host, "microsoft.com"))
if host == "registry-1.docker.io" || isDockerHub {
host = "https://index.docker.io/v1/"
}