vendor: update everything

* If possible, update each dependency to the latest available version.

* Use releases over commit IDs and avoid vendoring branches.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
This commit is contained in:
Valentin Rothberg
2019-01-08 14:52:57 +01:00
parent 545f244212
commit bd40dcfc2b
920 changed files with 284288 additions and 43641 deletions

View File

@ -27,6 +27,11 @@ type AuthConfiguration struct {
Password string `json:"password,omitempty"`
Email string `json:"email,omitempty"`
ServerAddress string `json:"serveraddress,omitempty"`
// IdentityToken can be supplied with the identitytoken response of the AuthCheck call
// see https://godoc.org/github.com/docker/docker/api/types#AuthConfig
// It can be used in place of password not in conjunction with it
IdentityToken string `json:"identitytoken,omitempty"`
}
// AuthConfigurations represents authentication options to use for the
@ -42,8 +47,9 @@ type AuthConfigurations119 map[string]AuthConfiguration
// dockerConfig represents a registry authentation configuration from the
// .dockercfg file.
type dockerConfig struct {
Auth string `json:"auth"`
Email string `json:"email"`
Auth string `json:"auth"`
Email string `json:"email"`
IdentityToken string `json:"identitytoken"`
}
// NewAuthConfigurationsFromFile returns AuthConfigurations from a path containing JSON
@ -128,6 +134,7 @@ func authConfigs(confs map[string]dockerConfig) (*AuthConfigurations, error) {
c := &AuthConfigurations{
Configs: make(map[string]AuthConfiguration),
}
for reg, conf := range confs {
if conf.Auth == "" {
continue
@ -136,17 +143,28 @@ func authConfigs(confs map[string]dockerConfig) (*AuthConfigurations, error) {
if err != nil {
return nil, err
}
userpass := strings.SplitN(string(data), ":", 2)
if len(userpass) != 2 {
return nil, ErrCannotParseDockercfg
}
c.Configs[reg] = AuthConfiguration{
authConfig := AuthConfiguration{
Email: conf.Email,
Username: userpass[0],
Password: userpass[1],
ServerAddress: reg,
}
// if identitytoken provided then zero the password and set it
if conf.IdentityToken != "" {
authConfig.Password = ""
authConfig.IdentityToken = conf.IdentityToken
}
c.Configs[reg] = authConfig
}
return c, nil
}