webhooks

package
v1.6.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PackageRevisionValidator

type PackageRevisionValidator struct {
	// contains filtered or unexported fields
}

PackageRevisionValidator validates v1alpha2 PackageRevision CRDs. It enforces all CREATE, UPDATE, and DELETE validation rules per the spec.

func NewPackageRevisionValidator

func NewPackageRevisionValidator(client client.Reader) *PackageRevisionValidator

NewPackageRevisionValidator creates a new PackageRevisionValidator.

func (*PackageRevisionValidator) Handle

Handle implements the admission.Handler interface for webhook registration. It dispatches to the validator's methods based on the operation type.

func (*PackageRevisionValidator) ValidateCreate

ValidateCreate validates creation of a PackageRevision. Repo-discovered packages (Source == nil) can have any lifecycle (determined from git refs). User-created packages (Source != nil) must have Draft or Proposed lifecycle on CREATE.

func (*PackageRevisionValidator) ValidateDelete

ValidateDelete validates deletion of a PackageRevision. Check ordering:

  1. DeletionTimestamp (K8s GC already accepted a prior DELETE) - allow
  2. Upstream references (data integrity) - block if dependents exist
  3. Published lifecycle - block unless owner repo is gone (cascade deletion)

func (*PackageRevisionValidator) ValidateUpdate

func (v *PackageRevisionValidator) ValidateUpdate(ctx context.Context, oldObj, newObj *v1alpha2.PackageRevision) (admission.Warnings, error)

ValidateUpdate validates updates to a PackageRevision.

Jump to

Keyboard shortcuts

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