Propagate underscores into valid names

Now we can provide service name with "_" in docker-compose files and they will by converted as "-" in the generated artifacts by kompose eg, if the service name in docker-compose file is "foo_bar" then it will be converted into "foo-bar" in the generated artifacts
This commit is contained in:
Abhishek
2017-04-03 13:06:33 +05:30
parent 99f70109b7
commit 6e0b934f77
2 changed files with 5 additions and 2 deletions
+4 -1
View File
@@ -374,7 +374,10 @@ func (c *Compose) LoadFile(files []string) (kobject.KomposeObject, error) {
serviceConfig.Tty = composeServiceConfig.Tty
serviceConfig.MemLimit = composeServiceConfig.MemLimit
serviceConfig.TmpFs = composeServiceConfig.Tmpfs
komposeObject.ServiceConfigs[name] = serviceConfig
komposeObject.ServiceConfigs[normalizeServiceNames(name)] = serviceConfig
if normalizeServiceNames(name) != name {
log.Infof("Service name in docker-compose has been changed from %q to %q", name, normalizeServiceNames(name))
}
}
return komposeObject, nil