// ResolveRepositoryAuthProvider resolves the authentication provider to use for the given image
ResolveRepositoryAuthProvider resolves the authentication provider to use for the given image
// ResolveRepositoryAuthProvider resolves the authentication provider to use for the given image
func ResolveRepositoryAuthProvider(repository string, authProviders map[string]dockerregistryproxyv1.AuthenticationProviderAPIClient) (dockerregistryproxyv1.AuthenticationProviderAPIClient, error) {
	repoParts := strings.Split(repository, "/")
	for i := len(repoParts); i > 0; i-- {
		repoAuth := strings.Join(repoParts[:i], "/")
		log.Println(repository, repoAuth)
		if val, ok := authProviders[repoAuth]; ok {
			return val, nil
		}
	}
	return nil, fmt.Errorf("could not resolve auth provider for repository: %s", repository)
}
func ResolveRepositoryAuthProvider ( repository string , authProviders map [ string ] dockerregistryproxyv1 . AuthenticationProviderAPIClient ) ( dockerregistryproxyv1 . AuthenticationProviderAPIClient , error ) { repoParts := strings . Split ( repository , " " ) for i := len ( repoParts ) ; i > 0 ; i -- { repoAuth := strings . Join ( repoParts [ : i ] , " " ) log . Println ( repository , repoAuth ) if val , ok := authProviders [ repoAuth ] ; ok { return val , nil } } return nil , fmt . Errorf ( " " , repository ) }
ResolveRepositoryAuthProvider resolves the authentication provider to use for the given image
ResolveRepositoryAuthProvider resolves the authentication provider to use for the given image