Documentation ¶
Index ¶
- Variables
- type PackageValidatingWebhook
- func (p *PackageValidatingWebhook) SetupWithManager(mgr ctrl.Manager) error
- func (p *PackageValidatingWebhook) ValidateCreate(ctx context.Context, obj runtime.Object) (warnings admission.Warnings, err error)
- func (p *PackageValidatingWebhook) ValidateDelete(ctx context.Context, obj runtime.Object) (warnings admission.Warnings, err error)
- func (p *PackageValidatingWebhook) ValidateUpdate(ctx context.Context, oldObj runtime.Object, newObj runtime.Object) (warnings admission.Warnings, err error)
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.
Click to show internal directories.
Click to hide internal directories.