Skip to content

Commit

Permalink
fact(NSC): update Errorf syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
aauren committed Jan 5, 2024
1 parent a0fe844 commit 30d3769
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/controllers/proxy/network_services_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -1612,24 +1612,24 @@ func (nsc *NetworkServicesController) cleanupMangleTableRule(ip string, protocol
args := []string{"-d", ip, "-m", protocol, "-p", protocol, "--dport", port, "-j", "MARK", "--set-mark", fwmark}
exists, err := iptablesCmdHandler.Exists("mangle", "PREROUTING", args...)
if err != nil {
return fmt.Errorf("Failed to cleanup iptables command to set up FWMARK due to " + err.Error())
return fmt.Errorf("failed to cleanup iptables command to set up FWMARK due to %v", err)
}
if exists {
klog.V(2).Infof("removing mangle rule with: iptables -D PREROUTING -t mangle %s", args)
err = iptablesCmdHandler.Delete("mangle", "PREROUTING", args...)
if err != nil {
return fmt.Errorf("Failed to cleanup iptables command to set up FWMARK due to " + err.Error())
return fmt.Errorf("failed to cleanup iptables command to set up FWMARK due to %v", err)
}
}
exists, err = iptablesCmdHandler.Exists("mangle", "OUTPUT", args...)
if err != nil {
return fmt.Errorf("Failed to cleanup iptables command to set up FWMARK due to " + err.Error())
return fmt.Errorf("failed to cleanup iptables command to set up FWMARK due to %v", err)
}
if exists {
klog.V(2).Infof("removing mangle rule with: iptables -D OUTPUT -t mangle %s", args)
err = iptablesCmdHandler.Delete("mangle", "OUTPUT", args...)
if err != nil {
return fmt.Errorf("Failed to cleanup iptables command to set up FWMARK due to " + err.Error())
return fmt.Errorf("failed to cleanup iptables command to set up FWMARK due to %v", err)
}
}

Expand Down

0 comments on commit 30d3769

Please sign in to comment.