webhook

package
v0.16.3 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsEmptyLabelSelector

func IsEmptyLabelSelector(selector *metav1.LabelSelector) bool

IsEmptyLabelSelector checks if a selector matches everything (empty selector)

func LabelSelectorsEqual

func LabelSelectorsEqual(a, b *metav1.LabelSelector) bool

LabelSelectorsEqual checks if two metav1.LabelSelector are identical

func SchedulesOverlap

func SchedulesOverlap(a, b *lightsoutv1alpha1.LightsOutSchedule) bool

SchedulesOverlap checks if two schedules have overlapping namespace targets

func SetupWebhookWithManager

func SetupWebhookWithManager(mgr ctrl.Manager) error

SetupWebhookWithManager sets up the webhook with the manager

func ValidateRateLimit

func ValidateRateLimit(rateLimit *lightsoutv1alpha1.RateLimitConfig, fieldPath string) field.ErrorList

ValidateRateLimit validates a RateLimitConfig

func ValidateScheduleCore added in v0.14.0

func ValidateScheduleCore(core *lightsoutv1alpha1.LightsOutScheduleCore) error

ValidateScheduleCore validates the fields shared between LightsOutSchedule and LightsOutNamespaceSchedule (cron expressions, timezone, rate limits, ArgoCD config). It does NOT check namespace-selection fields, which are global-schedule-only concerns.

func ValidateScheduleSpec

func ValidateScheduleSpec(schedule *lightsoutv1alpha1.LightsOutSchedule) error

ValidateScheduleSpec validates the LightsOutSchedule spec (global, cluster-scoped). It calls ValidateScheduleCore for shared fields and additionally enforces that at least one namespace-selection field (namespaceSelector or namespaces) is set.

Types

type LightsOutNamespaceScheduleDefaulter added in v0.14.0

type LightsOutNamespaceScheduleDefaulter struct{}

LightsOutNamespaceScheduleDefaulter handles defaulting

func (*LightsOutNamespaceScheduleDefaulter) Default added in v0.14.0

Default implements admission.Defaulter

type LightsOutNamespaceScheduleValidator added in v0.14.0

type LightsOutNamespaceScheduleValidator struct {
	Client client.Client
}

LightsOutNamespaceScheduleValidator handles validation

func (*LightsOutNamespaceScheduleValidator) ValidateCreate added in v0.14.0

ValidateCreate implements admission.Validator

func (*LightsOutNamespaceScheduleValidator) ValidateDelete added in v0.14.0

ValidateDelete implements admission.Validator

func (*LightsOutNamespaceScheduleValidator) ValidateUpdate added in v0.14.0

ValidateUpdate implements admission.Validator

type LightsOutScheduleDefaulter

type LightsOutScheduleDefaulter struct{}

LightsOutScheduleDefaulter handles defaulting for LightsOutSchedule

func (*LightsOutScheduleDefaulter) Default

Default implements admission.Defaulter

type LightsOutScheduleValidator

type LightsOutScheduleValidator struct {
	Client client.Client
}

LightsOutScheduleValidator handles validation with access to the API server

func (*LightsOutScheduleValidator) ValidateCreate

ValidateCreate implements admission.Validator

func (*LightsOutScheduleValidator) ValidateDelete

ValidateDelete implements admission.Validator

func (*LightsOutScheduleValidator) ValidateUpdate

func (v *LightsOutScheduleValidator) ValidateUpdate(ctx context.Context, oldSchedule, schedule *lightsoutv1alpha1.LightsOutSchedule) (admission.Warnings, error)

ValidateUpdate implements admission.Validator

Jump to

Keyboard shortcuts

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