|
5 | 5 | "strconv" |
6 | 6 | "strings" |
7 | 7 |
|
8 | | - "github.com/docker/cli/cli/command" |
9 | 8 | "github.com/docker/cli/cli/context" |
10 | 9 | "github.com/docker/cli/cli/context/docker" |
11 | 10 | "github.com/docker/cli/cli/context/store" |
@@ -86,12 +85,12 @@ func validateConfig(config map[string]string, allowedKeys map[string]struct{}) e |
86 | 85 | return errors.New(strings.Join(errs, "\n")) |
87 | 86 | } |
88 | 87 |
|
89 | | -func getDockerEndpoint(dockerCli command.Cli, config map[string]string) (docker.Endpoint, error) { |
| 88 | +func getDockerEndpoint(contextStore store.Reader, config map[string]string) (docker.Endpoint, error) { |
90 | 89 | if err := validateConfig(config, allowedDockerConfigKeys); err != nil { |
91 | 90 | return docker.Endpoint{}, err |
92 | 91 | } |
93 | 92 | if contextName, ok := config[keyFrom]; ok { |
94 | | - metadata, err := dockerCli.ContextStore().GetMetadata(contextName) |
| 93 | + metadata, err := contextStore.GetMetadata(contextName) |
95 | 94 | if err != nil { |
96 | 95 | return docker.Endpoint{}, err |
97 | 96 | } |
@@ -126,8 +125,8 @@ func getDockerEndpoint(dockerCli command.Cli, config map[string]string) (docker. |
126 | 125 | return ep, nil |
127 | 126 | } |
128 | 127 |
|
129 | | -func getDockerEndpointMetadataAndTLS(dockerCli command.Cli, config map[string]string) (docker.EndpointMeta, *store.EndpointTLSData, error) { |
130 | | - ep, err := getDockerEndpoint(dockerCli, config) |
| 128 | +func getDockerEndpointMetadataAndTLS(contextStore store.Reader, config map[string]string) (docker.EndpointMeta, *store.EndpointTLSData, error) { |
| 129 | + ep, err := getDockerEndpoint(contextStore, config) |
131 | 130 | if err != nil { |
132 | 131 | return docker.EndpointMeta{}, nil, err |
133 | 132 | } |
|
0 commit comments