Skip to content

Commit 0f956dc

Browse files
authored
Remove unnecessary type casting in the finaliser (#1205)
Signed-off-by: Mikalai Radchuk <[email protected]>
1 parent d2b859b commit 0f956dc

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

cmd/manager/main.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,7 @@ func main() {
203203
domain := ocv1alpha1.GroupVersion.Group
204204
cleanupUnpackCacheKey := fmt.Sprintf("%s/cleanup-unpack-cache", domain)
205205
if err := clusterExtensionFinalizers.Register(cleanupUnpackCacheKey, finalizerFunc(func(ctx context.Context, obj client.Object) (crfinalizer.Result, error) {
206-
ext := obj.(*ocv1alpha1.ClusterExtension)
207-
return crfinalizer.Result{}, os.RemoveAll(filepath.Join(unpacker.BaseCachePath, ext.GetName()))
206+
return crfinalizer.Result{}, os.RemoveAll(filepath.Join(unpacker.BaseCachePath, obj.GetName()))
208207
})); err != nil {
209208
setupLog.Error(err, "unable to register finalizer", "finalizerKey", cleanupUnpackCacheKey)
210209
os.Exit(1)

0 commit comments

Comments
 (0)