code: func GetImageRegistryAuth(auths *AuthConfigurations, imageName string) api.AuthConfig {
  	glog.V(5).Infof("Getting docker credentials for %s", imageName)
  	if auths == nil {
  		return api.AuthConfig{}
  	}
  	ref, err := parseNamedDockerImageReference(imageName)
  	if err != nil {
  		glog.V(0).Infof("error: Failed to parse docker reference %s", imageName)
  		return api.AuthConfig{}
  	}
  	if ref.Registry != "" {
  		if auth, ok := auths.Configs[ref.Registry]; ok {
  			glog.V(5).Infof("Using %s[%s] credentials for pulling %s", auth.Email, ref.Registry, imageName)
  			return auth
  		}
  	}
  	if auth, ok := auths.Configs[defaultRegistry]; ok {
  		glog.V(5).Infof("Using %s credentials for pulling %s", auth.Email, imageName)
  		return auth
  	}
  	return api.AuthConfig{}
  }
docs: // GetImageRegistryAuth retrieves the appropriate docker client authentication
  // object for a given image name and a given set of client authentication
  // objects.