1
0
mirror of https://github.com/rancher/rke.git synced 2025-05-09 00:37:01 +00:00

Add test case for GetKubeletDockerConfig

This covers https://github.com/rancher/rancher/issues/27029
This commit is contained in:
Bastian Hofmann 2020-05-18 15:26:49 +02:00 committed by Denise
parent 089554f0d6
commit e76585ace7

View File

@ -45,3 +45,15 @@ func TestPrivateRegistry(t *testing.T) {
assert.Equal(t, a, a2)
}
func TestGetKubeletDockerConfig(t *testing.T) {
e := "{\"auths\":{\"https://registry.example.com\":{\"auth\":\"dXNlcjE6cGFzc3d+cmQ=\"}}}"
c, err := GetKubeletDockerConfig(map[string]v3.PrivateRegistry{
"https://registry.example.com": v3.PrivateRegistry{
User: "user1",
Password: "passw~rd",
},
})
assert.Nil(t, err)
assert.Equal(t, c, e)
}