v1alpha1

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2025 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the espejote.io v1alpha1 API group +kubebuilder:object:generate=true +groupName=espejote.io

Index

Constants

This section is empty.

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "espejote.io", Version: "v1alpha1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

This section is empty.

Types

type Admission added in v0.3.0

type Admission struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec AdmissionSpec `json:"spec,omitempty"`
}

Admission is the Schema for the Admissions API. Admission currently fully relies on cert-manager for certificate management and webhook certificate injection. See the kustomize overlays for more information. +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.status`

func (*Admission) DeepCopy added in v0.3.0

func (in *Admission) DeepCopy() *Admission

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

func (*Admission) DeepCopyInto added in v0.3.0

func (in *Admission) DeepCopyInto(out *Admission)

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

func (*Admission) DeepCopyObject added in v0.3.0

func (in *Admission) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type AdmissionList added in v0.3.0

type AdmissionList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Admission `json:"items"`
}

AdmissionList contains a list of Admission

func (*AdmissionList) DeepCopy added in v0.3.0

func (in *AdmissionList) DeepCopy() *AdmissionList

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

func (*AdmissionList) DeepCopyInto added in v0.3.0

func (in *AdmissionList) DeepCopyInto(out *AdmissionList)

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

func (*AdmissionList) DeepCopyObject added in v0.3.0

func (in *AdmissionList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type AdmissionSpec added in v0.3.0

type AdmissionSpec struct {
	// WebhookConfiguration defines the configuration for the Admission webhook.
	// Allows fine grained control over what is forwarded to the webhook.
	// Note that Admission enforces namespace isolation. The namespaceSelector field is set to the namespace of the Admission and can't be overridden.
	// There will be a ClusterAdmission in the future to allow for cluster wide admission control.
	WebhookConfiguration WebhookConfiguration `json:"webhookConfiguration,omitempty"`

	// Mutating defines if the Admission should create a MutatingWebhookConfiguration or a ValidatingWebhookConfiguration.
	Mutating bool `json:"mutating,omitempty"`

	// Template contains the Jsonnet code to decide the admission result.
	// Admission responses should be created using the `espejote.libsonnet` library.
	// `esp.ALPHA.admission.allowed("Nice job!")`, `esp.ALPHA.admission.denied("Bad job!")`, `esp.ALPHA.admission.patched("added user annotation", [jsonPatchOp("add", "/metadata/annotations/user", "tom")])` are examples of valid responses.
	// The template can reference JsonnetLibrary objects by importing them.
	// JsonnetLibrary objects have the following structure:
	// - "espejote.libsonnet": The built in library for accessing the context and trigger information.
	// - "lib/<NAME>/<KEY>" libraries in the shared library namespace. The name corresponds to the name of the JsonnetLibrary object and the key to the key in the data field.
	//   The namespace is configured at controller startup and normally points to the namespace of the controller.
	// - "<NAME>/<KEY>" libraries in the same namespace as the Admission. The name corresponds to the name of the JsonnetLibrary object and the key to the key in the data field.
	Template string `json:"template,omitempty"`
}

AdmissionSpec defines the desired state of Admission.

func (*AdmissionSpec) DeepCopy added in v0.3.0

func (in *AdmissionSpec) DeepCopy() *AdmissionSpec

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

func (*AdmissionSpec) DeepCopyInto added in v0.3.0

func (in *AdmissionSpec) DeepCopyInto(out *AdmissionSpec)

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

type ApplyOptions

type ApplyOptions struct {
	// FieldManager is the field manager to use when applying the ManagedResource
	// If not set, the field manager is set to the name of the resource with `managed-resource` prefix
	// +optional
	FieldManager string `json:"fieldManager,omitempty"`

	// Force is going to "force" Apply requests. It means user will
	// re-acquire conflicting fields owned by other people.
	// +optional
	// +kubebuilder:default=false
	Force bool `json:"force,omitempty"`

	// fieldValidation instructs the managed resource on how to handle
	// objects containing unknown or duplicate fields. Valid values are:
	// - Ignore: This will ignore any unknown fields that are silently
	// dropped from the object, and will ignore all but the last duplicate
	// field that the decoder encounters.
	// Note that Jsonnet won't allow you to add duplicate fields to an object
	// and most unregistered fields will error out in the server-side apply
	// request, even with this option set.
	// - Strict: This will fail the request with a BadRequest error if
	// any unknown fields would be dropped from the object, or if any
	// duplicate fields are present. The error returned will contain
	// all unknown and duplicate fields encountered.
	// Defaults to "Strict".
	// +kubebuilder:validation:Enum=Ignore;Strict
	// +kubebuilder:default=Strict
	// +optional
	FieldValidation string `json:"fieldValidation,omitempty"`
}

func (*ApplyOptions) DeepCopy

func (in *ApplyOptions) DeepCopy() *ApplyOptions

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

func (*ApplyOptions) DeepCopyInto

func (in *ApplyOptions) DeepCopyInto(out *ApplyOptions)

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

type ClusterResource

type ClusterResource interface {
	fmt.Stringer

	GetVersion() string
	GetGroup() string
	GetKind() string

	GetName() string
	GetNamespace() *string

	GetLabelSelector() *metav1.LabelSelector
	GetMatchNames() []string
	GetIgnoreNames() []string

	GetStripManagedFields() bool
}

+kubebuilder:object:generate=false

type ContextResource

type ContextResource struct {
	// APIVersion of the resource that should be added to the context.
	// The APIVersion can be in the form "group/version" or "version".
	APIVersion string `json:"apiVersion,omitempty"`
	// Kind of the resource that should be added to the context.
	Kind string `json:"kind,omitempty"`

	// Name of the resource that should be added to the context.
	// If not set, all resources of the specified Kind are added to the context.
	Name string `json:"name,omitempty"`
	// Namespace for the resources that should be added to the context.
	// If not set, the namespace of the ManagedResource is used.
	// Can be set to empty string to add all namespaces.
	Namespace *string `json:"namespace,omitempty"`

	// LabelSelector can be used to filter the resources that should be added to the context.
	// This is efficiently done by the Kubernetes API server
	LabelSelector *metav1.LabelSelector `json:"labelSelector,omitempty"`

	// MatchNames can be used to filter the resources that should be added to the context.
	// This is considered experimental and might be removed in the future.
	// The filtering is done on the controller side and might not be as efficient as the LabelSelector.
	// Filtered objects are dropped before any caching or processing.
	MatchNames []string `json:"matchNames,omitempty"`
	// IgnoreNames can be used to filter the resources that should be added to the context.
	// This is considered experimental and might be removed in the future.
	// The filtering is done on the controller side and might not be as efficient as the LabelSelector.
	// Filtered objects are dropped before any caching or processing.
	IgnoreNames []string `json:"ignoreNames,omitempty"`

	// StripManagedFields removes the managedFields from the watched resource.
	// managedFields are not used in Espejote and if the template does not use them, they can be removed to significantly reduce the size of cached objects.
	// Defaults to true if not set.
	// +optional
	StripManagedFields *bool `json:"stripManagedFields,omitempty"`
}

func (*ContextResource) DeepCopy

func (in *ContextResource) DeepCopy() *ContextResource

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

func (*ContextResource) DeepCopyInto

func (in *ContextResource) DeepCopyInto(out *ContextResource)

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

func (ContextResource) GetGroup

func (t ContextResource) GetGroup() string

func (ContextResource) GetIgnoreNames

func (t ContextResource) GetIgnoreNames() []string

func (ContextResource) GetKind

func (t ContextResource) GetKind() string

func (ContextResource) GetLabelSelector

func (t ContextResource) GetLabelSelector() *metav1.LabelSelector

func (ContextResource) GetMatchNames

func (t ContextResource) GetMatchNames() []string

func (ContextResource) GetName

func (t ContextResource) GetName() string

func (ContextResource) GetNamespace

func (t ContextResource) GetNamespace() *string

func (ContextResource) GetStripManagedFields added in v0.2.0

func (t ContextResource) GetStripManagedFields() bool

func (ContextResource) GetVersion

func (t ContextResource) GetVersion() string

func (ContextResource) String

func (t ContextResource) String() string

type JsonnetLibrary

type JsonnetLibrary struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec JsonnetLibrarySpec `json:"spec,omitempty"`
}

JsonnetLibrary is the Schema for the jsonnetlibraries API.

func (*JsonnetLibrary) DeepCopy

func (in *JsonnetLibrary) DeepCopy() *JsonnetLibrary

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

func (*JsonnetLibrary) DeepCopyInto

func (in *JsonnetLibrary) DeepCopyInto(out *JsonnetLibrary)

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

func (*JsonnetLibrary) DeepCopyObject

func (in *JsonnetLibrary) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type JsonnetLibraryList

type JsonnetLibraryList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []JsonnetLibrary `json:"items"`
}

JsonnetLibraryList contains a list of JsonnetLibrary.

func (*JsonnetLibraryList) DeepCopy

func (in *JsonnetLibraryList) DeepCopy() *JsonnetLibraryList

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

func (*JsonnetLibraryList) DeepCopyInto

func (in *JsonnetLibraryList) DeepCopyInto(out *JsonnetLibraryList)

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

func (*JsonnetLibraryList) DeepCopyObject

func (in *JsonnetLibraryList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type JsonnetLibrarySpec

type JsonnetLibrarySpec struct {
	// Data is a map of Jsonnet library files.
	// The key is the file name and the value is the file content.
	Data map[string]string `json:"data,omitempty"`
}

JsonnetLibrarySpec defines the desired state of JsonnetLibrary.

func (*JsonnetLibrarySpec) DeepCopy

func (in *JsonnetLibrarySpec) DeepCopy() *JsonnetLibrarySpec

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

func (*JsonnetLibrarySpec) DeepCopyInto

func (in *JsonnetLibrarySpec) DeepCopyInto(out *JsonnetLibrarySpec)

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

type ManagedResource

type ManagedResource struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   ManagedResourceSpec   `json:"spec,omitempty"`
	Status ManagedResourceStatus `json:"status,omitempty"`
}

ManagedResource is the Schema for the ManagedResources API +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.status`

