(config *container.Config)
| 801 | } |
| 802 | |
| 803 | func cloneContainerConfig(config *container.Config) *container.Config { |
| 804 | if config == nil { |
| 805 | return &container.Config{} |
| 806 | } |
| 807 | item := *config |
| 808 | if len(config.Env) != 0 { |
| 809 | item.Env = append([]string(nil), config.Env...) |
| 810 | } |
| 811 | if len(config.Cmd) != 0 { |
| 812 | item.Cmd = append([]string(nil), config.Cmd...) |
| 813 | } |
| 814 | if len(config.Entrypoint) != 0 { |
| 815 | item.Entrypoint = append([]string(nil), config.Entrypoint...) |
| 816 | } |
| 817 | if len(config.Labels) != 0 { |
| 818 | labels := make(map[string]string, len(config.Labels)) |
| 819 | for key, val := range config.Labels { |
| 820 | labels[key] = val |
| 821 | } |
| 822 | item.Labels = labels |
| 823 | } |
| 824 | if len(config.Volumes) != 0 { |
| 825 | volumes := make(map[string]struct{}, len(config.Volumes)) |
| 826 | for key, val := range config.Volumes { |
| 827 | volumes[key] = val |
| 828 | } |
| 829 | item.Volumes = volumes |
| 830 | } |
| 831 | return &item |
| 832 | } |
| 833 | |
| 834 | func cloneContainerHostConfig(hostConfig *container.HostConfig) *container.HostConfig { |
| 835 | if hostConfig == nil { |
no outgoing calls
no test coverage detected