Remove Entrypoint from Kompose object

We had Command and Args together with Entrypoint in Kompose object.
This doesn't make much sense, as Entrypoint and Command are same thing.
I've removed Entrypoint from Kompose object in favor of Command to keep
same naming convensions as in Kubernetes.

Entrypoint from docker-compose.yml is now saved to Command and Command
is saved to Args (http://kubernetes.io/docs/user-guide/containers/).

docker-compose.yml | Kompose object
-------------------|---------------
  Entrypoint       |    Command
   Command         |     Args
This commit is contained in:
Tomas Kral 2016-08-30 10:28:59 +02:00
parent 8590a98504
commit cc4f162cea
No known key found for this signature in database
GPG Key ID: E690DA7E4F291FA6
4 changed files with 10 additions and 12 deletions

View File

@ -145,7 +145,6 @@ type ServiceConfig struct {
CPUQuota int64 CPUQuota int64
CapAdd []string CapAdd []string
CapDrop []string CapDrop []string
Entrypoint []string
Expose []string Expose []string
Privileged bool Privileged bool
Restart string Restart string

View File

@ -151,8 +151,8 @@ func (c *Compose) LoadFile(file string) kobject.KomposeObject {
serviceConfig := kobject.ServiceConfig{} serviceConfig := kobject.ServiceConfig{}
serviceConfig.Image = composeServiceConfig.Image serviceConfig.Image = composeServiceConfig.Image
serviceConfig.ContainerName = composeServiceConfig.ContainerName serviceConfig.ContainerName = composeServiceConfig.ContainerName
serviceConfig.Entrypoint = composeServiceConfig.Entrypoint serviceConfig.Command = composeServiceConfig.Entrypoint
serviceConfig.Command = composeServiceConfig.Command serviceConfig.Args = composeServiceConfig.Command
// load environment variables // load environment variables
envs := loadEnvVars(composeServiceConfig.Environment.ToMap()) envs := loadEnvVars(composeServiceConfig.Environment.ToMap())

View File

@ -258,8 +258,8 @@ func UpdateKubernetesObjects(name string, service kobject.ServiceConfig, objects
template.Spec.Containers[0].Name = service.ContainerName template.Spec.Containers[0].Name = service.ContainerName
} }
template.Spec.Containers[0].Env = envs template.Spec.Containers[0].Env = envs
template.Spec.Containers[0].Command = service.Entrypoint template.Spec.Containers[0].Command = service.Command
template.Spec.Containers[0].Args = service.Command template.Spec.Containers[0].Args = service.Args
template.Spec.Containers[0].WorkingDir = service.WorkingDir template.Spec.Containers[0].WorkingDir = service.WorkingDir
template.Spec.Containers[0].VolumeMounts = volumesMount template.Spec.Containers[0].VolumeMounts = volumesMount
template.Spec.Volumes = volumes template.Spec.Volumes = volumes

View File

@ -47,7 +47,6 @@ func newServiceConfig() kobject.ServiceConfig {
CPUQuota: 1, // not supported CPUQuota: 1, // not supported
CapAdd: []string{"cap_add"}, // not supported CapAdd: []string{"cap_add"}, // not supported
CapDrop: []string{"cap_drop"}, // not supported CapDrop: []string{"cap_drop"}, // not supported
Entrypoint: []string{"entrypoint"}, // not supported
Expose: []string{"expose"}, // not supported Expose: []string{"expose"}, // not supported
Privileged: true, Privileged: true,
Restart: "always", Restart: "always",