func (*ManagedResource) DeepCopy

func (in *ManagedResource) DeepCopy() *ManagedResource

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

func (*ManagedResource) DeepCopyInto

func (in *ManagedResource) DeepCopyInto(out *ManagedResource)

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

func (*ManagedResource) DeepCopyObject

func (in *ManagedResource) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ManagedResourceContext

type ManagedResourceContext struct {
	// Name is the name of the context definition. The context can be referenced in the template by this name.
	// +kubebuilder:validation:MinLength=1
	Name string `json:"name"`

	// Resource defines the resource that should be added to the context.
	// Adds a list of zero or more resources to the context.
	Resource ContextResource `json:"resource,omitempty"`
}

func (*ManagedResourceContext) DeepCopy

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

func (*ManagedResourceContext) DeepCopyInto

func (in *ManagedResourceContext) DeepCopyInto(out *ManagedResourceContext)

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

type ManagedResourceList

type ManagedResourceList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []ManagedResource `json:"items"`
}

ManagedResourceList contains a list of ManagedResource

func (*ManagedResourceList) DeepCopy

func (in *ManagedResourceList) DeepCopy() *ManagedResourceList

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

func (*ManagedResourceList) DeepCopyInto

func (in *ManagedResourceList) DeepCopyInto(out *ManagedResourceList)

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

