mirror of
https://github.com/projectcapsule/capsule.git
synced 2026-02-14 18:09:58 +00:00
27 lines
789 B
Go
27 lines
789 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=/tenantresource-objects,mutating=false,sideEffects=None,admissionReviewVersions=v1,failurePolicy=fail,groups="*",resources="*",verbs=update;delete,versions="*",name=resource-objects.tenant.capsule.clastix.io
|
|
|
|
type tntResourceObjs struct {
|
|
handlers []capsulewebhook.Handler
|
|
}
|
|
|
|
func TenantResourceObjects(handlers ...capsulewebhook.Handler) capsulewebhook.Webhook {
|
|
return &tntResourceObjs{handlers: handlers}
|
|
}
|
|
|
|
func (t tntResourceObjs) GetPath() string {
|
|
return "/tenantresource-objects"
|
|
}
|
|
|
|
func (t tntResourceObjs) GetHandlers() []capsulewebhook.Handler {
|
|
return t.handlers
|
|
}
|