mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #29123 from vdemeester/29116-compose-to-swarm-logging
Handle logging in compose to swarm
This commit is contained in:
commit
1f09d68a6e
3 changed files with 15 additions and 6 deletions
|
@ -19,3 +19,9 @@ type Annotations struct {
|
||||||
Name string `json:",omitempty"`
|
Name string `json:",omitempty"`
|
||||||
Labels map[string]string `json:",omitempty"`
|
Labels map[string]string `json:",omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Driver represents a driver (network, logging).
|
||||||
|
type Driver struct {
|
||||||
|
Name string `json:",omitempty"`
|
||||||
|
Options map[string]string `json:",omitempty"`
|
||||||
|
}
|
||||||
|
|
|
@ -109,9 +109,3 @@ type IPAMConfig struct {
|
||||||
Range string `json:",omitempty"`
|
Range string `json:",omitempty"`
|
||||||
Gateway string `json:",omitempty"`
|
Gateway string `json:",omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Driver represents a network driver.
|
|
||||||
type Driver struct {
|
|
||||||
Name string `json:",omitempty"`
|
|
||||||
Options map[string]string `json:",omitempty"`
|
|
||||||
}
|
|
||||||
|
|
|
@ -567,6 +567,14 @@ func convertService(
|
||||||
return swarm.ServiceSpec{}, err
|
return swarm.ServiceSpec{}, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var logDriver *swarm.Driver
|
||||||
|
if service.Logging != nil {
|
||||||
|
logDriver = &swarm.Driver{
|
||||||
|
Name: service.Logging.Driver,
|
||||||
|
Options: service.Logging.Options,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
serviceSpec := swarm.ServiceSpec{
|
serviceSpec := swarm.ServiceSpec{
|
||||||
Annotations: swarm.Annotations{
|
Annotations: swarm.Annotations{
|
||||||
Name: name,
|
Name: name,
|
||||||
|
@ -589,6 +597,7 @@ func convertService(
|
||||||
TTY: service.Tty,
|
TTY: service.Tty,
|
||||||
OpenStdin: service.StdinOpen,
|
OpenStdin: service.StdinOpen,
|
||||||
},
|
},
|
||||||
|
LogDriver: logDriver,
|
||||||
Resources: resources,
|
Resources: resources,
|
||||||
RestartPolicy: restartPolicy,
|
RestartPolicy: restartPolicy,
|
||||||
Placement: &swarm.Placement{
|
Placement: &swarm.Placement{
|
||||||
|
|
Loading…
Reference in a new issue