Support deploy labels (#1231)

This commit is contained in:
Hang Yan
2020-01-05 11:35:32 +08:00
committed by GitHub
parent 05e9bf4fc8
commit 4d864a9aab
8 changed files with 95 additions and 66 deletions
+12
View File
@@ -125,6 +125,18 @@ func ConfigLabelsWithNetwork(name string, net []string) map[string]string {
//return map[string]string{Selector: name, "Network": net}
}
// ConfigAllLabels creates labels with service nam and deploy labels
func ConfigAllLabels(name string, service *kobject.ServiceConfig) map[string]string {
base := ConfigLabels(name)
if service.DeployLabels != nil {
for k, v := range service.DeployLabels {
base[k] = v
}
}
return base
}
// ConfigAnnotations configures annotations
func ConfigAnnotations(service kobject.ServiceConfig) map[string]string {