convertEnvironment converts key/value mappings to a slice, and sorts the results.
(source map[string]*string)
| 614 | // convertEnvironment converts key/value mappings to a slice, and sorts |
| 615 | // the results. |
| 616 | func convertEnvironment(source map[string]*string) []string { |
| 617 | var output []string |
| 618 | |
| 619 | for name, value := range source { |
| 620 | switch value { |
| 621 | case nil: |
| 622 | output = append(output, name) |
| 623 | default: |
| 624 | output = append(output, name+"="+*value) |
| 625 | } |
| 626 | } |
| 627 | sort.Strings(output) |
| 628 | return output |
| 629 | } |
| 630 | |
| 631 | func convertDeployMode(mode string, replicas *uint64) (swarm.ServiceMode, error) { |
| 632 | serviceMode := swarm.ServiceMode{} |
no outgoing calls
searching dependent graphs…