add apiServerCertSANs case for test GetAltNames

This commit is contained in:
wackxu 2017-11-13 11:02:04 +08:00
parent 46c2bfe47d
commit f65fbde607

View File

@ -265,6 +265,7 @@ func TestGetAltNames(t *testing.T) {
API: kubeadmapi.API{AdvertiseAddress: advertiseIP},
Networking: kubeadmapi.Networking{ServiceSubnet: "10.96.0.0/12", DNSDomain: "cluster.local"},
NodeName: hostname,
APIServerCertSANs: []string{"10.1.245.94", "10.1.245.95"},
}
altNames, err := getAltNames(cfg)
@ -287,7 +288,7 @@ func TestGetAltNames(t *testing.T) {
}
}
expectedIPAddresses := []string{"10.96.0.1", advertiseIP}
expectedIPAddresses := []string{"10.96.0.1", advertiseIP, "10.1.245.94", "10.1.245.95"}
for _, IPAddress := range expectedIPAddresses {
found := false
for _, val := range altNames.IPs {