Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
Josef Gabrielsson committed Mar 7, 2022
1 parent 8f73d70 commit 4c12e75
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
6 changes: 6 additions & 0 deletions dotyaml.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ type Services struct {
Init string `yaml:"init,omitempty"`
Ipc string `yaml:"ipc,omitempty"`
Labels interface{} `yaml:"labels,omitempty"`
Logging ServicesLogging `yaml:"logging,omitempty"`
MacAddress string `yaml:"mac_address,omitempty"`
MemLimit string `yaml:"mem_limit,omitempty"`
MemReservation string `yaml:"mem_reservation,omitempty"`
Expand Down Expand Up @@ -68,6 +69,11 @@ type Services struct {
WorkingDir string `yaml:"working_dir,omitempty"`
}

type ServicesLogging struct {
Driver string `yaml:"driver,omitempty"`
Options interface{} `yaml:"options,omitempty"`
}

type ServicesBlockIO struct {
Weight int16 `yaml:"weight,omitempty"`
WeightDevice []ServicesBlockIOWeightDevice `yaml:"weight_device,omitempty"`
Expand Down
14 changes: 13 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ func buildCommand(e *Yaml, l []EnvironmentVariable) Command {
}
}

if v.Healthcheck.Test != "" {
if v.Healthcheck.Test != nil {
p := normalizeValue(v.Healthcheck.Test)
arr = append(arr, "--health-cmd", "'"+convertToString(p)+"'")
}
Expand Down Expand Up @@ -301,6 +301,18 @@ func buildCommand(e *Yaml, l []EnvironmentVariable) Command {
arr = append(arr, "--ipc", v.Ipc)
}

if v.Logging.Driver != "" {
arr = append(arr, "--log-driver", v.Logging.Driver)
}

if v.Logging.Options != nil {
for _, r := range normalizeValue(v.Logging.Options) {
p := transformPairs(r)
arr = append(arr, "--log-opt", p.Key)
fmt.Println(p.Key)
}
}

if v.MacAddress != "" {
arr = append(arr, "--mac-address", v.MacAddress)
}
Expand Down

0 comments on commit 4c12e75

Please sign in to comment.