Merge pull request #114597 from songxiao-wang87/runwxs-test10

Add test for cmd/kubeadm/app/images/images.go
This commit is contained in:
Kubernetes Prow Robot 2022-12-22 00:13:25 -08:00 committed by GitHub
commit 30e0e8edb9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -75,6 +75,14 @@ func TestGetKubernetesImage(t *testing.T) {
KubernetesVersion: testversion,
},
},
{
image: constants.KubeProxy,
expected: GetGenericImage(gcrPrefix, "kube-proxy", expected),
cfg: &kubeadmapi.ClusterConfiguration{
ImageRepository: gcrPrefix,
KubernetesVersion: testversion,
},
},
}
for _, rt := range tests {
actual := GetKubernetesImage(rt.image, rt.cfg)
@ -262,6 +270,18 @@ func TestGetDNSImage(t *testing.T) {
},
},
},
{
expected: "foo.io/coredns/coredns:v1.11.0",
cfg: &kubeadmapi.ClusterConfiguration{
ImageRepository: "foo.io/coredns",
DNS: kubeadmapi.DNS{
Type: kubeadmapi.CoreDNS,
ImageMeta: kubeadmapi.ImageMeta{
ImageTag: "v1.11.0",
},
},
},
},
}
for _, test := range tests {