function

package
v0.0.0-...-9c0e913 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 8, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package function contains library units for the ecr-repository-compliance-webhook Lambda function.

Index

Constants

This section is empty.

Variables

View Source
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

type Container struct {
	ECR ecriface.ECRAPI
}

Container contains the dependencies and business logic for the ecr-repository-compliance-webhook Lambda function.

func NewContainer

func NewContainer(ecrSvc ecriface.ECRAPI) *Container

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

func (c *Container) CheckRepositoryCompliance(ctx context.Context, repository string) (bool, error)

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

func (c *Container) GetHandler() Handler

GetHandler returns the function handler for ecr-repository-compliance-webhook.

type Handler

Handler is a type alias for the Lambda handler's function signatire.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL