mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 21:47:07 +00:00
fix incorrect comparison in /pkg/volume error message
Signed-off-by: allencloud <allen.sun@daocloud.io>
This commit is contained in:
parent
036456a892
commit
f63d828745
@ -250,7 +250,7 @@ func validatePath(targetPath string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if len(targetPath) > maxPathLength {
|
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))
|
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)
|
return fmt.Errorf("invalid path: must not contain '..': %s", targetPath)
|
||||||
}
|
}
|
||||||
if len(item) > maxFileNameLength {
|
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 {
|
if strings.HasPrefix(items[0], "..") && len(items[0]) > 2 {
|
||||||
|
Loading…
Reference in New Issue
Block a user