kubenet for ipv6 dualstack

This commit is contained in:
Khaled Henidak(Kal)
2019-07-02 15:45:42 +00:00
parent 404dbbcfe0
commit dba434c4ba
25 changed files with 718 additions and 326 deletions

View File

@@ -23,6 +23,7 @@ import (
goruntime "runtime"
"sort"
"strconv"
"strings"
"sync/atomic"
"testing"
"time"
@@ -1004,11 +1005,12 @@ func TestUpdateNodeStatusWithLease(t *testing.T) {
// Report node status if it is still within the duration of nodeStatusReportFrequency.
clock.Step(10 * time.Second)
assert.Equal(t, "", kubelet.runtimeState.podCIDR(), "Pod CIDR should be empty")
podCIDR := "10.0.0.0/24"
updatedNode.Spec.PodCIDR = podCIDR
podCIDRs := []string{"10.0.0.0/24", "2000::/10"}
updatedNode.Spec.PodCIDR = podCIDRs[0]
updatedNode.Spec.PodCIDRs = podCIDRs
kubeClient.ReactionChain = fake.NewSimpleClientset(&v1.NodeList{Items: []v1.Node{*updatedNode}}).ReactionChain
assert.NoError(t, kubelet.updateNodeStatus())
assert.Equal(t, podCIDR, kubelet.runtimeState.podCIDR(), "Pod CIDR should be updated now")
assert.Equal(t, strings.Join(podCIDRs, ","), kubelet.runtimeState.podCIDR(), "Pod CIDR should be updated now")
// 2 more action (There were 7 actions before).
actions = kubeClient.Actions()
assert.Len(t, actions, 9)
@@ -1019,7 +1021,8 @@ func TestUpdateNodeStatusWithLease(t *testing.T) {
// Update node status when keeping the pod CIDR.
// Do not report node status if it is within the duration of nodeStatusReportFrequency.
clock.Step(10 * time.Second)
assert.Equal(t, podCIDR, kubelet.runtimeState.podCIDR(), "Pod CIDR should already be updated")
assert.Equal(t, strings.Join(podCIDRs, ","), kubelet.runtimeState.podCIDR(), "Pod CIDR should already be updated")
assert.NoError(t, kubelet.updateNodeStatus())
// Only 1 more action (There were 9 actions before).
actions = kubeClient.Actions()