Help us shape the future of Go! Take the 2026 Go Developer Survey

v1alpha1

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the addons v1alpha1 API group. +kubebuilder:object:generate=true +groupName=addons.projectcapsule.dev

Index

Constants

View Source
const ConditionReady = "Ready"

Variables

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

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme.
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)

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

Functions

This section is empty.

Types

type ActionStep

type ActionStep struct {
	Apply Apply `json:"apply"`
}

func (*ActionStep) DeepCopy

func (in *ActionStep) DeepCopy() *ActionStep

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

func (*ActionStep) DeepCopyInto

func (in *ActionStep) DeepCopyInto(out *ActionStep)

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

type AdmissionConfig

type AdmissionConfig struct {
	// +listType=map
	// +listMapKey=name
	// +kubebuilder:validation:MaxItems=32
	// +optional
	Warnings []AdmissionWarning `json:"warnings,omitempty"`
}

func (*AdmissionConfig) DeepCopy

func (in *AdmissionConfig) DeepCopy() *AdmissionConfig

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

func (*AdmissionConfig) DeepCopyInto

func (in *AdmissionConfig) DeepCopyInto(out *AdmissionConfig)

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

type AdmissionRule

type AdmissionRule struct {
	// +kubebuilder:validation:MinLength=1
	Name         string `json:"name"`
	RequestMatch `json:",inline"`
	// +kubebuilder:validation:Enum=Active;Inactive
	// +kubebuilder:default=Active
	When string `json:"when,omitempty"`
	// +kubebuilder:validation:Enum=Deny
	// +kubebuilder:default=Deny
	Action string `json:"action,omitempty"`
	// Message is a Go template with target and window context.
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=4096
	Message string `json:"message"`
}

func (*AdmissionRule) DeepCopy

func (in *AdmissionRule) DeepCopy() *AdmissionRule

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

func (*AdmissionRule) DeepCopyInto

func (in *AdmissionRule) DeepCopyInto(out *AdmissionRule)

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

type AdmissionWarning

type AdmissionWarning struct {
	// +kubebuilder:validation:MinLength=1
	Name         string `json:"name"`
	RequestMatch `json:",inline"`
	// +kubebuilder:validation:Enum=BeforeStart;Active;BeforeEnd
	When string `json:"when"`
	// Within is required for BeforeStart/BeforeEnd and must be positive, at most 168h.
	// +optional
	Within *metav1.Duration `json:"within,omitempty"`
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=4096
	Message string `json:"message"`
}

func (*AdmissionWarning) DeepCopy

func (in *AdmissionWarning) DeepCopy() *AdmissionWarning

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

func (*AdmissionWarning) DeepCopyInto

func (in *AdmissionWarning) DeepCopyInto(out *AdmissionWarning)

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

type Apply

type Apply struct {
	// Subresource is an actual Kubernetes subresource, e.g. scale (not rollout).
	// +optional
	Subresource string `json:"subresource,omitempty"`
	// Force explicitly transfers ownership of conflicting fields.
	// +optional
	Force bool `json:"force,omitempty"`
	// Template renders a partial YAML/JSON object. Identity is supplied by the controller.
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=65536
	Template string `json:"template"`
}

func (*Apply) DeepCopy

func (in *Apply) DeepCopy() *Apply

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

func (*Apply) DeepCopyInto

func (in *Apply) DeepCopyInto(out *Apply)

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

type Audience

type Audience struct {
	// +kubebuilder:validation:MaxItems=64
	// +listType=atomic
	// +optional
	Include []Subject `json:"include,omitempty"`
	// +kubebuilder:validation:MaxItems=64
	// +listType=atomic
	// +optional
	Exclude []Subject `json:"exclude,omitempty"`
}

Audience matches any include subject unless any exclude subject matches. Empty include matches everyone. Subjects are exact, case-sensitive identities; matching a subject does not grant RBAC permissions.

func (*Audience) DeepCopy

func (in *Audience) DeepCopy() *Audience

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

func (*Audience) DeepCopyInto

func (in *Audience) DeepCopyInto(out *Audience)

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

type Capture

type Capture struct {
	// +optional
	Subresource string `json:"subresource,omitempty"`
	// Path is an RFC 6901 JSON pointer.
	// +kubebuilder:validation:Pattern="^/"
	Path string `json:"path"`
}

func (*Capture) DeepCopy

func (in *Capture) DeepCopy() *Capture

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

func (*Capture) DeepCopyInto

func (in *Capture) DeepCopyInto(out *Capture)

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

type ChangeWindow

type ChangeWindow struct {
	metav1.TypeMeta `json:",inline"`
	// +optional
	metav1.ObjectMeta `json:"metadata,omitzero"`
	Spec              ChangeWindowSpec `json:"spec"`
	// +optional
	Status ChangeWindowStatus `json:"status,omitzero"`
}

ChangeWindow describes scheduled resource changes and admission restrictions.

func (*ChangeWindow) DeepCopy

func (in *ChangeWindow) DeepCopy() *ChangeWindow

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

func (*ChangeWindow) DeepCopyInto

