Skip to content

Commit

Permalink
fix(lint): remove nolint for error messages
Browse files Browse the repository at this point in the history
It looks like they fixed goconst upstream and it no longer checks this
  • Loading branch information
aauren committed Feb 14, 2025
1 parent 760fcd5 commit d8430e2
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 8 deletions.
1 change: 0 additions & 1 deletion pkg/controllers/netpol/network_policy_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,6 @@ func NewNetworkPolicyController(clientset kubernetes.Interface,
// Validate that ClusterIP service range type matches the configuration
if config.EnableIPv4 && !config.EnableIPv6 {
if !netutils.IsIPv4CIDR(&npc.serviceClusterIPRanges[0]) {
//nolint:goconst // we don't care about abstracting an error message
return nil, fmt.Errorf("failed to get parse --service-cluster-ip-range parameter: " +
"IPv4 is enabled but only IPv6 address is provided")
}
Expand Down
1 change: 0 additions & 1 deletion pkg/controllers/netpol/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ func (npc *NetworkPolicyController) syncPodFirewallChains(networkPoliciesInfo []
for ipFamily, filterTableRules := range npc.filterTableRules {
_, err := getPodIPForFamily(pod, ipFamily)
if err != nil {
//nolint:goconst // don't need to make error messages a constant
klog.V(2).Infof("unable to get address for pod: %s -- skipping drop rules for pod "+
"(this is normal for pods that are not dual-stack)", err.Error())
continue
Expand Down
4 changes: 0 additions & 4 deletions pkg/controllers/netpol/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,6 @@ func (npc *NetworkPolicyController) processIngressRules(policy networkPolicyInfo
}
npc.ipSetHandlers[ipFamily].RefreshSet(namedPortIPSetName, setEntries, utils.TypeHashIP)

//nolint:goconst // don't need to make error messages a constant
comment := "rule to ACCEPT traffic from source pods to dest pods selected by policy name " +
policy.name + " namespace " + policy.namespace
if err := npc.appendRuleToPolicyChain(policyChainName, comment, srcPodIPSetName, namedPortIPSetName,
Expand All @@ -256,7 +255,6 @@ func (npc *NetworkPolicyController) processIngressRules(policy networkPolicyInfo
// with specified port (if any) and protocol
if ingressRule.matchAllSource && !ingressRule.matchAllPorts {
for _, portProtocol := range ingressRule.ports {
//nolint:goconst // don't need to make error messages a constant
comment := "rule to ACCEPT traffic from all sources to dest pods selected by policy name: " +
policy.name + " namespace " + policy.namespace
if err := npc.appendRuleToPolicyChain(policyChainName, comment, "", targetDestPodIPSetName,
Expand Down Expand Up @@ -302,7 +300,6 @@ func (npc *NetworkPolicyController) processIngressRules(policy networkPolicyInfo

if !ingressRule.matchAllPorts {
for _, portProtocol := range ingressRule.ports {
//nolint:goconst // don't need to make error messages a constant
comment := "rule to ACCEPT traffic from specified ipBlocks to dest pods selected by policy name: " +
policy.name + " namespace " + policy.namespace
if err := npc.appendRuleToPolicyChain(policyChainName, comment, srcIPBlockIPSetName,
Expand Down Expand Up @@ -413,7 +410,6 @@ func (npc *NetworkPolicyController) processEgressRules(policy networkPolicyInfo,
// with specified port (if any) and protocol
if egressRule.matchAllDestinations && !egressRule.matchAllPorts {
for _, portProtocol := range egressRule.ports {
//nolint:goconst // don't need to make error messages a constant
comment := "rule to ACCEPT traffic from source pods to all destinations selected by policy name: " +
policy.name + " namespace " + policy.namespace
if err := npc.appendRuleToPolicyChain(policyChainName, comment, targetSourcePodIPSetName,
Expand Down
1 change: 0 additions & 1 deletion pkg/controllers/proxy/service_endpoints_sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,6 @@ func (nsc *NetworkServicesController) addEndpointsToIPVSService(endpoints []endp
switch family {
case v1.IPv4Protocol:
if endpoint.isIPv6 {
//nolint:goconst // don't need to make error messages a constant
klog.V(3).Infof("not adding endpoint %s to service %s with VIP %s because families don't "+
"match", endpoint.ip, svc.name, vip)
continue
Expand Down
1 change: 0 additions & 1 deletion pkg/tunnels/linux_tunnels.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ func (o *OverlayTunnel) SetupOverlayTunnel(tunnelName string, nextHop net.IP,
fouArgs = append(fouArgs, "fou", "add", "port", strFormattedEncapPort, "gue")
out, err := exec.Command("ip", fouArgs...).CombinedOutput()
if err != nil {
//nolint:goconst // don't need to make error messages a constant
return nil, fmt.Errorf("route not injected for the route advertised by the node %s "+
"Failed to set FoU tunnel port - error: %s, output: %s", tunnelName, err, string(out))
}
Expand Down

0 comments on commit d8430e2

Please sign in to comment.