agent/ecr/client.go
func (client *ecrClient) GetAuthorizationToken(registryId string) (*ecrapi.AuthorizationData, error) {
	log.Debugf("Calling GetAuthorizationToken for %q", registryId)

	output, err := client.sdkClient.GetAuthorizationToken(&ecrapi.GetAuthorizationTokenInput{
		RegistryIds: []*string{aws.String(registryId)},
	})

	if err != nil {
		return nil, err
	}

	if len(output.AuthorizationData) != 1 {
		return nil, fmt.Errorf("unexpected number of results in AuthorizationData (%d)", len(output.AuthorizationData))
	}
	return output.AuthorizationData[0], nil
}
func (client *ecrClient) GetAuthorizationToken(registryId string) (*ecrapi.AuthorizationData, error) {
	log.Debugf("Calling GetAuthorizationToken for %q", registryId)

	output, err := client.sdkClient.GetAuthorizationToken(&ecrapi.GetAuthorizationTokenInput{
		RegistryIds: []*string{aws.String(registryId)},
	})

	if err != nil {
		return nil, err
	}

	if len(output.AuthorizationData) != 1 {
		return nil, fmt.Errorf("unexpected number of results in AuthorizationData (%d)", len(output.AuthorizationData))
	}
	return output.AuthorizationData[0], nil
}
func ( client * ecrClient ) GetAuthorizationToken ( registryId string ) ( * ecrapi . AuthorizationData , error ) { log . Debugf ( " " , registryId ) output , err := client . sdkClient . GetAuthorizationToken ( & ecrapi . GetAuthorizationTokenInput { RegistryIds : [ ] * string { aws . String ( registryId ) } , } ) if err != nil { return nil , err } if len ( output . AuthorizationData ) != 1 { return nil , fmt . Errorf ( " " , len ( output . AuthorizationData ) ) } return output . AuthorizationData [ 0 ] , nil }
// GetAuthorizationToken calls the ecr api to get the docker auth for the specified registry
GetAuthorizationToken calls the ecr api to get the docker auth for the specified registry