func()

in ecr-login/ecr.go [74:91]


func (self ECRHelper) List() (map[string]string, error) {
	logrus.Debug("Listing credentials")
	client := self.ClientFactory.NewClientWithDefaults()

	auths, err := client.ListCredentials()
	if err != nil {
		logrus.WithError(err).Error("Error listing credentials")
		return nil, fmt.Errorf("ecr: could not list credentials: %v", err)
	}

	result := map[string]string{}

	for _, auth := range auths {
		serverURL := auth.ProxyEndpoint
		result[serverURL] = auth.Username
	}
	return result, nil
}