mirror of
https://github.com/projectcapsule/capsule.git
synced 2026-03-04 02:30:23 +00:00
27 lines
703 B
Go
27 lines
703 B
Go
// Copyright 2020-2023 Project Capsule Authors.
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package route
|
|
|
|
import (
|
|
capsulewebhook "github.com/projectcapsule/capsule/pkg/webhook"
|
|
)
|
|
|
|
// +kubebuilder:webhook:path=/services,mutating=false,sideEffects=None,admissionReviewVersions=v1,failurePolicy=fail,groups="",resources=services,verbs=create;update,versions=v1,name=services.capsule.clastix.io
|
|
|
|
type service struct {
|
|
handlers []capsulewebhook.Handler
|
|
}
|
|
|
|
func Service(handler ...capsulewebhook.Handler) capsulewebhook.Webhook {
|
|
return &service{handlers: handler}
|
|
}
|
|
|
|
func (w *service) GetHandlers() []capsulewebhook.Handler {
|
|
return w.handlers
|
|
}
|
|
|
|
func (w *service) GetPath() string {
|
|
return "/services"
|
|
}
|