diff --git a/controllers/clusterwidenetworkpolicy_controller.go b/controllers/clusterwidenetworkpolicy_controller.go index 797d5a3d..9a169693 100644 --- a/controllers/clusterwidenetworkpolicy_controller.go +++ b/controllers/clusterwidenetworkpolicy_controller.go @@ -154,9 +154,9 @@ func (r *ClusterwideNetworkPolicyReconciler) manageDNSProxy( // If proxy is ON, update DNS address(if it's set in spec) if r.DnsProxy != nil && f.Spec.DNSServerAddress != "" { - port := 53 + port := uint(53) if f.Spec.DNSPort != nil { - port = int(*f.Spec.DNSPort) + port = *f.Spec.DNSPort } addr := fmt.Sprintf("%s:%d", f.Spec.DNSServerAddress, port) if err = r.DnsProxy.UpdateDNSServerAddr(addr); err != nil { diff --git a/pkg/dns/dnsproxy.go b/pkg/dns/dnsproxy.go index 7e5a13a3..66749e7d 100644 --- a/pkg/dns/dnsproxy.go +++ b/pkg/dns/dnsproxy.go @@ -148,7 +148,7 @@ func bindToPort(host string, port uint, log logr.Logger) (*net.UDPConn, *net.TCP var listener net.Listener var conn net.PacketConn - bindAddr := net.JoinHostPort(host, strconv.Itoa(int(port))) + bindAddr := net.JoinHostPort(host, strconv.FormatUint(uint64(port), 10)) defer func() { if err != nil { diff --git a/pkg/nftables/firewall_test.go b/pkg/nftables/firewall_test.go index 36d7f129..d18729ae 100644 --- a/pkg/nftables/firewall_test.go +++ b/pkg/nftables/firewall_test.go @@ -19,7 +19,7 @@ func init() { // or to run only the integration test go test Integration func TestFirewallValidateRulesIntegration(t *testing.T) { if os.Getegid() != 0 { - t.Skipf(color.YellowString("skipping integration test because not root")) + t.Skipf(color.YellowString("skipping integration test because not root")) //nolint:govet } type fields struct {