Skip to content

Commit b8e733f

Browse files
committed
Updated symbol 'framework.GetAllMasterAddresses' to not use word 'master'
1 parent 4b24dca commit b8e733f

File tree

4 files changed

+28
-28
lines changed

4 files changed

+28
-28
lines changed

test/e2e/apps/network_partition.go

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -204,14 +204,14 @@ var _ = SIGDescribe("Network Partition [Disruptive] [Slow]", func() {
204204
}()
205205
go controller.Run(stopCh)
206206

207-
ginkgo.By(fmt.Sprintf("Block traffic from node %s to the master", node.Name))
207+
ginkgo.By(fmt.Sprintf("Block traffic from node %s to the control plane", node.Name))
208208
host, err := e2enode.GetExternalIP(&node)
209209
framework.ExpectNoError(err)
210-
masterAddresses := framework.GetAllMasterAddresses(c)
210+
controlPlaneAddresses := framework.GetControlPlaneAddresses(c)
211211
defer func() {
212-
ginkgo.By(fmt.Sprintf("Unblock traffic from node %s to the master", node.Name))
213-
for _, masterAddress := range masterAddresses {
214-
e2enetwork.UnblockNetwork(host, masterAddress)
212+
ginkgo.By(fmt.Sprintf("Unblock traffic from node %s to the control plane", node.Name))
213+
for _, instanceAddress := range controlPlaneAddresses {
214+
e2enetwork.UnblockNetwork(host, instanceAddress)
215215
}
216216

217217
if ginkgo.CurrentGinkgoTestDescription().Failed {
@@ -225,8 +225,8 @@ var _ = SIGDescribe("Network Partition [Disruptive] [Slow]", func() {
225225
}
226226
}()
227227

228-
for _, masterAddress := range masterAddresses {
229-
e2enetwork.BlockNetwork(host, masterAddress)
228+
for _, instanceAddress := range controlPlaneAddresses {
229+
e2enetwork.BlockNetwork(host, instanceAddress)
230230
}
231231

232232
ginkgo.By("Expect to observe node and pod status change from Ready to NotReady after network partition")
@@ -592,14 +592,14 @@ var _ = SIGDescribe("Network Partition [Disruptive] [Slow]", func() {
592592
}()
593593
go controller.Run(stopCh)
594594

595-
ginkgo.By(fmt.Sprintf("Block traffic from node %s to the master", node.Name))
595+
ginkgo.By(fmt.Sprintf("Block traffic from node %s to the control plane", node.Name))
596596
host, err := e2enode.GetExternalIP(&node)
597597
framework.ExpectNoError(err)
598-
masterAddresses := framework.GetAllMasterAddresses(c)
598+
controlPlaneAddresses := framework.GetControlPlaneAddresses(c)
599599
defer func() {
600-
ginkgo.By(fmt.Sprintf("Unblock traffic from node %s to the master", node.Name))
601-
for _, masterAddress := range masterAddresses {
602-
e2enetwork.UnblockNetwork(host, masterAddress)
600+
ginkgo.By(fmt.Sprintf("Unblock traffic from node %s to the control plane", node.Name))
601+
for _, instanceAddress := range controlPlaneAddresses {
602+
e2enetwork.UnblockNetwork(host, instanceAddress)
603603
}
604604

605605
if ginkgo.CurrentGinkgoTestDescription().Failed {
@@ -610,8 +610,8 @@ var _ = SIGDescribe("Network Partition [Disruptive] [Slow]", func() {
610610
expectNodeReadiness(true, newNode)
611611
}()
612612

613-
for _, masterAddress := range masterAddresses {
614-
e2enetwork.BlockNetwork(host, masterAddress)
613+
for _, instanceAddress := range controlPlaneAddresses {
614+
e2enetwork.BlockNetwork(host, instanceAddress)
615615
}
616616

617617
ginkgo.By("Expect to observe node and pod status change from Ready to NotReady after network partition")

test/e2e/framework/network/utils.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -947,25 +947,25 @@ func TestUnderTemporaryNetworkFailure(c clientset.Interface, ns string, node *v1
947947
if err != nil {
948948
framework.Failf("Error getting node external ip : %v", err)
949949
}
950-
masterAddresses := framework.GetAllMasterAddresses(c)
951-
ginkgo.By(fmt.Sprintf("block network traffic from node %s to the master", node.Name))
950+
controlPlaneAddresses := framework.GetControlPlaneAddresses(c)
951+
ginkgo.By(fmt.Sprintf("block network traffic from node %s to the control plane", node.Name))
952952
defer func() {
953953
// This code will execute even if setting the iptables rule failed.
954954
// It is on purpose because we may have an error even if the new rule
955955
// had been inserted. (yes, we could look at the error code and ssh error
956956
// separately, but I prefer to stay on the safe side).
957-
ginkgo.By(fmt.Sprintf("Unblock network traffic from node %s to the master", node.Name))
958-
for _, masterAddress := range masterAddresses {
959-
UnblockNetwork(host, masterAddress)
957+
ginkgo.By(fmt.Sprintf("Unblock network traffic from node %s to the control plane", node.Name))
958+
for _, instanceAddress := range controlPlaneAddresses {
959+
UnblockNetwork(host, instanceAddress)
960960
}
961961
}()
962962

963963
framework.Logf("Waiting %v to ensure node %s is ready before beginning test...", resizeNodeReadyTimeout, node.Name)
964964
if !e2enode.WaitConditionToBe(c, node.Name, v1.NodeReady, true, resizeNodeReadyTimeout) {
965965
framework.Failf("Node %s did not become ready within %v", node.Name, resizeNodeReadyTimeout)
966966
}
967-
for _, masterAddress := range masterAddresses {
968-
BlockNetwork(host, masterAddress)
967+
for _, instanceAddress := range controlPlaneAddresses {
968+
BlockNetwork(host, instanceAddress)
969969
}
970970

971971
framework.Logf("Waiting %v for node %s to be not ready after simulated network failure", resizeNodeNotReadyTimeout, node.Name)

test/e2e/framework/util.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,11 +1247,11 @@ func getMasterAddresses(c clientset.Interface) (string, string, string) {
12471247
return externalIP, internalIP, hostname
12481248
}
12491249

1250-
// GetAllMasterAddresses returns all IP addresses on which the kubelet can reach the master.
1250+
// GetControlPlaneAddresses returns all IP addresses on which the kubelet can reach the control plane.
12511251
// It may return internal and external IPs, even if we expect for
12521252
// e.g. internal IPs to be used (issue #56787), so that we can be
1253-
// sure to block the master fully during tests.
1254-
func GetAllMasterAddresses(c clientset.Interface) []string {
1253+
// sure to block the control plane fully during tests.
1254+
func GetControlPlaneAddresses(c clientset.Interface) []string {
12551255
externalIP, internalIP, _ := getMasterAddresses(c)
12561256

12571257
ips := sets.NewString()

test/e2e/network/firewall.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,10 +216,10 @@ var _ = SIGDescribe("Firewall rule", func() {
216216
framework.Failf("did not find any node addresses")
217217
}
218218

219-
masterAddresses := framework.GetAllMasterAddresses(cs)
220-
for _, masterAddress := range masterAddresses {
221-
assertNotReachableHTTPTimeout(masterAddress, ports.InsecureKubeControllerManagerPort, firewallTestTCPTimeout)
222-
assertNotReachableHTTPTimeout(masterAddress, kubeschedulerconfig.DefaultInsecureSchedulerPort, firewallTestTCPTimeout)
219+
controlPlaneAddresses := framework.GetControlPlaneAddresses(cs)
220+
for _, instanceAddress := range controlPlaneAddresses {
221+
assertNotReachableHTTPTimeout(instanceAddress, ports.InsecureKubeControllerManagerPort, firewallTestTCPTimeout)
222+
assertNotReachableHTTPTimeout(instanceAddress, kubeschedulerconfig.DefaultInsecureSchedulerPort, firewallTestTCPTimeout)
223223
}
224224
assertNotReachableHTTPTimeout(nodeAddr, ports.KubeletPort, firewallTestTCPTimeout)
225225
assertNotReachableHTTPTimeout(nodeAddr, ports.KubeletReadOnlyPort, firewallTestTCPTimeout)

0 commit comments

Comments
 (0)