Documentation ¶
Overview ¶
Package ecr implements ECR utilities.
Index ¶
- func Create(lg *zap.Logger, svc ecriface.ECRAPI, repoAccountID string, repoRegion string, ...) (repoURI string, err error)
- func Delete(lg *zap.Logger, svc ecriface.ECRAPI, repoAccountID string, repoRegion string, ...) (err error)
- func SetPolicy(lg *zap.Logger, svc ecriface.ECRAPI, repoAccountID string, repoRegion string, ...) (repoURI string, err error)
- type Repository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Create ¶
func Create( lg *zap.Logger, svc ecriface.ECRAPI, repoAccountID string, repoRegion string, repoName string, imgScanOnPush bool, imgTagMutability string, policyTxt string, setPolicyForce bool) (repoURI string, err error)
Create creates an ECR repo if it does not exist. If the set policy fails, ECR repo creation is reverted (delete).
Types ¶
type Repository ¶
type Repository struct { // Partition is used for deciding between "amazonaws.com" and "amazonaws.com.cn". Partition string `json:"partition"` // AccountID is the account ID for tester ECR image. // e.g. "my-app" for "[ACCOUNT_ID].dkr.ecr.[REGION].amazonaws.com/my-app" AccountID string `json:"account_id"` // Region is the ECR repository region to pull from. Region string `json:"region"` // Name is the repositoryName for tester ECR image. // e.g. "my-app" for "[ACCOUNT_ID].dkr.ecr.[REGION].amazonaws.com/my-app" Name string `json:"name"` // ImageTag is the image tag for tester ECR image. // e.g. "latest" for image URI "[ACCOUNT_ID].dkr.ecr.[REGION].amazonaws.com/my-app:latest" ImageTag string `json:"image_tag"` }
Repository represents an ECR image.
func (*Repository) Describe ¶
func (repo *Repository) Describe(lg *zap.Logger, svc ecriface.ECRAPI) (img string, exists bool, err error)
Describe checks if the specified repository exists, and returns the repository URI + ":" + image tag. It returns "true" for "exists" if the repository exists. This method succeeds if and only if the ECR image exists and the caller is able to verify via "ecr:DescribeImages". The success of this operation does not guarantee the success of image pull. This will fail even when the image describe fails and the caller can still pull the images.
func (*Repository) IsEmpty ¶
func (repo *Repository) IsEmpty() bool
Click to show internal directories.
Click to hide internal directories.