Skip to content

Commit

Permalink
Remove options passed to .Refresh()
Browse files Browse the repository at this point in the history
To match the existing code behavior that existed for at least two years
  • Loading branch information
iamakulov committed Aug 19, 2020
1 parent a79eded commit 1a487d2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
16 changes: 8 additions & 8 deletions pkg/controllers/netpol/network_policy_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ func (npc *NetworkPolicyController) syncNetworkPolicyChains(networkPoliciesInfo
if err != nil {
return nil, nil, fmt.Errorf("failed to create ipset: %s", err.Error())
}
err = targetDestPodIPSet.Refresh(currnetPodIps, utils.OptionTimeout, "0")
err = targetDestPodIPSet.Refresh(currnetPodIps)
if err != nil {
glog.Errorf("failed to refresh targetDestPodIPSet,: " + err.Error())
}
Expand All @@ -407,7 +407,7 @@ func (npc *NetworkPolicyController) syncNetworkPolicyChains(networkPoliciesInfo
if err != nil {
return nil, nil, fmt.Errorf("failed to create ipset: %s", err.Error())
}
err = targetSourcePodIPSet.Refresh(currnetPodIps, utils.OptionTimeout, "0")
err = targetSourcePodIPSet.Refresh(currnetPodIps)
if err != nil {
glog.Errorf("failed to refresh targetSourcePodIPSet: " + err.Error())
}
Expand Down Expand Up @@ -458,7 +458,7 @@ func (npc *NetworkPolicyController) processIngressRules(policy networkPolicyInfo
for _, pod := range ingressRule.srcPods {
ingressRuleSrcPodIPs = append(ingressRuleSrcPodIPs, pod.ip)
}
err = srcPodIPSet.Refresh(ingressRuleSrcPodIPs, utils.OptionTimeout, "0")
err = srcPodIPSet.Refresh(ingressRuleSrcPodIPs)
if err != nil {
glog.Errorf("failed to refresh srcPodIPSet: " + err.Error())
}
Expand All @@ -483,7 +483,7 @@ func (npc *NetworkPolicyController) processIngressRules(policy networkPolicyInfo
return fmt.Errorf("failed to create ipset: %s", err.Error())
}
activePolicyIPSets[namedPortIPSet.Name] = true
err = namedPortIPSet.Refresh(endPoints.ips, utils.OptionTimeout, "0")
err = namedPortIPSet.Refresh(endPoints.ips)
if err != nil {
glog.Errorf("failed to refresh namedPortIPSet: " + err.Error())
}
Expand Down Expand Up @@ -526,7 +526,7 @@ func (npc *NetworkPolicyController) processIngressRules(policy networkPolicyInfo

activePolicyIPSets[namedPortIPSet.Name] = true

err = namedPortIPSet.Refresh(endPoints.ips, utils.OptionTimeout, "0")
err = namedPortIPSet.Refresh(endPoints.ips)
if err != nil {
glog.Errorf("failed to refresh namedPortIPSet: " + err.Error())
}
Expand Down Expand Up @@ -577,7 +577,7 @@ func (npc *NetworkPolicyController) processIngressRules(policy networkPolicyInfo

activePolicyIPSets[namedPortIPSet.Name] = true

err = namedPortIPSet.Refresh(endPoints.ips, utils.OptionTimeout, "0")
err = namedPortIPSet.Refresh(endPoints.ips)
if err != nil {
glog.Errorf("failed to refresh namedPortIPSet: " + err.Error())
}
Expand Down Expand Up @@ -634,7 +634,7 @@ func (npc *NetworkPolicyController) processEgressRules(policy networkPolicyInfo,
for _, pod := range egressRule.dstPods {
egressRuleDstPodIps = append(egressRuleDstPodIps, pod.ip)
}
err = dstPodIPSet.Refresh(egressRuleDstPodIps, utils.OptionTimeout, "0")
err = dstPodIPSet.Refresh(egressRuleDstPodIps)
if err != nil {
glog.Errorf("failed to refresh dstPodIPSet: " + err.Error())
}
Expand All @@ -660,7 +660,7 @@ func (npc *NetworkPolicyController) processEgressRules(policy networkPolicyInfo,

activePolicyIPSets[namedPortIPSet.Name] = true

err = namedPortIPSet.Refresh(endPoints.ips, utils.OptionTimeout, "0")
err = namedPortIPSet.Refresh(endPoints.ips)
if err != nil {
glog.Errorf("failed to refresh namedPortIPSet: " + err.Error())
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/controllers/proxy/network_services_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ func (nsc *NetworkServicesController) syncIpvsFirewall() error {
for _, addr := range addrs {
localIPsSets = append(localIPsSets, addr.IP.String())
}
err = localIPsIPSet.Refresh(localIPsSets, utils.OptionTimeout, "0")
err = localIPsIPSet.Refresh(localIPsSets)
if err != nil {
return fmt.Errorf("failed to sync ipset: %s", err.Error())
}
Expand Down Expand Up @@ -702,13 +702,13 @@ func (nsc *NetworkServicesController) syncIpvsFirewall() error {
}

serviceIPsIPSet := nsc.ipsetMap[serviceIPsIPSetName]
err = serviceIPsIPSet.Refresh(serviceIPsSets, utils.OptionTimeout, "0")
err = serviceIPsIPSet.Refresh(serviceIPsSets)
if err != nil {
return fmt.Errorf("failed to sync ipset: %s", err.Error())
}

ipvsServicesIPSet := nsc.ipsetMap[ipvsServicesIPSetName]
err = ipvsServicesIPSet.Refresh(ipvsServicesSets, utils.OptionTimeout, "0")
err = ipvsServicesIPSet.Refresh(ipvsServicesSets)
if err != nil {
return fmt.Errorf("failed to sync ipset: %s", err.Error())
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/controllers/routing/network_routes_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ func (nrc *NetworkRoutingController) syncNodeIPSets() error {
podSubnetsIPSetName)
}
}
err = psSet.Refresh(currentPodCidrs, psSet.Options...)
err = psSet.Refresh(currentPodCidrs)
if err != nil {
return fmt.Errorf("Failed to sync Pod Subnets ipset: %s", err)
}
Expand All @@ -583,7 +583,7 @@ func (nrc *NetworkRoutingController) syncNodeIPSets() error {
nodeAddrsIPSetName)
}
}
err = naSet.Refresh(currentNodeIPs, naSet.Options...)
err = naSet.Refresh(currentNodeIPs)
if err != nil {
return fmt.Errorf("Failed to sync Node Addresses ipset: %s", err)
}
Expand Down

0 comments on commit 1a487d2

Please sign in to comment.