From d2588b3fa423851ce20cf19b760837bf37f5f2d9 Mon Sep 17 00:00:00 2001 From: Daniel Canter Date: Tue, 28 Jun 2022 17:19:04 -0700 Subject: [PATCH] LCOW differ return ErrNotImplemented for wrong mount type On Windows the two differs we register by default are the "windows" and "windows-lcow" differs. The diff service checks if Apply returns ErrNotImplemented and will move on to the next differ in the line. The Windows differ makes use of this to fallback to LCOW if it's determined the mount type passed is incorrect, but the LCOW differ does not return ErrNotImplemented for the same scenario. This puts a strict ordering requirement on the default differ entries in the config, namely that ["windows", "windows-lcow"] will work, as windows will correctly fall back to the lcow differ, but ["windows-lcow", "windows"] won't as the diff services Apply will just return the error directly. Signed-off-by: Daniel Canter --- diff/lcow/lcow.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/diff/lcow/lcow.go b/diff/lcow/lcow.go index 3fa19fe6f..ffe0b826b 100644 --- a/diff/lcow/lcow.go +++ b/diff/lcow/lcow.go @@ -205,7 +205,7 @@ func mountsToLayerAndParents(mounts []mount.Mount) (string, []string, error) { } mnt := mounts[0] if mnt.Type != "lcow-layer" { - return "", nil, fmt.Errorf("mount layer type must be lcow-layer: %w", errdefs.ErrInvalidArgument) + return "", nil, fmt.Errorf("mount layer type must be lcow-layer: %w", errdefs.ErrNotImplemented) } parentLayerPaths, err := mnt.GetParentPaths()