Skip to content

Commit 8bc07da

Browse files
authored
Keep the behavior on Windows same as before' (#681)
1 parent 41232c1 commit 8bc07da

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

cni/network/network.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ func (plugin *netPlugin) Start(config *common.PluginConfig) error {
119119
common.LogNetworkInterfaces()
120120

121121
// Initialize network manager.
122-
err = plugin.nm.Initialize(config, false)
122+
err = plugin.nm.Initialize(config, rehydrateNetworkInfoOnReboot)
123123
if err != nil {
124124
log.Printf("[cni-net] Failed to initialize network manager, err:%v.", err)
125125
return err

cni/network/network_linux.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ const (
2121
)
2222

2323
const (
24-
snatConfigFileName = "/tmp/snatConfig"
24+
snatConfigFileName = "/tmp/snatConfig"
25+
rehydrateNetworkInfoOnReboot = false
2526
)
2627

2728
// handleConsecutiveAdd is a dummy function for Linux platform.

cni/network/network_windows.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ var (
2828
win1903Version = 18362
2929
)
3030

31+
const (
32+
rehydrateNetworkInfoOnReboot = true
33+
)
34+
3135
/* handleConsecutiveAdd handles consecutive add calls for infrastructure containers on Windows platform.
3236
* This is a temporary work around for issue #57253 of Kubernetes.
3337
* We can delete this if statement once they fix it.
@@ -268,7 +272,7 @@ func addIPV6EndpointPolicy(nwInfo network.NetworkInfo) (policy.Policy, error) {
268272
return eppolicy, fmt.Errorf("network state doesn't have ipv6 subnet")
269273
}
270274

271-
// Everything should be snat'd except podcidr
275+
// Everything should be snat'd except podcidr
272276
exceptionList := []string{nwInfo.Subnets[1].Prefix.String()}
273277
rawPolicy, _ := json.Marshal(&hcsshim.OutboundNatPolicy{
274278
Policy: hcsshim.Policy{Type: hcsshim.OutboundNat},

0 commit comments

Comments
 (0)