From c87a761e055762339d6b7b59bf13c2f77dac22b4 Mon Sep 17 00:00:00 2001 From: Sonny Sasaka Date: Sat, 31 May 2025 16:44:52 -0700 Subject: [PATCH] podman system check: Fix error check logic Previously there is a minor logic error, which causes podman system check to do the check twice although there is no repair flag. Signed-off-by: Sonny Sasaka --- cmd/podman/system/check.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cmd/podman/system/check.go b/cmd/podman/system/check.go index 3a3f0348bc..f3893f54e5 100644 --- a/cmd/podman/system/check.go +++ b/cmd/podman/system/check.go @@ -64,8 +64,11 @@ func check(cmd *cobra.Command, args []string) error { return err } - if !checkOptions.Repair && !checkOptions.RepairLossy && response.Errors { - return errors.New("damage detected in local storage") + if !checkOptions.Repair && !checkOptions.RepairLossy { + if response.Errors { + return errors.New("damage detected in local storage") + } + return nil } recheckOptions := checkOptions