Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type K8sRegistry ¶
type K8sRegistry struct {
// contains filtered or unexported fields
}
K8sRegistry allows registering k8s webhooks as validators.
func (*K8sRegistry) RegisterValidator ¶
func (r *K8sRegistry) RegisterValidator(path string, validator Validator)
RegisterValidator adds a validator to be handled on a given HTTP path
This function should be only called before Start phase.
type Validator ¶
type Validator interface {
// ValidateObject validates an object given in admission.Request
//
// returns:
// * true, "", nil if object passes validation
// * false, msg, nil if object fails validation
// * false, "", err if validator itself fails
//
// Note: if validator is "not interested" in a given object, it should
// return true.
ValidateObject(
ctx context.Context,
req *admissionv1.AdmissionRequest,
) (ok bool, msg string, err error)
}
Validator is an interface for k8s validating webhooks.
Click to show internal directories.
Click to hide internal directories.