diff --git a/api/v1alpha1/register.go b/api/v1alpha1/register.go index 3f7c7934..0c97e197 100644 --- a/api/v1alpha1/register.go +++ b/api/v1alpha1/register.go @@ -23,9 +23,8 @@ import ( ) const ( - LocalStorageClassKind = "LocalStorageClass" - APIGroup = "storage.deckhouse.io" - APIVersion = "v1alpha1" + APIGroup = "storage.deckhouse.io" + APIVersion = "v1alpha1" ) // SchemeGroupVersion is group version used to register these objects diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index 9c8f1e8b..17d1424d 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -23,7 +23,6 @@ func (in *LocalStorageClass) DeepCopyInto(out *LocalStorageClass) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EmptyBlockDevice. diff --git a/images/sds-local-volume-csi/go.mod b/images/sds-local-volume-csi/go.mod index 28c6e45b..ba214ffa 100644 --- a/images/sds-local-volume-csi/go.mod +++ b/images/sds-local-volume-csi/go.mod @@ -4,8 +4,8 @@ go 1.22.2 require ( github.com/container-storage-interface/spec v1.9.0 - github.com/deckhouse/sds-local-volume/api v0.0.0-20240704080736-a027a963cc2c - github.com/deckhouse/sds-node-configurator/api v0.0.0-20240709091744-c9d24f05db41 + github.com/deckhouse/sds-local-volume/api v0.0.0-20240803013556-f24060c022de + github.com/deckhouse/sds-node-configurator/api v0.0.0-20240805103635-969dc811217b github.com/go-logr/logr v1.4.1 github.com/golang/protobuf v1.5.4 golang.org/x/sync v0.6.0 diff --git a/images/sds-local-volume-csi/go.sum b/images/sds-local-volume-csi/go.sum index f4e5be09..a96942be 100644 --- a/images/sds-local-volume-csi/go.sum +++ b/images/sds-local-volume-csi/go.sum @@ -5,10 +5,14 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/deckhouse/sds-local-volume/api v0.0.0-20240704080736-a027a963cc2c h1:1hZBDe3aKqok/jOnbKfa5CMQ6viL/dsnsHujEaq+oxU= github.com/deckhouse/sds-local-volume/api v0.0.0-20240704080736-a027a963cc2c/go.mod h1:cYxHYJmIl6g9lXb1etqmLeQL/vsPMgscmact/FObd+U= +github.com/deckhouse/sds-local-volume/api v0.0.0-20240803013556-f24060c022de h1:OiX6uWe5Vz/MY08jb5502C9G5Yb/6G6tBU0lp0q0wA4= +github.com/deckhouse/sds-local-volume/api v0.0.0-20240803013556-f24060c022de/go.mod h1:cYxHYJmIl6g9lXb1etqmLeQL/vsPMgscmact/FObd+U= github.com/deckhouse/sds-node-configurator/api v0.0.0-20240705070320-a7a740787b36 h1:ToJpGIAHud57Fxm5P1oULRibHpcCuysHqg5dgT0aeys= github.com/deckhouse/sds-node-configurator/api v0.0.0-20240705070320-a7a740787b36/go.mod h1:H71+9G0Jr46Qs0BA3z3/xt0h9lbnJnCEYcaCJCWFBf0= github.com/deckhouse/sds-node-configurator/api v0.0.0-20240709091744-c9d24f05db41 h1:kfnAfII4E8yWkDZ4FJIPO9/OvXkMIQDPLB3zzNBo8Wg= github.com/deckhouse/sds-node-configurator/api v0.0.0-20240709091744-c9d24f05db41/go.mod h1:H71+9G0Jr46Qs0BA3z3/xt0h9lbnJnCEYcaCJCWFBf0= +github.com/deckhouse/sds-node-configurator/api v0.0.0-20240805103635-969dc811217b h1:EYmHWTWcWMpyxJGZK05ZxlIFnh9s66DRrxLw/LNb/xw= +github.com/deckhouse/sds-node-configurator/api v0.0.0-20240805103635-969dc811217b/go.mod h1:H71+9G0Jr46Qs0BA3z3/xt0h9lbnJnCEYcaCJCWFBf0= github.com/emicklei/go-restful/v3 v3.12.0 h1:y2DdzBAURM29NFF94q6RaY4vjIH1rtwDapwQtU84iWk= github.com/emicklei/go-restful/v3 v3.12.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= diff --git a/images/sds-local-volume-csi/pkg/utils/func.go b/images/sds-local-volume-csi/pkg/utils/func.go index 5f59b1c4..d3639aba 100644 --- a/images/sds-local-volume-csi/pkg/utils/func.go +++ b/images/sds-local-volume-csi/pkg/utils/func.go @@ -47,10 +47,6 @@ const ( func CreateLVMLogicalVolume(ctx context.Context, kc client.Client, name string, lvmLogicalVolumeSpec snc.LVMLogicalVolumeSpec) (*snc.LVMLogicalVolume, error) { var err error llv := &snc.LVMLogicalVolume{ - TypeMeta: metav1.TypeMeta{ - Kind: snc.LVMLogicalVolumeKind, - APIVersion: snc.TypeMediaAPIVersion, - }, ObjectMeta: metav1.ObjectMeta{ Name: name, OwnerReferences: []metav1.OwnerReference{}, @@ -198,10 +194,6 @@ func GetNodeWithMaxFreeSpace(lvgs []snc.LvmVolumeGroup, storageClassLVGParameter // TODO: delete the method below? func GetLVMVolumeGroupParams(ctx context.Context, kc client.Client, log logger.Logger, lvmVG map[string]string, nodeName, lvmType string) (lvgName, vgName string, err error) { listLvgs := &snc.LvmVolumeGroupList{ - TypeMeta: metav1.TypeMeta{ - Kind: snc.LVMVolumeGroupKind, - APIVersion: snc.TypeMediaAPIVersion, - }, ListMeta: metav1.ListMeta{}, Items: []snc.LvmVolumeGroup{}, } @@ -336,14 +328,7 @@ func GetStorageClassLVGsAndParameters(ctx context.Context, kc client.Client, log func GetLVGList(ctx context.Context, kc client.Client) (*snc.LvmVolumeGroupList, error) { var err error - listLvgs := &snc.LvmVolumeGroupList{ - TypeMeta: metav1.TypeMeta{ - Kind: snc.LVMVolumeGroupKind, - APIVersion: snc.TypeMediaAPIVersion, - }, - ListMeta: metav1.ListMeta{}, - Items: []snc.LvmVolumeGroup{}, - } + listLvgs := &snc.LvmVolumeGroupList{} for attempt := 0; attempt < KubernetesAPIRequestLimit; attempt++ { err = kc.List(ctx, listLvgs) diff --git a/images/sds-local-volume-scheduler-extender/src/go.mod b/images/sds-local-volume-scheduler-extender/src/go.mod index 861f3447..a4d9b32a 100644 --- a/images/sds-local-volume-scheduler-extender/src/go.mod +++ b/images/sds-local-volume-scheduler-extender/src/go.mod @@ -4,7 +4,7 @@ go 1.22.2 require ( github.com/deckhouse/sds-local-volume/api v0.0.0-20240704080736-a027a963cc2c - github.com/deckhouse/sds-node-configurator/api v0.0.0-20240709091744-c9d24f05db41 + github.com/deckhouse/sds-node-configurator/api v0.0.0-20240805103635-969dc811217b github.com/go-logr/logr v1.4.1 github.com/go-logr/zapr v1.3.0 github.com/spf13/cobra v1.8.0 diff --git a/images/sds-local-volume-scheduler-extender/src/go.sum b/images/sds-local-volume-scheduler-extender/src/go.sum index b532bbf0..ddaee07f 100644 --- a/images/sds-local-volume-scheduler-extender/src/go.sum +++ b/images/sds-local-volume-scheduler-extender/src/go.sum @@ -13,6 +13,8 @@ github.com/deckhouse/sds-node-configurator/api v0.0.0-20240705070320-a7a740787b3 github.com/deckhouse/sds-node-configurator/api v0.0.0-20240705070320-a7a740787b36/go.mod h1:H71+9G0Jr46Qs0BA3z3/xt0h9lbnJnCEYcaCJCWFBf0= github.com/deckhouse/sds-node-configurator/api v0.0.0-20240709091744-c9d24f05db41 h1:kfnAfII4E8yWkDZ4FJIPO9/OvXkMIQDPLB3zzNBo8Wg= github.com/deckhouse/sds-node-configurator/api v0.0.0-20240709091744-c9d24f05db41/go.mod h1:H71+9G0Jr46Qs0BA3z3/xt0h9lbnJnCEYcaCJCWFBf0= +github.com/deckhouse/sds-node-configurator/api v0.0.0-20240805103635-969dc811217b h1:EYmHWTWcWMpyxJGZK05ZxlIFnh9s66DRrxLw/LNb/xw= +github.com/deckhouse/sds-node-configurator/api v0.0.0-20240805103635-969dc811217b/go.mod h1:H71+9G0Jr46Qs0BA3z3/xt0h9lbnJnCEYcaCJCWFBf0= github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= diff --git a/images/webhooks/src/go.mod b/images/webhooks/src/go.mod index c5e84e13..40d8429f 100644 --- a/images/webhooks/src/go.mod +++ b/images/webhooks/src/go.mod @@ -5,7 +5,7 @@ go 1.22.3 require ( github.com/deckhouse/deckhouse v1.62.2 github.com/deckhouse/sds-local-volume/api v0.0.0-20240704080736-a027a963cc2c - github.com/deckhouse/sds-node-configurator/api v0.0.0-20240718134550-8296fe5656e3 + github.com/deckhouse/sds-node-configurator/api v0.0.0-20240805103635-969dc811217b github.com/sirupsen/logrus v1.9.3 github.com/slok/kubewebhook/v2 v2.6.0 k8s.io/api v0.30.3 diff --git a/images/webhooks/src/go.sum b/images/webhooks/src/go.sum index ffb8d47b..de33f4ac 100644 --- a/images/webhooks/src/go.sum +++ b/images/webhooks/src/go.sum @@ -8,8 +8,8 @@ github.com/deckhouse/deckhouse v1.62.2 h1:dbDriDAxxTkI7tWIV1CsJoE7TkmgeW3jfUwL/E github.com/deckhouse/deckhouse v1.62.2/go.mod h1:uJICbx/itedld6N9uv3srI6Hdt+m4P6IQyocUrtySVY= github.com/deckhouse/sds-local-volume/api v0.0.0-20240704080736-a027a963cc2c h1:1hZBDe3aKqok/jOnbKfa5CMQ6viL/dsnsHujEaq+oxU= github.com/deckhouse/sds-local-volume/api v0.0.0-20240704080736-a027a963cc2c/go.mod h1:cYxHYJmIl6g9lXb1etqmLeQL/vsPMgscmact/FObd+U= -github.com/deckhouse/sds-node-configurator/api v0.0.0-20240718134550-8296fe5656e3 h1:zlGPvlNnEDCNlezto3a7ScVJzqu+fvrnGRpAsQs2wNM= -github.com/deckhouse/sds-node-configurator/api v0.0.0-20240718134550-8296fe5656e3/go.mod h1:H71+9G0Jr46Qs0BA3z3/xt0h9lbnJnCEYcaCJCWFBf0= +github.com/deckhouse/sds-node-configurator/api v0.0.0-20240805103635-969dc811217b h1:EYmHWTWcWMpyxJGZK05ZxlIFnh9s66DRrxLw/LNb/xw= +github.com/deckhouse/sds-node-configurator/api v0.0.0-20240805103635-969dc811217b/go.mod h1:H71+9G0Jr46Qs0BA3z3/xt0h9lbnJnCEYcaCJCWFBf0= github.com/emicklei/go-restful/v3 v3.12.0 h1:y2DdzBAURM29NFF94q6RaY4vjIH1rtwDapwQtU84iWk= github.com/emicklei/go-restful/v3 v3.12.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U= diff --git a/images/webhooks/src/handlers/func.go b/images/webhooks/src/handlers/func.go index 2e993613..aab10abc 100644 --- a/images/webhooks/src/handlers/func.go +++ b/images/webhooks/src/handlers/func.go @@ -18,27 +18,26 @@ package handlers import ( "context" + "net/http" + "os" + dh "github.com/deckhouse/deckhouse/deckhouse-controller/pkg/apis/deckhouse.io/v1alpha1" snc "github.com/deckhouse/sds-node-configurator/api/v1alpha1" + kwhhttp "github.com/slok/kubewebhook/v2/pkg/http" + "github.com/slok/kubewebhook/v2/pkg/log" + "github.com/slok/kubewebhook/v2/pkg/model" + kwhmutating "github.com/slok/kubewebhook/v2/pkg/webhook/mutating" + kwhvalidating "github.com/slok/kubewebhook/v2/pkg/webhook/validating" v1 "k8s.io/api/core/v1" "k8s.io/api/resource/v1alpha2" sv1 "k8s.io/api/storage/v1" extv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" apiruntime "k8s.io/apimachinery/pkg/runtime" clientgoscheme "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" - "net/http" - "os" "sigs.k8s.io/controller-runtime/pkg/client" - - "github.com/slok/kubewebhook/v2/pkg/log" - - kwhhttp "github.com/slok/kubewebhook/v2/pkg/http" - "github.com/slok/kubewebhook/v2/pkg/model" - kwhmutating "github.com/slok/kubewebhook/v2/pkg/webhook/mutating" - kwhvalidating "github.com/slok/kubewebhook/v2/pkg/webhook/validating" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) func NewKubeClient(kubeconfigPath string) (client.Client, error) { @@ -100,7 +99,6 @@ func GetMutatingWebhookHandler(mutationFunc func(ctx context.Context, _ *model.A mutationWebhookHandler, err := kwhhttp.HandlerFor(kwhhttp.HandlerConfig{Webhook: mutationWebhook, Logger: logger}) return mutationWebhookHandler, err - } func GetValidatingWebhookHandler(validationFunc func(ctx context.Context, _ *model.AdmissionReview, obj metav1.Object) (*kwhvalidating.ValidatorResult, error), validatorID string, obj metav1.Object, logger log.Logger) (http.Handler, error) { @@ -121,5 +119,4 @@ func GetValidatingWebhookHandler(validationFunc func(ctx context.Context, _ *mod mutationWebhookHandler, err := kwhhttp.HandlerFor(kwhhttp.HandlerConfig{Webhook: mutationWebhook, Logger: logger}) return mutationWebhookHandler, err - } diff --git a/images/webhooks/src/handlers/lscValidator.go b/images/webhooks/src/handlers/lscValidator.go index 11c8bc44..a019d15b 100644 --- a/images/webhooks/src/handlers/lscValidator.go +++ b/images/webhooks/src/handlers/lscValidator.go @@ -20,17 +20,17 @@ import ( "context" "encoding/json" "fmt" - slv "github.com/deckhouse/sds-local-volume/api/v1alpha1" - snc "github.com/deckhouse/sds-node-configurator/api/v1alpha1" - "k8s.io/apimachinery/pkg/types" - "k8s.io/klog/v2" - "sigs.k8s.io/controller-runtime/pkg/client" "slices" dh "github.com/deckhouse/deckhouse/deckhouse-controller/pkg/apis/deckhouse.io/v1alpha1" + slv "github.com/deckhouse/sds-local-volume/api/v1alpha1" + snc "github.com/deckhouse/sds-node-configurator/api/v1alpha1" "github.com/slok/kubewebhook/v2/pkg/model" kwhvalidating "github.com/slok/kubewebhook/v2/pkg/webhook/validating" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" + "k8s.io/klog/v2" + "sigs.k8s.io/controller-runtime/pkg/client" ) const ( @@ -145,13 +145,10 @@ func LSCValidate(ctx context.Context, _ *model.AdmissionReview, obj metav1.Objec nil } - if thickExists == true && thinExists == true { + if thickExists && thinExists { errMsg = "There must be only thin or thick pools simultaneously" klog.Info(errMsg) - return &kwhvalidating.ValidatorResult{Valid: false, Message: errMsg}, - nil - } else { - return &kwhvalidating.ValidatorResult{Valid: true}, - nil + return &kwhvalidating.ValidatorResult{Valid: false, Message: errMsg}, nil } + return &kwhvalidating.ValidatorResult{Valid: true}, nil } diff --git a/images/webhooks/src/handlers/scValidator.go b/images/webhooks/src/handlers/scValidator.go index 53629cb2..1c11da0d 100644 --- a/images/webhooks/src/handlers/scValidator.go +++ b/images/webhooks/src/handlers/scValidator.go @@ -22,12 +22,11 @@ import ( "fmt" "reflect" - "k8s.io/klog/v2" - "github.com/slok/kubewebhook/v2/pkg/model" kwhvalidating "github.com/slok/kubewebhook/v2/pkg/webhook/validating" storagev1 "k8s.io/api/storage/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/klog/v2" ) const ( @@ -35,7 +34,7 @@ const ( allowedUserName = "system:serviceaccount:d8-sds-local-volume:sds-local-volume-controller" ) -func SCValidate(ctx context.Context, arReview *model.AdmissionReview, obj metav1.Object) (*kwhvalidating.ValidatorResult, error) { +func SCValidate(_ context.Context, arReview *model.AdmissionReview, obj metav1.Object) (*kwhvalidating.ValidatorResult, error) { sc, ok := obj.(*storagev1.StorageClass) if !ok { // If not a storage class just continue the validation chain(if there is one) and do nothing. @@ -45,34 +44,28 @@ func SCValidate(ctx context.Context, arReview *model.AdmissionReview, obj metav1 if sc.Provisioner == localCSIProvisioner { if arReview.UserInfo.Username == allowedUserName { klog.Infof("User %s is allowed to manage storage classes with provisioner %s", arReview.UserInfo.Username, localCSIProvisioner) - return &kwhvalidating.ValidatorResult{Valid: true}, - nil - } else { - if arReview.Operation == model.OperationUpdate { - changed, err := isStorageClassChangedExceptAnnotations(arReview.OldObjectRaw, arReview.NewObjectRaw) - if err != nil { - return nil, err - } - - if !changed { - klog.Infof("User %s is allowed to change annotations for storage classes with provisioner %s", arReview.UserInfo.Username, localCSIProvisioner) - return &kwhvalidating.ValidatorResult{Valid: true}, - nil - } + return &kwhvalidating.ValidatorResult{Valid: true}, nil + } + if arReview.Operation == model.OperationUpdate { + changed, err := isStorageClassChangedExceptAnnotations(arReview.OldObjectRaw, arReview.NewObjectRaw) + if err != nil { + return nil, err } - klog.Infof("User %s is not allowed to manage storage classes with provisioner %s", arReview.UserInfo.Username, localCSIProvisioner) - return &kwhvalidating.ValidatorResult{ - Valid: false, - Message: fmt.Sprintf("Direct modifications to the StorageClass (other than annotations) with the provisioner %s are not allowed. Please use LocalStorageClass for such operations.", localCSIProvisioner), - }, - nil + if !changed { + klog.Infof("User %s is allowed to change annotations for storage classes with provisioner %s", arReview.UserInfo.Username, localCSIProvisioner) + return &kwhvalidating.ValidatorResult{Valid: true}, nil + } } - } else { - return &kwhvalidating.ValidatorResult{Valid: true}, - nil + + klog.Infof("User %s is not allowed to manage storage classes with provisioner %s", arReview.UserInfo.Username, localCSIProvisioner) + return &kwhvalidating.ValidatorResult{ + Valid: false, + Message: fmt.Sprintf("Direct modifications to the StorageClass (other than annotations) with the provisioner %s are not allowed. Please use LocalStorageClass for such operations.", localCSIProvisioner), + }, nil } + return &kwhvalidating.ValidatorResult{Valid: true}, nil } func isStorageClassChangedExceptAnnotations(oldObjectRaw, newObjectRaw []byte) (bool, error) { diff --git a/images/webhooks/src/main.go b/images/webhooks/src/main.go index 652cee8c..c4cd9a9a 100644 --- a/images/webhooks/src/main.go +++ b/images/webhooks/src/main.go @@ -19,15 +19,15 @@ package main import ( "flag" "fmt" - slv "github.com/deckhouse/sds-local-volume/api/v1alpha1" "net/http" "os" - "webhooks/handlers" + slv "github.com/deckhouse/sds-local-volume/api/v1alpha1" "github.com/sirupsen/logrus" kwhlogrus "github.com/slok/kubewebhook/v2/pkg/log/logrus" corev1 "k8s.io/api/core/v1" storagev1 "k8s.io/api/storage/v1" + "webhooks/handlers" ) type config struct { @@ -36,26 +36,32 @@ type config struct { } //goland:noinspection SpellCheckingInspection -func httpHandlerHealthz(w http.ResponseWriter, r *http.Request) { - fmt.Fprint(w, "Ok.") +func httpHandlerHealthz(w http.ResponseWriter, _ *http.Request) { + _, err := fmt.Fprint(w, "Ok.") + if err != nil { + w.WriteHeader(500) + } } -func initFlags() config { +func initFlags() (config, error) { cfg := config{} fl := flag.NewFlagSet(os.Args[0], flag.ExitOnError) fl.StringVar(&cfg.certFile, "tls-cert-file", "", "TLS certificate file") fl.StringVar(&cfg.keyFile, "tls-key-file", "", "TLS key file") - fl.Parse(os.Args[1:]) - return cfg + err := fl.Parse(os.Args[1:]) + if err != nil { + return cfg, err + } + return cfg, nil } const ( port = ":8443" PodSchedulerMutatorID = "PodSchedulerMutation" - LSCValidatorId = "LSCValidator" - SCValidatorId = "SCValidator" + LSCValidatorID = "LSCValidator" + SCValidatorID = "SCValidator" ) func main() { @@ -63,7 +69,11 @@ func main() { logrusLogEntry.Logger.SetLevel(logrus.DebugLevel) logger := kwhlogrus.NewLogrus(logrusLogEntry) - cfg := initFlags() + cfg, err := initFlags() + if err != nil { + fmt.Printf("unable to parse config: err: %s", err.Error()) + os.Exit(1) + } podSchedulerMutatingWebHookHandler, err := handlers.GetMutatingWebhookHandler(handlers.PodSchedulerMutate, PodSchedulerMutatorID, &corev1.Pod{}, logger) if err != nil { @@ -71,13 +81,13 @@ func main() { os.Exit(1) } - lscValidatingWebhookHandler, err := handlers.GetValidatingWebhookHandler(handlers.LSCValidate, LSCValidatorId, &slv.LocalStorageClass{}, logger) + lscValidatingWebhookHandler, err := handlers.GetValidatingWebhookHandler(handlers.LSCValidate, LSCValidatorID, &slv.LocalStorageClass{}, logger) if err != nil { fmt.Fprintf(os.Stderr, "error creating lscValidatingWebhookHandler: %s", err) os.Exit(1) } - scValidatingWebhookHandler, err := handlers.GetValidatingWebhookHandler(handlers.SCValidate, SCValidatorId, &storagev1.StorageClass{}, logger) + scValidatingWebhookHandler, err := handlers.GetValidatingWebhookHandler(handlers.SCValidate, SCValidatorID, &storagev1.StorageClass{}, logger) if err != nil { fmt.Fprintf(os.Stderr, "error creating scValidatingWebhookHandler: %s", err) os.Exit(1)