Support multiple hostnames on expose label in service for Kubernetes (#1092)

* Support multiple hostnames on label (kompose.service.expose) separated by semicolon (;)

* Multiple hostnames on expose label separated by comma; Ignore leading / trailing spaces and repeated commas; Updated test cases and documents.
This commit is contained in:
huikaihoo
2019-01-31 09:34:04 -05:00
committed by Charlie Drage
parent 75ecc88aef
commit 40c1b8cf87
9 changed files with 469 additions and 24 deletions
+1 -1
View File
@@ -243,7 +243,7 @@ func libComposeToKomposeMapping(composeObject *project.Project) (kobject.Kompose
serviceConfig.ServiceType = serviceType
case LabelServiceExpose:
serviceConfig.ExposeService = strings.ToLower(value)
serviceConfig.ExposeService = strings.Trim(strings.ToLower(value), " ,")
case LabelServiceExposeTLSSecret:
serviceConfig.ExposeServiceTLS = value
default:
+1 -1
View File
@@ -398,7 +398,7 @@ func dockerComposeToKomposeMapping(composeObject *types.Config) (kobject.Kompose
serviceConfig.ServiceType = serviceType
case LabelServiceExpose:
serviceConfig.ExposeService = strings.ToLower(value)
serviceConfig.ExposeService = strings.Trim(strings.ToLower(value), " ,")
case LabelServiceExposeTLSSecret:
serviceConfig.ExposeServiceTLS = value
}