Documentation ¶
Index ¶
- Constants
- func NewHTTPWebhooks(config config.Admission)
- func Register(kind models.Kind, webhook Webhook)
- func Validating(ctx context.Context, request *Request) error
- type DummyValidatingWebhookServer
- func (*DummyValidatingWebhookServer) ReadAndResponse(resp http.ResponseWriter, req *http.Request, fn func(Request, *Response))
- func (w *DummyValidatingWebhookServer) Stop()
- func (w *DummyValidatingWebhookServer) Validating(resp http.ResponseWriter, req *http.Request)
- func (w *DummyValidatingWebhookServer) ValidatingURL() string
- type HTTPAdmissionClient
- type HTTPAdmissionWebhook
- type Request
- type ResourceMatcher
- type ResourceMatchers
- type Response
- type Webhook
Constants ¶
View Source
const DefaultTimeout = 5 * time.Second
Variables ¶
This section is empty.
Functions ¶
func NewHTTPWebhooks ¶
NewHTTPWebhooks registers the webhooks
Types ¶
type DummyValidatingWebhookServer ¶
type DummyValidatingWebhookServer struct {
// contains filtered or unexported fields
}
func NewDummyWebhookServer ¶
func NewDummyWebhookServer() *DummyValidatingWebhookServer
NewDummyWebhookServer creates a dummy validating webhook server for testing
func (*DummyValidatingWebhookServer) ReadAndResponse ¶
func (*DummyValidatingWebhookServer) ReadAndResponse(resp http.ResponseWriter, req *http.Request, fn func(Request, *Response))
func (*DummyValidatingWebhookServer) Stop ¶
func (w *DummyValidatingWebhookServer) Stop()
func (*DummyValidatingWebhookServer) Validating ¶
func (w *DummyValidatingWebhookServer) Validating(resp http.ResponseWriter, req *http.Request)
func (*DummyValidatingWebhookServer) ValidatingURL ¶
func (w *DummyValidatingWebhookServer) ValidatingURL() string
type HTTPAdmissionClient ¶
func NewHTTPAdmissionClient ¶
func NewHTTPAdmissionClient(config config.ClientConfig, timeout time.Duration) *HTTPAdmissionClient
NewHTTPAdmissionClient creates a new HTTPAdmissionClient
type HTTPAdmissionWebhook ¶
type HTTPAdmissionWebhook struct {
// contains filtered or unexported fields
}
func (*HTTPAdmissionWebhook) IgnoreError ¶
func (m *HTTPAdmissionWebhook) IgnoreError() bool
IgnoreError returns true if the webhook is allowed to ignore the error
func (*HTTPAdmissionWebhook) Interest ¶
func (m *HTTPAdmissionWebhook) Interest(req *Request) bool
Interest returns true if the request matches the webhook
type Request ¶
type Request struct { Operation models.Operation `json:"operation"` Resource string `json:"resource"` Name string `json:"name"` SubResource string `json:"subResource"` Version string `json:"version"` Object interface{} `json:"object"` OldObject interface{} `json:"oldObject"` Options map[string]interface{} `json:"options,omitempty"` }
type ResourceMatcher ¶
type ResourceMatcher struct {
// contains filtered or unexported fields
}
func NewResourceMatcher ¶
func NewResourceMatcher(rule config.Rule) *ResourceMatcher
NewResourceMatcher creates a new ResourceMatcher
func (*ResourceMatcher) Match ¶
func (m *ResourceMatcher) Match(req *Request) bool
Match returns true if the request matches the matcher
type ResourceMatchers ¶
type ResourceMatchers []*ResourceMatcher
func NewResourceMatchers ¶
func NewResourceMatchers(rules []config.Rule) ResourceMatchers
NewResourceMatchers creates a new ResourceMatchers
func (ResourceMatchers) Match ¶
func (m ResourceMatchers) Match(req *Request) bool
Match returns true if any matcher matches the request
Click to show internal directories.
Click to hide internal directories.