@@ -666,7 +666,7 @@ func TestCoreDNSAddon(t *testing.T) {
666
666
client : newMockClientForTest (t , 2 , 1 , "" , "" , "" ),
667
667
printManifest : true ,
668
668
},
669
- wantOut : dedent .Dedent (`---
669
+ wantOut : dedent .Dedent (fmt . Sprintf ( `---
670
670
apiVersion: apps/v1
671
671
kind: Deployment
672
672
metadata:
@@ -710,7 +710,7 @@ spec:
710
710
kubernetes.io/os: linux
711
711
containers:
712
712
- name: coredns
713
- image: foo.bar.io/coredns:v1.11.3
713
+ image: foo.bar.io/coredns:%s
714
714
imagePullPolicy: IfNotPresent
715
715
resources:
716
716
limits:
@@ -866,7 +866,7 @@ kind: ServiceAccount
866
866
metadata:
867
867
name: coredns
868
868
namespace: kube-system
869
- ` ),
869
+ ` , kubeadmconstants . CoreDNSVersion ) ),
870
870
wantErr : false ,
871
871
},
872
872
}
@@ -950,7 +950,7 @@ func TestEnsureDNSAddon(t *testing.T) {
950
950
client : newMockClientForTest (t , 0 , 1 , "" , "" , "" ),
951
951
printManifest : true ,
952
952
},
953
- wantOut : dedent .Dedent (`---
953
+ wantOut : dedent .Dedent (fmt . Sprintf ( `---
954
954
apiVersion: apps/v1
955
955
kind: Deployment
956
956
metadata:
@@ -994,7 +994,7 @@ spec:
994
994
kubernetes.io/os: linux
995
995
containers:
996
996
- name: coredns
997
- image: foo.bar.io/coredns:v1.11.3
997
+ image: foo.bar.io/coredns:%s
998
998
imagePullPolicy: IfNotPresent
999
999
resources:
1000
1000
limits:
@@ -1150,7 +1150,7 @@ kind: ServiceAccount
1150
1150
metadata:
1151
1151
name: coredns
1152
1152
namespace: kube-system
1153
- ` ),
1153
+ ` , kubeadmconstants . CoreDNSVersion ) ),
1154
1154
wantErr : false ,
1155
1155
},
1156
1156
}
@@ -1423,28 +1423,28 @@ func TestDeployedDNSAddon(t *testing.T) {
1423
1423
}{
1424
1424
{
1425
1425
name : "default" ,
1426
- image : "registry.k8s.io/coredns/coredns:v1.11.3" ,
1426
+ image : "registry.k8s.io/coredns/coredns:" + kubeadmconstants . CoreDNSVersion ,
1427
1427
deploymentSize : 1 ,
1428
- wantVersion : "v1.11.3" ,
1428
+ wantVersion : kubeadmconstants . CoreDNSVersion ,
1429
1429
},
1430
1430
{
1431
1431
name : "no dns addon deployment" ,
1432
- image : "registry.k8s.io/coredns/coredns:v1.11.3" ,
1432
+ image : "registry.k8s.io/coredns/coredns:" + kubeadmconstants . CoreDNSVersion ,
1433
1433
deploymentSize : 0 ,
1434
1434
wantVersion : "" ,
1435
1435
},
1436
1436
{
1437
1437
name : "multiple dns addon deployment" ,
1438
- image : "registry.k8s.io/coredns/coredns:v1.11.3" ,
1438
+ image : "registry.k8s.io/coredns/coredns:" + kubeadmconstants . CoreDNSVersion ,
1439
1439
deploymentSize : 2 ,
1440
1440
wantVersion : "" ,
1441
1441
wantErr : true ,
1442
1442
},
1443
1443
{
1444
1444
name : "with digest" ,
1445
- image : "registry.k8s.io/coredns/coredns:v1.11.3 @sha256:a0ead06651cf580044aeb0a0feba63591858fb2e43ade8c9dea45a6a89ae7e5e" ,
1445
+ image : "registry.k8s.io/coredns/coredns:v1.12.0 @sha256:a0ead06651cf580044aeb0a0feba63591858fb2e43ade8c9dea45a6a89ae7e5e" ,
1446
1446
deploymentSize : 1 ,
1447
- wantVersion : "v1.11.3" ,
1447
+ wantVersion : kubeadmconstants . CoreDNSVersion ,
1448
1448
},
1449
1449
{
1450
1450
name : "without registry" ,
@@ -1664,7 +1664,7 @@ func TestIsCoreDNSConfigMapMigrationRequired(t *testing.T) {
1664
1664
// deploymentSize is the number of deployments with `k8s-app=kube-dns` label.
1665
1665
func newMockClientForTest (t * testing.T , replicas int32 , deploymentSize int , image string , configMap string , configData string ) * clientsetfake.Clientset {
1666
1666
if image == "" {
1667
- image = "registry.k8s.io/coredns/coredns:v1.11.3"
1667
+ image = "registry.k8s.io/coredns/coredns:" + kubeadmconstants . CoreDNSVersion
1668
1668
}
1669
1669
client := clientsetfake .NewSimpleClientset ()
1670
1670
for i := 0 ; i < deploymentSize ; i ++ {
0 commit comments