webhook

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDependencyConflict = errors.New("dependency conflict")
View Source
var ErrInvalidObject = errors.New("validator called with unexpected object type")

Functions

This section is empty.

Types

type PackageValidatingWebhook

type PackageValidatingWebhook struct {
	client.Client
	*owners.OwnerManager
	*dependency.DependendcyManager
	// contains filtered or unexported fields
}

func (*PackageValidatingWebhook) SetupWithManager

func (p *PackageValidatingWebhook) SetupWithManager(mgr ctrl.Manager) error

func (*PackageValidatingWebhook) ValidateCreate

func (p *PackageValidatingWebhook) ValidateCreate(ctx context.Context, obj runtime.Object) (warnings admission.Warnings, err error)

ValidateCreate implements admission.CustomValidator.

func (*PackageValidatingWebhook) ValidateDelete

func (p *PackageValidatingWebhook) ValidateDelete(ctx context.Context, obj runtime.Object) (warnings admission.Warnings, err error)

ValidateDelete implements admission.CustomValidator.

A package can not be deleted if another package depends on it. This is the case if it has owner references to at least one other package. However, we do have to allow packages to be deleted if all their dependant packages are already being deleted, because the webhook is also called if a package is garbage-collected and this would lead to a dead lock otherwise: The dependant package is not deleted because of the foreground deletion finalizer and the dependency is not deleted because the dependant is not deleted.

func (*PackageValidatingWebhook) ValidateUpdate

func (p *PackageValidatingWebhook) ValidateUpdate(ctx context.Context, oldObj runtime.Object, newObj runtime.Object) (warnings admission.Warnings, err error)

ValidateUpdate implements admission.CustomValidator.

Jump to

Keyboard shortcuts

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