From 1f9fb7050781e5111d58f57d5d6619a58a773f57 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Mon, 8 Mar 2021 10:19:04 +0100 Subject: [PATCH 1/2] overlay: allow to reset mount_program if the mount_program is set to the empty string then clear its value and not use a mount program instead of failing. Signed-off-by: Giuseppe Scrivano --- drivers/overlay/overlay.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/overlay/overlay.go b/drivers/overlay/overlay.go index 6c8e059fc9..b06bfa5eef 100644 --- a/drivers/overlay/overlay.go +++ b/drivers/overlay/overlay.go @@ -394,9 +394,11 @@ func parseOptions(options []string) (*overlayOptions, error) { } case "mount_program": logrus.Debugf("overlay: mount_program=%s", val) - _, err := os.Stat(val) - if err != nil { - return nil, fmt.Errorf("overlay: can't stat program %s: %v", val, err) + if val != "" { + _, err := os.Stat(val) + if err != nil { + return nil, fmt.Errorf("overlay: can't stat program %s: %v", val, err) + } } o.mountProgram = val case "skip_mount_home": From dde567af8cba51393ddce546b1ff1897c34524b5 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Mon, 8 Mar 2021 10:50:22 +0100 Subject: [PATCH 2/2] overlay: improve overlay error message Signed-off-by: Giuseppe Scrivano --- drivers/overlay/overlay.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/overlay/overlay.go b/drivers/overlay/overlay.go index b06bfa5eef..254fd5fabf 100644 --- a/drivers/overlay/overlay.go +++ b/drivers/overlay/overlay.go @@ -397,7 +397,7 @@ func parseOptions(options []string) (*overlayOptions, error) { if val != "" { _, err := os.Stat(val) if err != nil { - return nil, fmt.Errorf("overlay: can't stat program %s: %v", val, err) + return nil, errors.Wrapf(err, "overlay: can't stat program %q", val) } } o.mountProgram = val