Documentation
¶
Index ¶
- func AdmissionRequest(ctx context.Context) admission.Request
- func DefaultingWebhookFor(ctx context.Context, defaulter Defaulter, transforms ...TransformFunc) *admission.Webhook
- func RegisterDefaultWebhookFor(ctx context.Context, mgr ctrl.Manager, defaulter Defaulter, ...) (err error)
- func SubjectFromRequest(req admission.Request) *rbacv1.Subject
- func WithAdmissionRequest(ctx context.Context, req admission.Request) context.Context
- type Defaulter
- type DefaulterWebhook
- type TransformFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AdmissionRequest ¶
AdmissionRequest returns admission request from context
func DefaultingWebhookFor ¶
func DefaultingWebhookFor(ctx context.Context, defaulter Defaulter, transforms ...TransformFunc) *admission.Webhook
DefaultingWebhookFor creates a new Webhook for Defaulting the provided type.
func RegisterDefaultWebhookFor ¶
func RegisterDefaultWebhookFor(ctx context.Context, mgr ctrl.Manager, defaulter Defaulter, transforms ...TransformFunc) (err error)
RegisterDefaultWebhookFor registers a mutate webhook for the defaulter with transforms
func SubjectFromRequest ¶
returns a user based on the request information
Types ¶
type DefaulterWebhook ¶ added in v0.2.0
type DefaulterWebhook interface {
Defaulter
sharedmain.WebhookSetup
sharedmain.WebhookRegisterSetup
WithTransformer(transformers ...TransformFunc) DefaulterWebhook
}
func NewDefaulterWebhook ¶ added in v0.2.0
func NewDefaulterWebhook(defaulter Defaulter) DefaulterWebhook
type TransformFunc ¶
TransformFuncused to make common defaulting logic amongst multiple resource using a context, an object and a request
func WithCreatedBy ¶ added in v0.2.0
func WithCreatedBy() TransformFunc
WithCreatedBy adds a createdBy annotation to the object using the request information when an object already has the createdBy annotation it will only increment missing data
func WithTriggeredBy ¶
func WithTriggeredBy() TransformFunc
WithTriggeredBy adds a triggeredBy annotation to the object using the request information when an object already has the triggeredBy annotation it will only increment missing data