mirror of
https://github.com/projectcapsule/capsule.git
synced 2026-08-25 16:07:24 +00:00
* feat(webhook): add watchdog webhook to core Signed-off-by: Oliver Bähler <oliverbaehler@hotmail.com> * fix(controller): ensure managed metadata for namespaces on update Signed-off-by: Oliver Bähler <oliverbaehler@hotmail.com> * chore(controller): refactor core webhooks to generics Signed-off-by: Oliver Bähler <oliverbaehler@hotmail.com> * chore: fix helm plugin installation Signed-off-by: Oliver Bähler <oliverbaehler@hotmail.com> * chore: rename webhook to tenant-label Signed-off-by: Oliver Bähler <oliverbaehler@hotmail.com> --------- Signed-off-by: Oliver Bähler <oliverbaehler@hotmail.com>
42 lines
920 B
Go
42 lines
920 B
Go
// Copyright 2020-2025 Project Capsule Authors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
//nolint:dupl
|
|
package route
|
|
|
|
import (
|
|
capsulewebhook "github.com/projectcapsule/capsule/internal/webhook"
|
|
)
|
|
|
|
type tenantValidating struct {
|
|
handlers []capsulewebhook.Handler
|
|
}
|
|
|
|
func TenantValidation(handler ...capsulewebhook.Handler) capsulewebhook.Webhook {
|
|
return &tenantValidating{handlers: handler}
|
|
}
|
|
|
|
func (w *tenantValidating) GetHandlers() []capsulewebhook.Handler {
|
|
return w.handlers
|
|
}
|
|
|
|
func (w *tenantValidating) GetPath() string {
|
|
return "/tenants/validating"
|
|
}
|
|
|
|
type tenantMutating struct {
|
|
handlers []capsulewebhook.Handler
|
|
}
|
|
|
|
func TenantMutation(handler ...capsulewebhook.Handler) capsulewebhook.Webhook {
|
|
return &tenantMutating{handlers: handler}
|
|
}
|
|
|
|
func (w *tenantMutating) GetHandlers() []capsulewebhook.Handler {
|
|
return w.handlers
|
|
}
|
|
|
|
func (w *tenantMutating) GetPath() string {
|
|
return "/tenants/mutating"
|
|
}
|