runtime

package
v0.13.9 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WildcardVersionKindMatcher = "*"
	CoreAPIVersion             = "v1"
)

Variables

This section is empty.

Functions

func DescribeExpressionMatch

func DescribeExpressionMatch(match ExpressionMatch) string

Types

type ExpressionMatch

type ExpressionMatch struct {
	ExpressionRegex `json:",inline"`

	// Exact matches one of the provided values exactly.
	//
	// +kubebuilder:validation:MinItems=1
	// +kubebuilder:validation:Items:MinLength=1
	// +optional
	Exact []string `json:"exact,omitempty"`
}

At least one of Exact or Exp must be set. Both may be set together. +kubebuilder:object:generate=true +kubebuilder:validation:XValidation:rule="has(self.exact) || has(self.exp)",message="at least one of exact or exp must be set"

func (*ExpressionMatch) DeepCopy

func (in *ExpressionMatch) DeepCopy() *ExpressionMatch

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExpressionMatch.

func (*ExpressionMatch) DeepCopyInto

func (in *ExpressionMatch) DeepCopyInto(out *ExpressionMatch)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (ExpressionMatch) Describe

func (m ExpressionMatch) Describe() string

func (ExpressionMatch) Matches

func (m ExpressionMatch) Matches(value string) (bool, error)

func (ExpressionMatch) MatchesWithExpressionMatcher

func (m ExpressionMatch) MatchesWithExpressionMatcher(
	matcher ExpressionRegexMatcher,
	value string,
) (bool, error)

type ExpressionRegex

type ExpressionRegex struct {
	// Exp matches regular expression.
	//
	// +kubebuilder:validation:MinLength=1
	// +optional
	Expression string `json:"exp,omitempty"`
	// Negate regular Expression
	//+kubebuilder:default:=false
	Negate bool `json:"negate,omitempty"`
}

type ExpressionRegexMatcher

type ExpressionRegexMatcher interface {
	MatchRegex(expression ExpressionRegex, value string) (bool, error)
}

type VersionKind

type VersionKind struct {
	// Kind of the referent.
	//
	// Use "*" to match all kinds.
	//
	// +kubebuilder:validation:MinLength=1
	Kind string `json:"kind" protobuf:"bytes,1,opt,name=kind"`

	// API version, API group, or API group/version selector of the referent.
	//
	// Empty APIVersion means the core Kubernetes API version "v1".
	// Use "*" to explicitly match all API groups and versions.
	//
	// Examples:
	// - "" means core "v1".
	// - "v1" means core "v1".
	// - "apps" means any version in the "apps" API group.
	// - "apps/v1" means the "apps/v1" API group/version.
	// - "apps/*" means any version in the "apps" API group.
	//
	// +optional
	APIVersion string `json:"apiVersion,omitempty" protobuf:"bytes,5,opt,name=apiVersion"`
}

+kubebuilder:object:generate=true

func (*VersionKind) DeepCopy

func (in *VersionKind) DeepCopy() *VersionKind

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VersionKind.

func (*VersionKind) DeepCopyInto

func (in *VersionKind) DeepCopyInto(out *VersionKind)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (VersionKind) GroupVersionKind

func (s VersionKind) GroupVersionKind() schema.GroupVersionKind

func (VersionKind) HasWildcard

func (s VersionKind) HasWildcard() bool

HasWildcard returns true when APIVersion or Kind contains a wildcard matcher.

func (VersionKind) MatchesGroupVersionKind

func (s VersionKind) MatchesGroupVersionKind(gvk schema.GroupVersionKind) bool

MatchesGroupVersionKind returns true when the receiver matches the provided GVK.

Matching is exact unless the receiver contains '*'. Empty APIVersion is treated as "v1". Kind must be set. Use "*" to explicitly match all kinds.

func (VersionKind) MatchesVersionKind

func (s VersionKind) MatchesVersionKind(value VersionKind) bool

MatchesVersionKind returns true when the receiver matches another VersionKind.

The receiver is interpreted as the pattern. The provided VersionKind is interpreted as the concrete value.

type VersionKinds

type VersionKinds struct {
	// API groups or API group/version selectors of the referents.
	//
	// Empty or omitted APIGroups means the core Kubernetes API version "v1".
	// Use "*" to match all API groups and versions.
	//
	// Examples:
	// - [] or [""] means core "v1".
	// - ["v1"] means core "v1".
	// - ["apps"] means any version in the "apps" API group.
	// - ["apps/v1"] means only "apps/v1".
	// - ["apps", "batch/v1"] means any "apps" version and "batch/v1".
	// - ["*"] means all API groups and versions.
	//
	// +optional
	APIGroups []string `json:"apiGroups,omitempty"`

	// Kinds of the referents.
	//
	// Use "*" to match all kinds.
	//
	// +kubebuilder:validation:MinItems=1
	// +kubebuilder:validation:items:MinLength=1
	Kinds []string `json:"kinds"`
}

+kubebuilder:object:generate=true

func (*VersionKinds) DeepCopy

func (in *VersionKinds) DeepCopy() *VersionKinds

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VersionKinds.

func (*VersionKinds) DeepCopyInto

func (in *VersionKinds) DeepCopyInto(out *VersionKinds)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (VersionKinds) HasWildcard

func (s VersionKinds) HasWildcard() bool

func (VersionKinds) MatchesGroupVersionKind

func (s VersionKinds) MatchesGroupVersionKind(gvk schema.GroupVersionKind) bool

func (VersionKinds) NormalizedAPIGroups

func (s VersionKinds) NormalizedAPIGroups() []string

func (VersionKinds) StatusAPIGroups

func (s VersionKinds) StatusAPIGroups() []string

func (VersionKinds) ValidateKnownKinds

func (s VersionKinds) ValidateKnownKinds(mapper apimeta.RESTMapper, fieldPath string) error

ValidateKnownKinds validates concrete apiGroup/kind or apiGroupVersion/kind combinations against the RESTMapper. Wildcard API groups or wildcard kinds are intentionally skipped because they are selectors, not concrete Kubernetes resources.

func (VersionKinds) VersionKinds

func (s VersionKinds) VersionKinds() []VersionKind

Jump to

Keyboard shortcuts

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