Secrets: Add separate package for resource validation (#108097)

* Secrets: Add SecureValueService interface

* Secrets: Move resource validators to their own package/structs for reusing
This commit is contained in:
Matheus Macabu
2025-07-15 12:33:14 +02:00
committed by GitHub
parent 62fd3ba36f
commit 4954822cbb
9 changed files with 983 additions and 3 deletions
@@ -0,0 +1,16 @@
package contracts
import (
"k8s.io/apimachinery/pkg/util/validation/field"
"k8s.io/apiserver/pkg/admission"
secretv1beta1 "github.com/grafana/grafana/apps/secret/pkg/apis/secret/v1beta1"
)
type SecureValueValidator interface {
Validate(sv *secretv1beta1.SecureValue, oldSv *secretv1beta1.SecureValue, operation admission.Operation) field.ErrorList
}
type KeeperValidator interface {
Validate(keeper *secretv1beta1.Keeper, oldKeeper *secretv1beta1.Keeper, operation admission.Operation) field.ErrorList
}