update .dockercfg content to config.json
update the data format of .dockercfg to match the new docker config.json
format, which encapsulates all registry auth objects in an overall
"auths" object:
{
"auths": {
"reg.url": {
"auth": "...=="
}
}
}
@@ -125,7 +125,9 @@ func (o CreateDockerConfigOptions) NewDockerSecret() (*api.Secret, error) {
Email: o.EmailAddress,
}
- dockerCfg := map[string]credentialprovider.DockerConfigEntry{o.RegistryLocation: dockercfgAuth}
+ dockerCfg := credentialprovider.DockerConfigJson{
+ Auths: map[string]credentialprovider.DockerConfigEntry{o.RegistryLocation: dockercfgAuth},
+ }
dockercfgContent, err := json.Marshal(dockerCfg)
if err != nil {
