Documentation
¶
Index ¶
- Constants
- func DescribeExpressionMatch(match ExpressionMatch) string
- type ExpressionMatch
- func (in *ExpressionMatch) DeepCopy() *ExpressionMatch
- func (in *ExpressionMatch) DeepCopyInto(out *ExpressionMatch)
- func (m ExpressionMatch) Describe() string
- func (m ExpressionMatch) Matches(value string) (bool, error)
- func (m ExpressionMatch) MatchesWithExpressionMatcher(matcher ExpressionRegexMatcher, value string) (bool, error)
- type ExpressionRegex
- type ExpressionRegexMatcher
- type VersionKind
- func (in *VersionKind) DeepCopy() *VersionKind
- func (in *VersionKind) DeepCopyInto(out *VersionKind)
- func (s VersionKind) GroupVersionKind() schema.GroupVersionKind
- func (s VersionKind) HasWildcard() bool
- func (s VersionKind) MatchesGroupVersionKind(gvk schema.GroupVersionKind) bool
- func (s VersionKind) MatchesVersionKind(value VersionKind) bool
- type VersionKinds
- func (in *VersionKinds) DeepCopy() *VersionKinds
- func (in *VersionKinds) DeepCopyInto(out *VersionKinds)
- func (s VersionKinds) HasWildcard() bool
- func (s VersionKinds) MatchesGroupVersionKind(gvk schema.GroupVersionKind) bool
- func (s VersionKinds) NormalizedAPIGroups() []string
- func (s VersionKinds) StatusAPIGroups() []string
- func (s VersionKinds) ValidateKnownKinds(mapper apimeta.RESTMapper, fieldPath string) error
- func (s VersionKinds) VersionKinds() []VersionKind
Constants ¶
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) MatchesWithExpressionMatcher ¶
func (m ExpressionMatch) MatchesWithExpressionMatcher( matcher ExpressionRegexMatcher, value string, ) (bool, error)
type ExpressionRegex ¶
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