Merge pull request #15455 from baude/issue15247

Allow colons in windows file paths
This commit is contained in:
Valentin Rothberg
2022-08-25 10:06:55 +02:00
committed by GitHub
3 changed files with 23 additions and 9 deletions

View File

@ -151,15 +151,6 @@ func parseEnvOrLabelFile(envOrLabel map[string]string, filename, configType stri
return scanner.Err()
}
// ValidateFileName returns an error if filename contains ":"
// as it is currently not supported
func ValidateFileName(filename string) error {
if strings.Contains(filename, ":") {
return fmt.Errorf("invalid filename (should not contain ':') %q", filename)
}
return nil
}
// ValidURL checks a string urlStr is a url or not
func ValidURL(urlStr string) error {
url, err := url.ParseRequestURI(urlStr)

18
cmd/podman/parse/parse.go Normal file
View File

@ -0,0 +1,18 @@
//go:build !windows
// +build !windows
package parse
import (
"fmt"
"strings"
)
// ValidateFileName returns an error if filename contains ":"
// as it is currently not supported
func ValidateFileName(filename string) error {
if strings.Contains(filename, ":") {
return fmt.Errorf("invalid filename (should not contain ':') %q", filename)
}
return nil
}

View File

@ -0,0 +1,5 @@
package parse
func ValidateFileName(filename string) error {
return nil
}