forked from LaconicNetwork/kompose
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:
parent
8590a98504
commit
cc4f162cea
@ -145,7 +145,6 @@ type ServiceConfig struct {
|
||||
CPUQuota int64
|
||||
CapAdd []string
|
||||
CapDrop []string
|
||||
Entrypoint []string
|
||||
Expose []string
|
||||
Privileged bool
|
||||
Restart string
|
||||
|
||||
@ -151,8 +151,8 @@ func (c *Compose) LoadFile(file string) kobject.KomposeObject {
|
||||
serviceConfig := kobject.ServiceConfig{}
|
||||
serviceConfig.Image = composeServiceConfig.Image
|
||||
serviceConfig.ContainerName = composeServiceConfig.ContainerName
|
||||
serviceConfig.Entrypoint = composeServiceConfig.Entrypoint
|
||||
serviceConfig.Command = composeServiceConfig.Command
|
||||
serviceConfig.Command = composeServiceConfig.Entrypoint
|
||||
serviceConfig.Args = composeServiceConfig.Command
|
||||
|
||||
// load environment variables
|
||||
envs := loadEnvVars(composeServiceConfig.Environment.ToMap())
|
||||
|
||||
@ -258,8 +258,8 @@ func UpdateKubernetesObjects(name string, service kobject.ServiceConfig, objects
|
||||
template.Spec.Containers[0].Name = service.ContainerName
|
||||
}
|
||||
template.Spec.Containers[0].Env = envs
|
||||
template.Spec.Containers[0].Command = service.Entrypoint
|
||||
template.Spec.Containers[0].Args = service.Command
|
||||
template.Spec.Containers[0].Command = service.Command
|
||||
template.Spec.Containers[0].Args = service.Args
|
||||
template.Spec.Containers[0].WorkingDir = service.WorkingDir
|
||||
template.Spec.Containers[0].VolumeMounts = volumesMount
|
||||
template.Spec.Volumes = volumes
|
||||
|
||||
@ -42,13 +42,12 @@ func newServiceConfig() kobject.ServiceConfig {
|
||||
Network: []string{"network1", "network2"}, // not supported
|
||||
Labels: nil,
|
||||
Annotations: map[string]string{"abc": "def"},
|
||||
CPUSet: "cpu_set", // not supported
|
||||
CPUShares: 1, // not supported
|
||||
CPUQuota: 1, // not supported
|
||||
CapAdd: []string{"cap_add"}, // not supported
|
||||
CapDrop: []string{"cap_drop"}, // not supported
|
||||
Entrypoint: []string{"entrypoint"}, // not supported
|
||||
Expose: []string{"expose"}, // not supported
|
||||
CPUSet: "cpu_set", // not supported
|
||||
CPUShares: 1, // not supported
|
||||
CPUQuota: 1, // not supported
|
||||
CapAdd: []string{"cap_add"}, // not supported
|
||||
CapDrop: []string{"cap_drop"}, // not supported
|
||||
Expose: []string{"expose"}, // not supported
|
||||
Privileged: true,
|
||||
Restart: "always",
|
||||
User: "user", // not supported
|
||||
|
||||
Loading…
Reference in New Issue
Block a user