Documentation
¶
Overview ¶
Package webhook serves the admission endpoint that checks a CustomResourceProjection before the cluster accepts it.
Index ¶
Constants ¶
const Path = "/admission/customresourceprojections"
Path is where the projection webhook is served.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Checker ¶
type Checker interface {
Check(ctx context.Context, p *crispv1alpha1.CustomResourceProjection) error
}
Checker answers whether a projection could be served. dynamic.Compiler is the implementation, which is what keeps this from being able to accept something the server would then refuse.
type Handler ¶
type Handler struct {
Checker Checker
}
Handler validates CustomResourceProjection objects at admission.
This exists because the status condition arrives too late to be useful. A projection whose SQL has outlived its schema compiles, reports CompilationFailed, and is not served — but kubectl apply has already succeeded, so the author has to know to go and look. Answering here puts the database's own error where the mistake was made.