mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 04:33:26 +00:00
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": "...==" } } }
This commit is contained in:
parent
97e002352f
commit
027c8b9ef2
@ -169,6 +169,7 @@ func NewCmdCreateSecretDockerRegistry(f cmdutil.Factory, cmdOut io.Writer) *cobr
|
||||
cmd.Flags().String("docker-email", "", i18n.T("Email for Docker registry"))
|
||||
cmd.Flags().String("docker-server", "https://index.docker.io/v1/", i18n.T("Server location for Docker registry"))
|
||||
cmd.Flags().Bool("append-hash", false, "Append a hash of the secret to its name.")
|
||||
|
||||
cmdutil.AddInclude3rdPartyFlags(cmd)
|
||||
return cmd
|
||||
}
|
||||
|
@ -141,7 +141,9 @@ func handleDockercfgContent(username, password, email, server string) ([]byte, e
|
||||
Email: email,
|
||||
}
|
||||
|
||||
dockerCfg := map[string]credentialprovider.DockerConfigEntry{server: dockercfgAuth}
|
||||
dockerCfg := credentialprovider.DockerConfigJson{
|
||||
Auths: map[string]credentialprovider.DockerConfigEntry{server: dockercfgAuth},
|
||||
}
|
||||
|
||||
return json.Marshal(dockerCfg)
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ func TestSecretForDockerRegistryGenerate(t *testing.T) {
|
||||
},
|
||||
expected: &api.Secret{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "foo-gb4kftc655",
|
||||
Name: "foo-94759gc65b",
|
||||
},
|
||||
Data: map[string][]byte{
|
||||
api.DockerConfigKey: secretData,
|
||||
|
Loading…
Reference in New Issue
Block a user