Skip to content

Commit

Permalink
NFSStorageClass validation has been removed
Browse files Browse the repository at this point in the history
Signed-off-by: Pavel Karpov <[email protected]>
  • Loading branch information
krpsh123 committed Dec 9, 2024
1 parent 232aaba commit a47152b
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 381 deletions.
114 changes: 0 additions & 114 deletions images/controller/src/api/module_config.go

This file was deleted.

54 changes: 0 additions & 54 deletions images/controller/src/api/register.go

This file was deleted.

125 changes: 0 additions & 125 deletions images/controller/src/api/zz_generated.deepcopy.go

This file was deleted.

33 changes: 0 additions & 33 deletions images/controller/src/api/zz_generated.defaults.go

This file was deleted.

26 changes: 2 additions & 24 deletions images/controller/src/pkg/controller/nfs_storage_class_watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ const (
SecretForMountOptionsPrefix = "nfs-mount-options-for-"
StorageClassSecretNameKey = "csi.storage.k8s.io/provisioner-secret-name"
StorageClassSecretNSKey = "csi.storage.k8s.io/provisioner-secret-namespace"

csiNfsModuleName = "csi-nfs"
)

var (
Expand Down Expand Up @@ -105,6 +103,8 @@ func RunNFSStorageClassWatcherController(
return reconcile.Result{}, nil
}

//TODO added validateNFSStorageClass

scList := &v1.StorageClassList{}
err = cl.List(ctx, scList)
if err != nil {
Expand Down Expand Up @@ -137,20 +137,6 @@ func RunNFSStorageClassWatcherController(
CreateFunc: func(ctx context.Context, e event.CreateEvent, q workqueue.RateLimitingInterface) {
log.Info(fmt.Sprintf("[CreateFunc] get event for NFSStorageClass %q. Add to the queue", e.Object.GetName()))
request := reconcile.Request{NamespacedName: types.NamespacedName{Namespace: e.Object.GetNamespace(), Name: e.Object.GetName()}}

nsc, ok := e.Object.(*v1alpha1.NFSStorageClass)
if !ok {
err = errors.New("unable to cast event object to a given type")
log.Error(err, "[CreateFunc] an error occurred while handling create event")
return
}

err := validationNFSStorageClass(ctx, cl, log, nsc)
if err != nil {
log.Error(err, "[CreateFunc] an error occurred while handling create event")
return
}

q.Add(request)
},
UpdateFunc: func(ctx context.Context, e event.UpdateEvent, q workqueue.RateLimitingInterface) {
Expand All @@ -174,14 +160,6 @@ func RunNFSStorageClassWatcherController(
return
}

if newNSC.DeletionTimestamp == nil {
err := validationNFSStorageClass(ctx, cl, log, newNSC)
if err != nil {
log.Error(err, "[UpdateFunc] an error occurred while handling create event")
return
}
}

log.Info(fmt.Sprintf("[UpdateFunc] the NFSStorageClass %q will be reconciled. Add to the queue", newNSC.Name))
request := reconcile.Request{NamespacedName: types.NamespacedName{Namespace: newNSC.Namespace, Name: newNSC.Name}}
q.Add(request)
Expand Down
Loading

0 comments on commit a47152b

Please sign in to comment.