Documentation ¶
Overview ¶
Package function contains library units for the ecr-repository-compliance-webhook Lambda function.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrFailedCompliance ... ErrFailedCompliance = errors.New("webhook: repository fails ecr criteria") // ErrImagesNotFound ... ErrImagesNotFound = errors.New("webhook: no ecr images found in pod specification") )
Functions ¶
This section is empty.
Types ¶
type Container ¶
Container contains the dependencies and business logic for the ecr-repository-compliance-webhook Lambda function.
func NewContainer ¶
NewContainer creates a new function Container.
func (*Container) BatchCheckRepositoryCompliance ¶
func (c *Container) BatchCheckRepositoryCompliance(ctx context.Context, repos []string) (bool, error)
BatchCheckRepositoryCompliance checks the compliance of a given set of ECR repositories. False is returned if a single repository is not compliant.
func (*Container) CheckRepositoryCompliance ¶
CheckRepositoryCompliance checks if the repository for the image that was just sent to the is compliant. 1. Comes from ECR 2. Has image tag immutability enabled 3. Has image scan on push enabled
func (*Container) GetHandler ¶
GetHandler returns the function handler for ecr-repository-compliance-webhook.
type Handler ¶
type Handler func(context.Context, events.APIGatewayProxyRequest) (*v1beta1.AdmissionReview, error)
Handler is a type alias for the Lambda handler's function signatire.