mirror of
https://github.com/outbackdingo/kamaji.git
synced 2026-01-27 10:19:29 +00:00
* chore(go): bumping up to go1.23 Signed-off-by: Dario Tranchitella <dario@tranchitella.eu> * chore(golangci-lint): bumping up to v1.62.2 Signed-off-by: Dario Tranchitella <dario@tranchitella.eu> --------- Signed-off-by: Dario Tranchitella <dario@tranchitella.eu>
21 lines
551 B
Go
21 lines
551 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(obj runtime.Object) AdmissionResponse
|
|
OnDelete(obj runtime.Object) AdmissionResponse
|
|
OnUpdate(newObject runtime.Object, prevObject runtime.Object) AdmissionResponse
|
|
}
|