mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-26 11:03:34 +00:00
feat: support x-machines placement constraints in compose files (#90)
This commit is contained in:
@@ -55,13 +55,16 @@ func ServiceSpecFromCompose(project *types.Project, serviceName string) (api.Ser
|
||||
},
|
||||
Name: serviceName,
|
||||
Mode: api.ServiceModeReplicated,
|
||||
// TODO: implement and map x-machines to Placement.
|
||||
}
|
||||
|
||||
if ports, ok := service.Extensions[PortsExtensionKey].([]api.PortSpec); ok {
|
||||
spec.Ports = ports
|
||||
}
|
||||
|
||||
if machines, ok := service.Extensions[MachinesExtensionKey].(MachinesSource); ok {
|
||||
spec.Placement.Machines = []string(machines)
|
||||
}
|
||||
|
||||
// Map LogDriver if specified
|
||||
if service.Logging != nil && service.Logging.Driver != "" {
|
||||
spec.Container.LogDriver = &api.LogDriver{
|
||||
@@ -85,6 +88,7 @@ func ServiceSpecFromCompose(project *types.Project, serviceName string) (api.Ser
|
||||
default:
|
||||
return spec, fmt.Errorf("unsupported deploy mode: '%s'", service.Deploy.Mode)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// TODO: can service.tmpfs be handled as tmpfs volume mounts as well?
|
||||
|
||||
Reference in New Issue
Block a user