mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-29 21:29:24 +00:00
kubenet for ipv6 dualstack
This commit is contained in:
@@ -28,8 +28,8 @@ import (
|
||||
var (
|
||||
FakeVersion = "0.1.0"
|
||||
|
||||
FakeRuntimeName = "fakeRuntime"
|
||||
FakePodSandboxIP = "192.168.192.168"
|
||||
FakeRuntimeName = "fakeRuntime"
|
||||
FakePodSandboxIPs = []string{"192.168.192.168"}
|
||||
)
|
||||
|
||||
type FakePodSandbox struct {
|
||||
@@ -192,7 +192,7 @@ func (r *FakeRuntimeService) RunPodSandbox(config *runtimeapi.PodSandboxConfig,
|
||||
State: runtimeapi.PodSandboxState_SANDBOX_READY,
|
||||
CreatedAt: createdAt,
|
||||
Network: &runtimeapi.PodSandboxNetworkStatus{
|
||||
Ip: FakePodSandboxIP,
|
||||
Ip: FakePodSandboxIPs[0],
|
||||
},
|
||||
Labels: config.Labels,
|
||||
Annotations: config.Annotations,
|
||||
@@ -200,7 +200,15 @@ func (r *FakeRuntimeService) RunPodSandbox(config *runtimeapi.PodSandboxConfig,
|
||||
},
|
||||
RuntimeHandler: runtimeHandler,
|
||||
}
|
||||
|
||||
// assign additional IPs
|
||||
additionalIPs := FakePodSandboxIPs[1:]
|
||||
additionalPodIPs := make([]*runtimeapi.PodIP, 0, len(additionalIPs))
|
||||
for _, ip := range additionalIPs {
|
||||
additionalPodIPs = append(additionalPodIPs, &runtimeapi.PodIP{
|
||||
Ip: ip,
|
||||
})
|
||||
}
|
||||
r.Sandboxes[podSandboxID].PodSandboxStatus.Network.AdditionalIps = additionalPodIPs
|
||||
return podSandboxID, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user