From f63d828745b5db1980dbe2b508d44c2cebd7c4cd Mon Sep 17 00:00:00 2001 From: allencloud Date: Wed, 16 Aug 2017 10:44:53 +0800 Subject: [PATCH] fix incorrect comparison in /pkg/volume error message Signed-off-by: allencloud --- pkg/volume/util/atomic_writer.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/volume/util/atomic_writer.go b/pkg/volume/util/atomic_writer.go index 1d88d5ebfa4..061482433c8 100644 --- a/pkg/volume/util/atomic_writer.go +++ b/pkg/volume/util/atomic_writer.go @@ -250,7 +250,7 @@ func validatePath(targetPath string) error { } if len(targetPath) > maxPathLength { - return fmt.Errorf("invalid path: must be less than %d characters", maxPathLength) + return fmt.Errorf("invalid path: must be less than or equal to %d characters", maxPathLength) } items := strings.Split(targetPath, string(os.PathSeparator)) @@ -259,7 +259,7 @@ func validatePath(targetPath string) error { return fmt.Errorf("invalid path: must not contain '..': %s", targetPath) } if len(item) > maxFileNameLength { - return fmt.Errorf("invalid path: filenames must be less than %d characters", maxFileNameLength) + return fmt.Errorf("invalid path: filenames must be less than or equal to %d characters", maxFileNameLength) } } if strings.HasPrefix(items[0], "..") && len(items[0]) > 2 {