From 749f2e72b1ef2e1f81561ef71737d80b7c827cd4 Mon Sep 17 00:00:00 2001 From: Mikalai Radchuk Date: Tue, 3 Sep 2024 13:23:58 +0200 Subject: [PATCH] Remove unnecessary type casting in the finaliser Signed-off-by: Mikalai Radchuk --- cmd/manager/main.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cmd/manager/main.go b/cmd/manager/main.go index ed8a33abc..5ae7aa97f 100644 --- a/cmd/manager/main.go +++ b/cmd/manager/main.go @@ -203,8 +203,7 @@ func main() { domain := ocv1alpha1.GroupVersion.Group cleanupUnpackCacheKey := fmt.Sprintf("%s/cleanup-unpack-cache", domain) if err := clusterExtensionFinalizers.Register(cleanupUnpackCacheKey, finalizerFunc(func(ctx context.Context, obj client.Object) (crfinalizer.Result, error) { - ext := obj.(*ocv1alpha1.ClusterExtension) - return crfinalizer.Result{}, os.RemoveAll(filepath.Join(unpacker.BaseCachePath, ext.GetName())) + return crfinalizer.Result{}, os.RemoveAll(filepath.Join(unpacker.BaseCachePath, obj.GetName())) })); err != nil { setupLog.Error(err, "unable to register finalizer", "finalizerKey", cleanupUnpackCacheKey) os.Exit(1)