-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Remove docker api dependency from cli/config #1642
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,8 +11,7 @@ import ( | |
| "strings" | ||
|
|
||
| "github.com/docker/cli/cli/config/credentials" | ||
| "github.com/docker/cli/opts" | ||
| "github.com/docker/docker/api/types" | ||
| "github.com/docker/cli/cli/config/types" | ||
| "github.com/pkg/errors" | ||
| ) | ||
|
|
||
|
|
@@ -196,7 +195,7 @@ func (configFile *ConfigFile) Save() error { | |
|
|
||
| // ParseProxyConfig computes proxy configuration by retrieving the config for the provided host and | ||
| // then checking this against any environment variables provided to the container | ||
| func (configFile *ConfigFile) ParseProxyConfig(host string, runOpts []string) map[string]*string { | ||
| func (configFile *ConfigFile) ParseProxyConfig(host string, runOpts map[string]*string) map[string]*string { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, funny, I was working on some refactoring for this a while back related to #1574 (I see I have two implementations, but trying to recall now what was the main difference; 24e1f96 and f0f3511 (master...thaJeztah:refactor_proxy_config and master...thaJeztah:refactor_proxy_config2)
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh, related to that; perhaps you could review #1573 😇
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think they are equivalent refactors. I'm trying to remove dependency of docker/docker from cli/config. It's not pretty but this is what I have :) |
||
| var cfgKey string | ||
|
|
||
| if _, ok := configFile.Proxies[host]; !ok { | ||
|
|
@@ -212,7 +211,10 @@ func (configFile *ConfigFile) ParseProxyConfig(host string, runOpts []string) ma | |
| "NO_PROXY": &config.NoProxy, | ||
| "FTP_PROXY": &config.FTPProxy, | ||
| } | ||
| m := opts.ConvertKVStringsToMapWithNil(runOpts) | ||
| m := runOpts | ||
| if m == nil { | ||
| m = make(map[string]*string) | ||
| } | ||
| for k := range permitted { | ||
| if *permitted[k] == "" { | ||
| continue | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| package types | ||
|
|
||
| // AuthConfig contains authorization information for connecting to a Registry | ||
| type AuthConfig struct { | ||
| Username string `json:"username,omitempty"` | ||
| Password string `json:"password,omitempty"` | ||
| Auth string `json:"auth,omitempty"` | ||
|
|
||
| // Email is an optional value associated with the username. | ||
| // This field is deprecated and will be removed in a later | ||
| // version of docker. | ||
| Email string `json:"email,omitempty"` | ||
|
|
||
| ServerAddress string `json:"serveraddress,omitempty"` | ||
|
|
||
| // IdentityToken is used to authenticate the user and get | ||
| // an access token for the registry. | ||
| IdentityToken string `json:"identitytoken,omitempty"` | ||
|
|
||
| // RegistryToken is a bearer token to be sent to a registry | ||
| RegistryToken string `json:"registrytoken,omitempty"` | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.