func (in *ChangeWindow) DeepCopyInto(out *ChangeWindow)

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

func (*ChangeWindow) DeepCopyObject

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

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

type ChangeWindowList

type ChangeWindowList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitzero"`
	Items           []ChangeWindow `json:"items"`
}

func (*ChangeWindowList) DeepCopy

func (in *ChangeWindowList) DeepCopy() *ChangeWindowList

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

func (*ChangeWindowList) DeepCopyInto

func (in *ChangeWindowList) DeepCopyInto(out *ChangeWindowList)

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

func (*ChangeWindowList) DeepCopyObject

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

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

type ChangeWindowSpec

type ChangeWindowSpec struct {
	// NamespaceSelectors are ORed for namespaced targets. Required when any target is namespaced.
	// Omit for Node-only windows; Node targets use their own label selector.
	// An explicit empty selector matches all non-protected namespaces.
	// +kubebuilder:validation:MinItems=1
	// +kubebuilder:validation:MaxItems=16
	// +optional
	NamespaceSelectors []metav1.LabelSelector `json:"namespaceSelectors,omitempty"`
	// Schedules form a union of overlapping and adjacent windows.
	// +listType=map
	// +listMapKey=name
	// +kubebuilder:validation:MinItems=1
	// +kubebuilder:validation:MaxItems=16
	Schedules []Schedule `json:"schedules"`
	// +listType=map
	// +listMapKey=name
	// +kubebuilder:validation:MinItems=1
	// +kubebuilder:validation:MaxItems=32
	Targets []Target `json:"targets"`
	// ServiceAccount is the identity used for resource reads and SSA writes.
	// +optional
	ServiceAccount *ServiceAccountReference `json:"serviceAccount,omitempty"`
	// +listType=map
	// +listMapKey=name
	// +kubebuilder:validation:MaxItems=16
	// +optional
	Actions []ResourceAction `json:"actions,omitempty"`
	// +listType=map
	// +listMapKey=name
	// +kubebuilder:validation:MaxItems=32
	// +optional
	Admission []AdmissionRule `json:"admission,omitempty"`
	// +optional
	Config Config `json:"config,omitempty"`
}

ChangeWindowSpec selects namespaces and resources for scheduled behavior. +kubebuilder:validation:XValidation:rule="!has(self.actions) || size(self.actions) == 0 || has(self.serviceAccount)",message="actions require a serviceAccount"

func (*ChangeWindowSpec) DeepCopy

func (in *ChangeWindowSpec) DeepCopy() *ChangeWindowSpec

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

func (*ChangeWindowSpec) DeepCopyInto

func (in *ChangeWindowSpec) DeepCopyInto(out *ChangeWindowSpec)

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

type ChangeWindowStatus

