Files
kamaji/internal/webhook/handlers/handler.go
Dario Tranchitella 2b17282b0e chore(go): bumping up to go1.23 (#643)
* 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>
2024-12-01 16:09:26 +01:00

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
}