hook

package
v0.0.0-...-e73b65a Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InvalidImage    = "InvalidImage"
	InvalidPlaybook = "InvalidPlaybook"
)

Types

View Source
const (
	Required = libcnd.Required
	Advisory = libcnd.Advisory
	Critical = libcnd.Critical
	Error    = libcnd.Error
	Warn     = libcnd.Warn
)

Categories

View Source
const (
	NotSet   = "NotSet"
	NotFound = "NotFound"
	DataErr  = "DataError"
)

Reasons

View Source
const (
	True  = libcnd.True
	False = libcnd.False
)

Statuses

View Source
const (
	// Name.
	Name = "hook"
)

Variables

View Source
var (

	// DomainRegexp defines the structure of potential domain components
	// that may be part of image names. This is purposely a subset of what is
	// allowed by DNS to ensure backwards compatibility with Docker image
	// names.
	DomainRegexp = expression(
		domainComponentRegexp,
		optional(repeated(literal(`.`), domainComponentRegexp)),
		optional(literal(`:`), match(`[0-9]+`)))

	// TagRegexp matches valid tag names. From docker/docker:graph/tags.go.
	TagRegexp = match(`[\w][\w.-]{0,127}`)

	// DigestRegexp matches valid digests.
	DigestRegexp = match(`[A-Za-z][A-Za-z0-9]*(?:[-_+.][A-Za-z][A-Za-z0-9]*)*[:][[:xdigit:]]{32,}`)

	// NameRegexp is the format for the name component of references. The
	// regexp has capturing groups for the domain and name part omitting
	// the separating forward slash from either.
	NameRegexp = expression(
		optional(DomainRegexp, literal(`/`)),
		nameComponentRegexp,
		optional(repeated(literal(`/`), nameComponentRegexp)))

	// ReferenceRegexp is the full supported format of a reference. The regexp
	// is anchored and has capturing groups for name, tag, and digest
	// components.
	ReferenceRegexp = anchored(capture(NameRegexp),
		optional(literal(":"), capture(TagRegexp)),
		optional(literal("@"), capture(DigestRegexp)))

	// IdentifierRegexp is the format for string identifier used as a
	// content addressable identifier using sha256. These identifiers
	// are like digests without the algorithm, since sha256 is used.
	IdentifierRegexp = match(`([a-f0-9]{64})`)

	// ShortIdentifierRegexp is the format used to represent a prefix
	// of an identifier. A prefix may be used to match a sha256 identifier
	// within a list of trusted identifiers.
	ShortIdentifierRegexp = match(`([a-f0-9]{6,64})`)
)
View Source
var Settings = &settings.Settings

Application settings.

Functions

func Add

func Add(mgr manager.Manager) error

Creates a new Hook Controller and adds it to the Manager.

Types

type HookPredicate

type HookPredicate struct {
	predicate.Funcs
}

func (HookPredicate) Create

func (r HookPredicate) Create(e event.CreateEvent) bool

func (HookPredicate) Delete

func (r HookPredicate) Delete(e event.DeleteEvent) bool

func (HookPredicate) Update

func (r HookPredicate) Update(e event.UpdateEvent) bool

type Reconciler

type Reconciler struct {
	base.Reconciler
}

Reconciles a Hook object.

func (Reconciler) Reconcile

func (r Reconciler) Reconcile(request reconcile.Request) (result reconcile.Result, err error)

Reconcile a Hook CR. Note: Must not a pointer receiver to ensure that the logger and other state is not shared.

Jump to

Keyboard shortcuts

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