From 1685a0a449cc868b7760a683d0c37881b08e7869 Mon Sep 17 00:00:00 2001 From: Sergey Berezansky Date: Wed, 15 Jan 2025 14:51:19 +0200 Subject: [PATCH 1/2] chore(deps): improve the way of locar to delete multi-depth directories --- pkg/wekafs/gc.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/wekafs/gc.go b/pkg/wekafs/gc.go index 49c2de494..685f2923e 100644 --- a/pkg/wekafs/gc.go +++ b/pkg/wekafs/gc.go @@ -100,12 +100,14 @@ func (gc *innerPathVolGc) purgeLeftovers(ctx context.Context, fs string, apiClie if fileExists("/locar") { logger.Debug().Msg("Using locar for fast deletion") - deleteCmd := exec.Command("bash", "-c", fmt.Sprintf("/locar --type dir %s | /usr/bin/xargs -P32 -n128 rm -rf", volumeTrashLoc)) + deleteCmd := exec.Command("bash", "-c", + fmt.Sprintf("/locar --type file %s | xargs -P128 -n128 rm -f 2>&1 | wc -l; /locar --type dir %s | /usr/bin/xargs -P128 -n128 rm -rf 2>&1 | wc -l", volumeTrashLoc, volumeTrashLoc), + ) output, err := deleteCmd.CombinedOutput() if err != nil { logger.Error().Err(err).Msg("Error running locar") - logger.Trace().Str("output", string(output)).Msg("Locar output") } + logger.Trace().Str("output", string(output)).Msg("Locar output") } else { logger.Debug().Msg("Using default deletion method") if err := os.RemoveAll(volumeTrashLoc); err != nil { From f2ffff9ff33c6af19716ae9febdb5964d3354f0b Mon Sep 17 00:00:00 2001 From: Sergey Berezansky Date: Wed, 15 Jan 2025 16:25:41 +0200 Subject: [PATCH 2/2] chore(deps): add less and procps packages to UBI image --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index dae3de844..80befce22 100644 --- a/Dockerfile +++ b/Dockerfile @@ -34,7 +34,7 @@ FROM registry.access.redhat.com/ubi9/ubi:${UBI_HASH} LABEL maintainers="WekaIO, LTD" LABEL description="Weka CSI Driver" -RUN dnf install -y util-linux libselinux-utils pciutils binutils jq +RUN dnf install -y util-linux libselinux-utils pciutils binutils jq procps less RUN mkdir -p /licenses COPY LICENSE /licenses COPY --from=kubectl /bin/kubectl /bin/kubectl