diff --git a/pkg/kubelet/kubelet_network.go b/pkg/kubelet/kubelet_network.go index 3a303487436..4c7135e192d 100644 --- a/pkg/kubelet/kubelet_network.go +++ b/pkg/kubelet/kubelet_network.go @@ -281,11 +281,13 @@ func (kl *Kubelet) syncNetworkStatus() { // updatePodCIDR updates the pod CIDR in the runtime state if it is different // from the current CIDR. func (kl *Kubelet) updatePodCIDR(cidr string) { - if kl.runtimeState.podCIDR() == cidr { + podCIDR := kl.runtimeState.podCIDR() + + if podCIDR == cidr { return } - glog.Infof("Setting Pod CIDR: %v -> %v", kl.runtimeState.podCIDR(), cidr) + glog.Infof("Setting Pod CIDR: %v -> %v", podCIDR, cidr) kl.runtimeState.setPodCIDR(cidr) if kl.networkPlugin != nil {