@@ -85,24 +85,24 @@ func parseConfig(cfg dockercfg.Config, reg string) (AuthConfig, error) {
85
85
return toAuthConfig (username , secret ), nil
86
86
}
87
87
88
- // // This to preserve backwards compatibility with older variants of envbox
89
- // // that didn't mandate a hostname key in the config file. We just take the
90
- // // first valid auth config we find and use that.
91
- // for _, auth := range cfg.AuthConfigs {
92
- // if auth.IdentityToken != "" {
93
- // return toAuthConfig("", auth.IdentityToken), nil
94
- // }
95
-
96
- // if auth.Username != "" && auth.Password != "" {
97
- // return toAuthConfig(auth.Username, auth.Password), nil
98
- // }
99
-
100
- // username, secret, err = dockercfg.DecodeBase64Auth(auth)
101
- // if err == nil && secret != "" {
102
- // return toAuthConfig(username, secret), nil
103
- // }
104
- // // Invalid auth config, skip it.
105
- // }
88
+ // This to preserve backwards compatibility with older variants of envbox
89
+ // that didn't mandate a hostname key in the config file. We just take the
90
+ // first valid auth config we find and use that.
91
+ for _ , auth := range cfg .AuthConfigs {
92
+ if auth .IdentityToken != "" {
93
+ return toAuthConfig ("" , auth .IdentityToken ), nil
94
+ }
95
+
96
+ if auth .Username != "" && auth .Password != "" {
97
+ return toAuthConfig (auth .Username , auth .Password ), nil
98
+ }
99
+
100
+ username , secret , err = dockercfg .DecodeBase64Auth (auth )
101
+ if err == nil && secret != "" {
102
+ return toAuthConfig (username , secret ), nil
103
+ }
104
+ // Invalid auth config, skip it.
105
+ }
106
106
107
107
return AuthConfig {}, xerrors .Errorf ("no auth config found for registry %s: %w" , reg , os .ErrNotExist )
108
108
}
0 commit comments