Skip to content

Commit

Permalink
Propagate underscores into valid names
Browse files Browse the repository at this point in the history
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
  • Loading branch information
procrypt committed Apr 3, 2017
1 parent 99f7010 commit 6e0b934
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion pkg/loader/compose/compose.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkg/transformer/kubernetes/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ func (k *Kubernetes) Deploy(komposeObject kobject.KomposeObject, opt kobject.Con
if !opt.EmptyVols {
pvcStr = " and PersistentVolumeClaims "
}
fmt.Println("We are going to create Kubernetes Deployments, Services" + pvcStr + "for your Dockerized application. \n" +
log.Info("We are going to create Kubernetes Deployments, Services" + pvcStr + "for your Dockerized application. " +
"If you need different kind of resources, use the 'kompose convert' and 'kubectl create -f' commands instead. \n")

client, namespace, err := k.GetKubernetesClient()
Expand Down

0 comments on commit 6e0b934

Please sign in to comment.