Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrBadImageReference = errors.New("bad image reference")
)
View Source
var (
ErrWrongRuleType = errors.New("wrong rule type")
)
Functions ¶
func NewImageInspector ¶
func NewImageInspector() *imageInspector
func ParseImageReference ¶
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
func NewEngineFromFile ¶
type ImageInspector ¶
type MutationRule ¶
type MutationRule struct { Type MutationType `yaml:"type"` Registry string `yaml:"registry,omitempty"` RegistryRegexp *regexp.Regexp `yaml:"-"` NewRegistry string `yaml:"newRegisty,omitempty"` }
type MutationType ¶
type MutationType string
const ( MutationTypeDefaultRegistry MutationType = "DefaultRegistry" MutationTypeRewriteRegistry MutationType = "RewriteRegistry" )
type Rule ¶
type Rule struct { Name string `yaml:"name"` MutationRule MutationRule `yaml:"mutate,omitempty"` ValidationRule ValidationRule `yaml:"validate,omitempty"` }
type ValidateType ¶
type ValidateType string
const ( ValidateTypeLatest ValidateType = "Latest" ValidateTypeSemVer ValidateType = "SemVer" ValidateTypeLock ValidateType = "Lock" ValidateTypeRollingTag ValidateType = "RollingTag" )
type ValidationRule ¶
type ValidationRule struct { Type ValidateType `yaml:"type"` ImageName string `yaml:"imageName,omitempty"` ImageNameRegexp *regexp.Regexp `yaml:"-"` ImageTag string `yaml:"imageTag,omitempty"` ImageTagSemVer *semver.Constraints `yaml:"-"` Allow bool `yaml:"allow"` RollingTagAfter time.Time `yaml:"after,omitempty"` }
func (ValidationRule) Match ¶
func (r ValidationRule) Match(ctx context.Context, repo *repo.Repo, inspector ImageInspector, name, tag string) bool
Click to show internal directories.
Click to hide internal directories.