type ChangeWindowStatus struct {
	// +optional
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`
	// +optional
	Active bool `json:"active,omitempty"`
	// +optional
	WindowStart *metav1.Time `json:"windowStart,omitempty"`
	// WindowEnd is absent when the effective end is beyond the bounded scheduling horizon.
	// +optional
	WindowEnd *metav1.Time `json:"windowEnd,omitempty"`
	// +optional
	NextTransition *metav1.Time `json:"nextTransition,omitempty"`
	// PendingResources counts journal entries still requiring completion.
	// +optional
	PendingResources int32 `json:"pendingResources,omitempty"`
	// +listType=map
	// +listMapKey=type
	// +optional
	Conditions []metav1.Condition `json:"conditions,omitempty"`
}

func (*ChangeWindowStatus) DeepCopy

func (in *ChangeWindowStatus) DeepCopy() *ChangeWindowStatus

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

func (*ChangeWindowStatus) DeepCopyInto

func (in *ChangeWindowStatus) DeepCopyInto(out *ChangeWindowStatus)

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

type Config

type Config struct {
	// +optional
	Admission AdmissionConfig `json:"admission,omitempty"`
}

func (*Config) DeepCopy

func (in *Config) DeepCopy() *Config

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

func (*Config) DeepCopyInto

func (in *Config) DeepCopyInto(out *Config)

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

type MatchCondition

type MatchCondition struct {
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=63
	// +kubebuilder:validation:Pattern="^[a-z0-9]([-a-z0-9]*[a-z0-9])?$"
	Name string `json:"name"`
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=4096
	Expression string `json:"expression"`
}

MatchCondition is a named CEL boolean expression compiled with the policy.

func (*MatchCondition) DeepCopy

func (in *MatchCondition) DeepCopy() *MatchCondition

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

func (*MatchCondition) DeepCopyInto

func (in *MatchCondition) DeepCopyInto(out *MatchCondition)

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

type RequestMatch

type RequestMatch struct {
	// +kubebuilder:validation:MinItems=1
	Targets []string `json:"targets"`
	// +kubebuilder:validation:MinItems=1
	// +kubebuilder:validation:items:Enum=CREATE;UPDATE;DELETE
	Operations []string `json:"operations"`
	// Subresources defaults to the parent resource only. Use "scale" for /scale,
	// "*" for all subresources, and ["", "*"] for parent and subresource writes.
	// +optional
	Subresources []string `json:"subresources,omitempty"`
	// Audience selects authenticated request identities. Omitted or empty means everyone.
	// +optional
	Audience *Audience `json:"audience,omitempty"`
	// MatchConditions are ANDed CEL expressions. An empty list matches all requests.
	// A false result skips this entry. Evaluation errors fail closed for denial rules;
	// warning errors return a diagnostic warning without denying the request.
	// Variables: object, oldObject, request, namespaceObject. Objects are the actual
	// admission payloads (e.g. Scale for /scale); absent objects are null.
	// +listType=map
	// +listMapKey=name
	// +kubebuilder:validation:MaxItems=64
	// +optional
	MatchConditions []MatchCondition `json:"matchConditions,omitempty"`
}

RequestMatch restricts every admission rule and warning by request, identity and CEL conditions.

func (*RequestMatch) DeepCopy

func (in *RequestMatch) DeepCopy() *RequestMatch

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

func (*RequestMatch) DeepCopyInto

func (in *RequestMatch) DeepCopyInto(out *RequestMatch)

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

type ResourceAction

type ResourceAction struct {
	// +kubebuilder:validation:MinLength=1
	Name string `json:"name"`
	// +kubebuilder:validation:MinItems=1
	Targets []string `json:"targets"`
	// Capture stores only explicitly selected JSON pointer values before any mutation.
	// +kubebuilder:validation:MaxProperties=32
	// +optional
	Capture map[string]Capture `json:"capture,omitempty"`
	// +optional
	OnStart *ActionStep `json:"onStart,omitempty"`
	// +optional
	OnEnd *ActionStep `json:"onEnd,omitempty"`
}

func (*ResourceAction) DeepCopy

func (in *ResourceAction) DeepCopy() *ResourceAction

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

func (*ResourceAction) DeepCopyInto

func (in *ResourceAction) DeepCopyInto(out *ResourceAction)

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

type Schedule

type Schedule struct {
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=63
	Name string `json:"name"`
	// Cron is a standard five-field cron expression; seconds and TZ prefixes are not accepted.
	// +kubebuilder:validation:MaxLength=256
	Cron string `json:"cron"`
	// +kubebuilder:default=UTC
	TimeZone string `json:"timeZone,omitempty"`
	// Duration is elapsed time, greater than zero and at most 168h.
	Duration metav1.Duration `json:"duration"`
}

func (*Schedule) DeepCopy

func (in *Schedule) DeepCopy() *Schedule

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

func (*Schedule) DeepCopyInto

func (in *Schedule) DeepCopyInto(out *Schedule)

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

type ServiceAccountReference

type ServiceAccountReference struct {
	// +kubebuilder:validation:MinLength=1
	Namespace string `json:"namespace"`
	// +kubebuilder:validation:MinLength=1
	Name string `json:"name"`
}

func (*ServiceAccountReference) DeepCopy

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

func (*ServiceAccountReference) DeepCopyInto

func (in *ServiceAccountReference) DeepCopyInto(out *ServiceAccountReference)

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

type Subject

type Subject struct {
	// +kubebuilder:validation:Enum=User;Group;ServiceAccount
	Kind string `json:"kind"`
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=256
	Name string `json:"name"`
	// Namespace is mandatory for ServiceAccounts and forbidden for Users and Groups.
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=63
	// +optional
	Namespace string `json:"namespace,omitempty"`
}

Subject identifies an authenticated user, group, or namespaced service account. +kubebuilder:validation:XValidation:rule="(self.kind == 'ServiceAccount') == has(self.namespace)",message="namespace is required only for ServiceAccount subjects"

func (*Subject) DeepCopy

func (in *Subject) DeepCopy() *Subject

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

func (*Subject) DeepCopyInto

func (in *Subject) DeepCopyInto(out *Subject)

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

type Target

type Target struct {
	// +kubebuilder:validation:MinLength=1
	Name string `json:"name"`
	// APIVersion uses Capsule GVK matching: omitted/empty means core v1;
	// apps matches any apps version, apps/v1 is exact, and * matches all groups
	// and versions. Partial patterns such as apps/* and *.example.com/v1 work too.
	// +kubebuilder:validation:MaxLength=256
	// +optional
	APIVersion string `json:"apiVersion,omitempty"`
	// Kind is case-sensitive and supports * patterns, for example *Set or Deploy*.
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=256
	Kind string `json:"kind"`
	// Selector selects resource labels. For Nodes it selects nodes directly;
	// for namespaced targets it applies within the selected namespaces.
	// +optional
	Selector metav1.LabelSelector `json:"selector,omitempty"`
}

Target selects a resource kind and labels. Admission targets support Capsule GVK patterns and match namespaced resources only, except concrete v1 Node targets. Scheduled actions require a concrete namespaced apiVersion and kind.

func (*Target) DeepCopy

func (in *Target) DeepCopy() *Target

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

func (*Target) DeepCopyInto

func (in *Target) DeepCopyInto(out *Target)

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