mirror of
https://github.com/outbackdingo/kamaji.git
synced 2026-01-27 10:19:29 +00:00
21 lines
543 B
Go
21 lines
543 B
Go
// Copyright 2022 Clastix Labs
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package handlers
|
|
|
|
import (
|
|
"context"
|
|
|
|
"gomodules.xyz/jsonpatch/v2"
|
|
"k8s.io/apimachinery/pkg/runtime"
|
|
"sigs.k8s.io/controller-runtime/pkg/webhook/admission"
|
|
)
|
|
|
|
type AdmissionResponse func(ctx context.Context, req admission.Request) ([]jsonpatch.JsonPatchOperation, error)
|
|
|
|
type Handler interface {
|
|
OnCreate(runtime.Object) AdmissionResponse
|
|
OnDelete(runtime.Object) AdmissionResponse
|
|
OnUpdate(newObject runtime.Object, prevObject runtime.Object) AdmissionResponse
|
|
}
|