Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseRegistry ¶ added in v0.11.0
ParseRegistry returns the AWS account ID and region and `true` if the image registry/repository is hosted in AWS's Elastic Container Registry, otherwise empty strings and `false`.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a AWS ECR client which can log into the registry and return authorization information.
func NewClient ¶
func NewClient() *Client
NewClient creates a new empty ECR client. NOTE: In order to avoid breaking the auth API with aws-sdk-go-v2's default config, return an empty Client. Client.getLoginAuth() loads the default config if Client.config is nil. This also enables tests to configure the Client with stub before calling the login method using Client.WithConfig().
func (*Client) Login ¶
func (c *Client) Login(ctx context.Context, autoLogin bool, image string) (authn.Authenticator, error)
Login attempts to get the authentication material for ECR. It extracts the account and region information from the image URI. The caller can ensure that the passed image is a valid ECR image using ParseRegistry().
func (*Client) WithConfig ¶ added in v0.17.0
WithConfig allows setting the client config if it's uninitialized.