func (*ManagedResourceList) DeepCopyObject

func (in *ManagedResourceList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ManagedResourceSpec

type ManagedResourceSpec struct {
	// Triggers define the resources that trigger the reconciliation of the ManagedResource
	// Trigger information will be injected when rendering the template.
	// This can be used to only partially render the template based on the trigger.
	// +optional
	Triggers []ManagedResourceTrigger `json:"triggers,omitempty"`
	// Context defines the context for the ManagedResource
	Context []ManagedResourceContext `json:"context,omitempty"`

	// ServiceAccountRef is the service account this managed resource runs as.
	// The service account must have the necessary permissions to manage the resources referenced in the template.
	// If not set, the namespace's default service account is used.
	// +kubebuilder:default={"name": "default"}
	ServiceAccountRef corev1.LocalObjectReference `json:"serviceAccountRef,omitempty"`

	// Template defines the template for the ManagedResource
	// The template is rendered using Jsonnet and the result is applied to the cluster.
	// The template can reference the context and trigger information.
	// All access to injected data should be done through the `espejote.libsonnet` import.
	// The template can reference JsonnetLibrary objects by importing them.
	// JsonnetLibrary objects have the following structure:
	// - "espejote.libsonnet": The built in library for accessing the context and trigger information.
	// - "lib/<NAME>/<KEY>" libraries in the shared library namespace. The name corresponds to the name of the JsonnetLibrary object and the key to the key in the data field.
	//   The namespace is configured at controller startup and normally points to the namespace of the controller.
	// - "<NAME>/<KEY>" libraries in the same namespace as the ManagedResource. The name corresponds to the name of the JsonnetLibrary object and the key to the key in the data field.
	// The template can return a single object, a list of objects, or null. Everything else is considered an error.
	// Namespaced objects default to the namespace of the ManagedResource.
	Template string `json:"template,omitempty"`

	// ApplyOptions defines the options for applying the ManagedResource
	ApplyOptions ApplyOptions `json:"applyOptions,omitempty"`
}

ManagedResourceSpec defines the desired state of ManagedResource

func (*ManagedResourceSpec) DeepCopy

func (in *ManagedResourceSpec) DeepCopy() *ManagedResourceSpec

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

func (*ManagedResourceSpec) DeepCopyInto

func (in *ManagedResourceSpec) DeepCopyInto(out *ManagedResourceSpec)

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

type ManagedResourceStatus

type ManagedResourceStatus struct {
	// Status reports the last overall status of the ManagedResource
	// More information can be found by inspecting the ManagedResource's events with either `kubectl describe` or `kubectl get events`.
	Status string `json:"status,omitempty"`
}

ManagedResourceStatus defines the observed state of ManagedResource

func (*ManagedResourceStatus) DeepCopy

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

func (*ManagedResourceStatus) DeepCopyInto

func (in *ManagedResourceStatus) DeepCopyInto(out *ManagedResourceStatus)

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

type ManagedResourceTrigger

type ManagedResourceTrigger struct {
	// Name is the name of the trigger. The trigger can be referenced in the template by this name.
	// +kubebuilder:validation:MinLength=1
	Name string `json:"name"`

	// Interval defines the interval at which the ManagedResource should be reconciled.
	// +kubebuilder:validation:Format=duration
	Interval metav1.Duration `json:"interval,omitempty"`

	// WatchResource defines one or multiple resources that trigger the reconciliation of the ManagedResource.
	// Resource information is injected when rendering the template and can be retrieved using `(import "espejote.libsonnet").getTrigger()`.
	// `local esp = import "espejote.libsonnet"; esp.triggerType() == esp.TriggerTypeWatchResource` will be true if the render was triggered by a definition in this block.
	// +optional
	WatchResource TriggerWatchResource `json:"watchResource,omitempty"`

	// WatchContextResource works the same as WatchResource, but it uses and already existing context resource.
	// This is useful when you require both full (when the template changes) and partial (a context resource changes) reconciliation of the same resource.
	// Check the example below. Both a context resource and a trigger are defined. If the trigger is not known in the template all network policies are reconciled.
	// If the trigger is known, only the network policies that match the trigger are reconciled. Using `watchContextResource` allows this without having to define the same resource again.
	//
	//   apiVersion: espejote.io/v1alpha1
	//   kind: ManagedResource
	//   metadata:
	//     name: naemspace-default-netpol
	//     annotations:
	//       description: |
	//         Injects a default network policy into every namespace not labeled `netpol.example.com/no-default`.
	//   spec:
	//     context:
	//     - name: namespaces
	//       resource:
	//         apiVersion: v1
	//         kind: Namespace
	//         labelSelector:
	//           matchExpressions:
	//           - key: netpol.example.com/no-default
	//             operator: DoesNotExist
	//     triggers:
	//     - name: namespace
	//       watchContextResource:
	//         name: namespaces
	//     template: |
	//       local esp = import 'espejote.libsonnet';
	//
	//       local netpolForNs = function(ns) {
	//         [...]
	//       };
	//
	//       if esp.triggerName() == 'namespace' then [
	//         netpolForNs(esp.triggerData().resource),
	//       ] else [
	//         netpolForNs(ns)
	//         for ns in esp.context().namespaces
	//       ]
	WatchContextResource WatchContextResource `json:"watchContextResource,omitempty"`
}

func (*ManagedResourceTrigger) DeepCopy

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

func (*ManagedResourceTrigger) DeepCopyInto

func (in *ManagedResourceTrigger) DeepCopyInto(out *ManagedResourceTrigger)

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

type TriggerWatchResource

type TriggerWatchResource struct {
	// APIVersion of the resource that should be watched.
	// The APIVersion can be in the form "group/version" or "version".
	APIVersion string `json:"apiVersion,omitempty"`
	// Kind of the resource that should be watched.
	Kind string `json:"kind,omitempty"`

	// Name of the resource that should be watched.
	// If not set, all resources of the specified Kind are watched.
	Name string `json:"name,omitempty"`
	// Namespace for the resources that should be watched.
	// If not set, the namespace of the ManagedResource is used.
	// Can be explicitly set to empty string to watch all namespaces.
	Namespace *string `json:"namespace,omitempty"`

	// LabelSelector can be used to filter the resources that should be watched.
	// This is efficiently done by the Kubernetes API server
	LabelSelector *metav1.LabelSelector `json:"labelSelector,omitempty"`

	// MatchNames can be used to filter the resources that should be watched.
	// This is considered experimental and might be removed in the future.
	// The filtering is done on the controller side and might not be as efficient as the LabelSelector.
	// Filtered objects are dropped before any caching or processing.
	MatchNames []string `json:"matchNames,omitempty"`
	// IgnoreNames can be used to filter the resources that should be watched.
	// This is considered experimental and might be removed in the future.
	// The filtering is done on the controller side and might not be as efficient as the LabelSelector.
	// Filtered objects are dropped before any caching or processing.
	IgnoreNames []string `json:"ignoreNames,omitempty"`

	// StripManagedFields removes the managedFields from the watched resource.
	// managedFields are not used in Espejote and if the template does not use them, they can be removed to significantly reduce the size of cached objects.
	// Defaults to true if not set.
	// +optional
	StripManagedFields *bool `json:"stripManagedFields,omitempty"`
}

func (*TriggerWatchResource) DeepCopy

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

func (*TriggerWatchResource) DeepCopyInto

func (in *TriggerWatchResource) DeepCopyInto(out *TriggerWatchResource)

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

func (TriggerWatchResource) GetGroup

func (t TriggerWatchResource) GetGroup() string

func (TriggerWatchResource) GetIgnoreNames

func (t TriggerWatchResource) GetIgnoreNames() []string

func (TriggerWatchResource) GetKind

func (t TriggerWatchResource) GetKind() string

func (TriggerWatchResource) GetLabelSelector

func (t TriggerWatchResource) GetLabelSelector() *metav1.LabelSelector

func (TriggerWatchResource) GetMatchNames

func (t TriggerWatchResource) GetMatchNames() []string

func (TriggerWatchResource) GetName

func (t TriggerWatchResource) GetName() string

func (TriggerWatchResource) GetNamespace

func (t TriggerWatchResource) GetNamespace() *string

func (TriggerWatchResource) GetStripManagedFields added in v0.2.0

func (t TriggerWatchResource) GetStripManagedFields() bool

func (TriggerWatchResource) GetVersion

func (t TriggerWatchResource) GetVersion() string

func (TriggerWatchResource) String

func (t TriggerWatchResource) String() string

type WatchContextResource added in v0.5.0

type WatchContextResource struct {
	// Name is the name of the context definition used when creating this trigger.
	Name string `json:"name,omitempty"`
}

func (*WatchContextResource) DeepCopy added in v0.5.0

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

func (*WatchContextResource) DeepCopyInto added in v0.5.0

func (in *WatchContextResource) DeepCopyInto(out *WatchContextResource)

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

type WebhookConfiguration added in v0.3.0

type WebhookConfiguration struct {
	// Rules describes what operations on what resources/subresources the webhook cares about.
	// The webhook cares about an operation if it matches _any_ Rule.
	// However, in order to prevent ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks
	// from putting the cluster in a state which cannot be recovered from without completely
	// disabling the plugin, ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks are never called
	// on admission requests for ValidatingWebhookConfiguration and MutatingWebhookConfiguration objects.
	// +listType=atomic
	Rules []admissionregistrationv1.RuleWithOperations `json:"rules,omitempty" protobuf:"bytes,3,rep,name=rules"`

	// FailurePolicy defines how unrecognized errors from the admission endpoint are handled -
	// allowed values are Ignore or Fail. Defaults to Fail.
	// +optional
	FailurePolicy *admissionregistrationv1.FailurePolicyType `json:"failurePolicy,omitempty" protobuf:"bytes,4,opt,name=failurePolicy,casttype=FailurePolicyType"`

	// matchPolicy defines how the "rules" list is used to match incoming requests.
	// Allowed values are "Exact" or "Equivalent".
	//
	// - Exact: match a request only if it exactly matches a specified rule.
	// For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1,
	// but "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`,
	// a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the webhook.
	//
	// - Equivalent: match a request if modifies a resource listed in rules, even via another API group or version.
	// For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1,
	// and "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`,
	// a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the webhook.
	//
	// Defaults to "Equivalent"
	// +optional
	MatchPolicy *admissionregistrationv1.MatchPolicyType `json:"matchPolicy,omitempty" protobuf:"bytes,9,opt,name=matchPolicy,casttype=MatchPolicyType"`

	// ObjectSelector decides whether to run the webhook based on if the
	// object has matching labels. objectSelector is evaluated against both
	// the oldObject and newObject that would be sent to the webhook, and
	// is considered to match if either object matches the selector. A null
	// object (oldObject in the case of create, or newObject in the case of
	// delete) or an object that cannot have labels (like a
	// DeploymentRollback or a PodProxyOptions object) is not considered to
	// match.
	// Use the object selector only if the webhook is opt-in, because end
	// users may skip the admission webhook by setting the labels.
	// Default to the empty LabelSelector, which matches everything.
	// +optional
	ObjectSelector *metav1.LabelSelector `json:"objectSelector,omitempty" protobuf:"bytes,11,opt,name=objectSelector"`

	// reinvocationPolicy indicates whether this webhook should be called multiple times as part of a single admission evaluation.
	// Allowed values are "Never" and "IfNeeded".
	//
	// Never: the webhook will not be called more than once in a single admission evaluation.
	//
	// IfNeeded: the webhook will be called at least one additional time as part of the admission evaluation
	// if the object being admitted is modified by other admission plugins after the initial webhook call.
	// Webhooks that specify this option *must* be idempotent, able to process objects they previously admitted.
	// Note:
	// * the number of additional invocations is not guaranteed to be exactly one.
	// * if additional invocations result in further modifications to the object, webhooks are not guaranteed to be invoked again.
	// * webhooks that use this option may be reordered to minimize the number of additional invocations.
	// * to validate an object after all mutations are guaranteed complete, use a validating admission webhook instead.
	//
	// Defaults to "Never".
	// +optional
	ReinvocationPolicy *admissionregistrationv1.ReinvocationPolicyType `json:"reinvocationPolicy,omitempty" protobuf:"bytes,10,opt,name=reinvocationPolicy,casttype=ReinvocationPolicyType"`

	// MatchConditions is a list of conditions that must be met for a request to be sent to this
	// webhook. Match conditions filter requests that have already been matched by the rules,
	// namespaceSelector, and objectSelector. An empty list of matchConditions matches all requests.
	// There are a maximum of 64 match conditions allowed.
	//
	// The exact matching logic is (in order):
	//   1. If ANY matchCondition evaluates to FALSE, the webhook is skipped.
	//   2. If ALL matchConditions evaluate to TRUE, the webhook is called.
	//   3. If any matchCondition evaluates to an error (but none are FALSE):
	//      - If failurePolicy=Fail, reject the request
	//      - If failurePolicy=Ignore, the error is ignored and the webhook is skipped
	//
	// +patchMergeKey=name
	// +patchStrategy=merge
	// +listType=map
	// +listMapKey=name
	// +optional
	MatchConditions []admissionregistrationv1.MatchCondition `json:"matchConditions,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,12,opt,name=matchConditions"`
}

func (*WebhookConfiguration) DeepCopy added in v0.3.0

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

func (*WebhookConfiguration) DeepCopyInto added in v0.3.0

func (in *WebhookConfiguration) DeepCopyInto(out *WebhookConfiguration)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