Network Key Translation Feature and test cases (#1195)

This commit is contained in:
Mudit Verma
2019-12-01 10:19:23 +08:00
committed by Hang Yan
parent c13d50ee17
commit ac2b852955
18 changed files with 606 additions and 40 deletions
+11
View File
@@ -131,6 +131,17 @@ func normalizeVolumes(svcName string) string {
return strings.Replace(svcName, "_", "-", -1)
}
func normalizeNetworkNames(netName string) (string, error) {
netval := strings.ToLower(netName)
regString := ("[^A-Za-z0-9.-]+")
reg, err := regexp.Compile(regString)
if err != nil {
return "", err
}
netval = reg.ReplaceAllString(netval, "")
return netval, nil
}
// ReadFile read data from file or stdin
func ReadFile(fileName string) ([]byte, error) {
if fileName == "-" {