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
+15 -1
View File
@@ -107,13 +107,27 @@ func isPath(substring string) bool {
return strings.Contains(substring, "/") || substring == "."
}
// ConfigLabels configures label
// ConfigLabels configures label name alone
func ConfigLabels(name string) map[string]string {
return map[string]string{Selector: name}
}
// ConfigLabels configures label and add Network Information in labels
func ConfigLabelsWithNetwork(name string, net []string) map[string]string {
labels := map[string]string{}
labels[Selector] = name
for _, n := range net {
labels["io.kompose.network/"+n] = "true"
}
return labels
//return map[string]string{Selector: name, "Network": net}
}
// ConfigAnnotations configures annotations
func ConfigAnnotations(service kobject.ServiceConfig) map[string]string {
annotations := map[string]string{}
for key, value := range service.Annotations {
annotations[key] = value