Files
capsule/internal/webhook/route/tenants.go
T
Oliver Bähler 6e8405d5f0 feat: refactor core webhooks (#1756)
* 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>
2025-11-26 15:27:41 +01:00

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"
}