mirror of
https://github.com/projectcapsule/capsule.git
synced 2026-05-09 10:56:34 +00:00
* chore: add nwa Signed-off-by: Oliver Bähler <oliverbaehler@hotmail.com> * chore: update helm-schema version Signed-off-by: Oliver Bähler <oliverbaehler@hotmail.com> * chore: update helm-schema version Signed-off-by: Oliver Bähler <oliverbaehler@hotmail.com> --------- Signed-off-by: Oliver Bähler <oliverbaehler@hotmail.com>
73 lines
1.7 KiB
Go
73 lines
1.7 KiB
Go
// Copyright 2020-2025 Project Capsule Authors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package route
|
|
|
|
import (
|
|
capsulewebhook "github.com/projectcapsule/capsule/pkg/webhook"
|
|
)
|
|
|
|
type poolmutation struct {
|
|
handlers []capsulewebhook.Handler
|
|
}
|
|
|
|
func ResourcePoolMutation(handler ...capsulewebhook.Handler) capsulewebhook.Webhook {
|
|
return &poolmutation{handlers: handler}
|
|
}
|
|
|
|
func (w *poolmutation) GetHandlers() []capsulewebhook.Handler {
|
|
return w.handlers
|
|
}
|
|
|
|
func (w *poolmutation) GetPath() string {
|
|
return "/resourcepool/mutating"
|
|
}
|
|
|
|
type poolclaimmutation struct {
|
|
handlers []capsulewebhook.Handler
|
|
}
|
|
|
|
func ResourcePoolClaimMutation(handler ...capsulewebhook.Handler) capsulewebhook.Webhook {
|
|
return &poolclaimmutation{handlers: handler}
|
|
}
|
|
|
|
func (w *poolclaimmutation) GetHandlers() []capsulewebhook.Handler {
|
|
return w.handlers
|
|
}
|
|
|
|
func (w *poolclaimmutation) GetPath() string {
|
|
return "/resourcepool/claim/mutating"
|
|
}
|
|
|
|
type poolValidation struct {
|
|
handlers []capsulewebhook.Handler
|
|
}
|
|
|
|
func ResourcePoolValidation(handler ...capsulewebhook.Handler) capsulewebhook.Webhook {
|
|
return &poolValidation{handlers: handler}
|
|
}
|
|
|
|
func (w *poolValidation) GetHandlers() []capsulewebhook.Handler {
|
|
return w.handlers
|
|
}
|
|
|
|
func (w *poolValidation) GetPath() string {
|
|
return "/resourcepool/validating"
|
|
}
|
|
|
|
type poolclaimValidation struct {
|
|
handlers []capsulewebhook.Handler
|
|
}
|
|
|
|
func ResourcePoolClaimValidation(handler ...capsulewebhook.Handler) capsulewebhook.Webhook {
|
|
return &poolclaimValidation{handlers: handler}
|
|
}
|
|
|
|
func (w *poolclaimValidation) GetHandlers() []capsulewebhook.Handler {
|
|
return w.handlers
|
|
}
|
|
|
|
func (w *poolclaimValidation) GetPath() string {
|
|
return "/resourcepool/claim/validating"
|
|
}
|