webhooks

package
v1.6.4-pre.3 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: Apache-2.0 Imports: 16 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const UpstreamNameIndex = "index.upstreamNames"

UpstreamNameIndex is the controller cache index over the names of the PackageRevisions each package references as an upstream. The controller registers it, and the deletion guard queries it. It is not a spec or status field.

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, policy lifecycle.Options) *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