mighook

package
v0.0.0-...-ec8378c Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InvalidTargetCluster = "InvalidTarget"
	InvalidImage         = "InvalidImage"
	InvalidPlaybookData  = "InvalidPlaybookData"
	InvalidAnsibleHook   = "InvalidAnsibleHook"
	InvalidCustomHook    = "InvalidCustomHook"
)

Types

View Source
const (
	Supported    = "Supported"
	NotSupported = "NotSupported"
	NotSet       = "NotSet"
	NotFound     = "NotFound"
	KeyError     = "KeyError"
	TestFailed   = "TestFailed"
)

Reasons

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

Statuses

View Source
const (
	Critical = migapi.Critical
)

Categories

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})`)
)

Functions

func Add

func Add(mgr manager.Manager) error

Add creates a new MigHook Controller and adds it to the Manager with default RBAC. The Manager will set fields on the Controller and Start it when the Manager is Started.

Types

type HookPredicate

type HookPredicate struct {
	predicate.Funcs
	Namespace string
}

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 ReconcileMigHook

type ReconcileMigHook struct {
	client.Client
	record.EventRecorder
	// contains filtered or unexported fields
}

ReconcileMigHook reconciles a MigHook object

func (*ReconcileMigHook) Reconcile

func (r *ReconcileMigHook) Reconcile(ctx context.Context, request reconcile.Request) (reconcile.Result, error)

Jump to

Keyboard shortcuts

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