From c1ce1e00ee9306aa508b537b490b236a21f52152 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Mon, 18 Dec 2023 20:12:51 -0500 Subject: [PATCH] Properly build-tag the Linux kube-proxy backend code This had to be able to build on OS X before to make verify-typecheck pass, but now that that's fixed we can tag the code properly as being linux-only. --- .../app/{init_others.go => init_linux.go} | 4 +- .../app/{server_others.go => server_linux.go} | 4 +- ...er_others_test.go => server_linux_test.go} | 4 +- pkg/proxy/conntrack/cleanup.go | 3 + pkg/proxy/conntrack/conntrack.go | 3 + pkg/proxy/conntrack/conntrack_test.go | 3 + .../iptables/number_generated_rules_test.go | 3 + pkg/proxy/iptables/proxier.go | 3 + pkg/proxy/iptables/proxier_test.go | 3 + pkg/proxy/ipvs/graceful_termination.go | 3 + pkg/proxy/ipvs/graceful_termination_test.go | 4 +- pkg/proxy/ipvs/ipset.go | 3 + pkg/proxy/ipvs/ipset/ipset.go | 3 + pkg/proxy/ipvs/ipset/ipset_test.go | 3 + pkg/proxy/ipvs/ipset/testing/fake.go | 3 + pkg/proxy/ipvs/ipset/testing/fake_test.go | 3 + pkg/proxy/ipvs/ipset/types.go | 3 + pkg/proxy/ipvs/ipset_test.go | 4 +- pkg/proxy/ipvs/netlink_unsupported.go | 82 ------------------- pkg/proxy/ipvs/proxier.go | 3 + pkg/proxy/ipvs/proxier_test.go | 4 +- pkg/proxy/ipvs/testing/fake.go | 3 + pkg/proxy/ipvs/testing/fake_test.go | 3 + pkg/proxy/ipvs/testing/util.go | 3 + pkg/proxy/ipvs/util/ipvs.go | 3 + pkg/proxy/ipvs/util/ipvs_test.go | 3 + pkg/proxy/ipvs/util/ipvs_unsupported.go | 79 ------------------ pkg/proxy/ipvs/util/testing/fake.go | 3 + pkg/proxy/ipvs/util/testing/fake_test.go | 3 + pkg/proxy/nftables/helpers_test.go | 3 + pkg/proxy/nftables/proxier.go | 3 + pkg/proxy/nftables/proxier_test.go | 3 + pkg/util/iptables/iptables.go | 3 + pkg/util/iptables/iptables_unsupported.go | 33 -------- pkg/util/iptables/save_restore.go | 3 + pkg/util/iptables/save_restore_test.go | 3 + pkg/util/iptables/testing/fake.go | 3 + pkg/util/iptables/testing/fake_test.go | 3 + pkg/util/iptables/testing/parse.go | 3 + pkg/util/iptables/testing/parse_test.go | 3 + 40 files changed, 105 insertions(+), 206 deletions(-) rename cmd/kube-proxy/app/{init_others.go => init_linux.go} (94%) rename cmd/kube-proxy/app/{server_others.go => server_linux.go} (99%) rename cmd/kube-proxy/app/{server_others_test.go => server_linux_test.go} (99%) delete mode 100644 pkg/proxy/ipvs/netlink_unsupported.go delete mode 100644 pkg/proxy/ipvs/util/ipvs_unsupported.go delete mode 100644 pkg/util/iptables/iptables_unsupported.go diff --git a/cmd/kube-proxy/app/init_others.go b/cmd/kube-proxy/app/init_linux.go similarity index 94% rename from cmd/kube-proxy/app/init_others.go rename to cmd/kube-proxy/app/init_linux.go index cee69f1a0eb..7e0ff787fe1 100644 --- a/cmd/kube-proxy/app/init_others.go +++ b/cmd/kube-proxy/app/init_linux.go @@ -1,5 +1,5 @@ -//go:build !windows -// +build !windows +//go:build linux +// +build linux /* Copyright 2018 The Kubernetes Authors. diff --git a/cmd/kube-proxy/app/server_others.go b/cmd/kube-proxy/app/server_linux.go similarity index 99% rename from cmd/kube-proxy/app/server_others.go rename to cmd/kube-proxy/app/server_linux.go index 9d90ca92fa5..b91adaf5154 100644 --- a/cmd/kube-proxy/app/server_others.go +++ b/cmd/kube-proxy/app/server_linux.go @@ -1,5 +1,5 @@ -//go:build !windows -// +build !windows +//go:build linux +// +build linux /* Copyright 2014 The Kubernetes Authors. diff --git a/cmd/kube-proxy/app/server_others_test.go b/cmd/kube-proxy/app/server_linux_test.go similarity index 99% rename from cmd/kube-proxy/app/server_others_test.go rename to cmd/kube-proxy/app/server_linux_test.go index 959e2972b01..ec47c5d6c48 100644 --- a/cmd/kube-proxy/app/server_others_test.go +++ b/cmd/kube-proxy/app/server_linux_test.go @@ -1,5 +1,5 @@ -//go:build !windows -// +build !windows +//go:build linux +// +build linux /* Copyright 2018 The Kubernetes Authors. diff --git a/pkg/proxy/conntrack/cleanup.go b/pkg/proxy/conntrack/cleanup.go index 4d25ff2f861..f99ab89770a 100644 --- a/pkg/proxy/conntrack/cleanup.go +++ b/pkg/proxy/conntrack/cleanup.go @@ -1,3 +1,6 @@ +//go:build linux +// +build linux + /* Copyright 2023 The Kubernetes Authors. diff --git a/pkg/proxy/conntrack/conntrack.go b/pkg/proxy/conntrack/conntrack.go index 450ca1dda3a..3a1925b8675 100644 --- a/pkg/proxy/conntrack/conntrack.go +++ b/pkg/proxy/conntrack/conntrack.go @@ -1,3 +1,6 @@ +//go:build linux +// +build linux + /* Copyright 2016 The Kubernetes Authors. diff --git a/pkg/proxy/conntrack/conntrack_test.go b/pkg/proxy/conntrack/conntrack_test.go index 18a7aab4e7b..a4b17ca5b07 100644 --- a/pkg/proxy/conntrack/conntrack_test.go +++ b/pkg/proxy/conntrack/conntrack_test.go @@ -1,3 +1,6 @@ +//go:build linux +// +build linux + /* Copyright 2015 The Kubernetes Authors. diff --git a/pkg/proxy/iptables/number_generated_rules_test.go b/pkg/proxy/iptables/number_generated_rules_test.go index e160d5407f1..959b3f165cb 100644 --- a/pkg/proxy/iptables/number_generated_rules_test.go +++ b/pkg/proxy/iptables/number_generated_rules_test.go @@ -1,3 +1,6 @@ +//go:build linux +// +build linux + /* Copyright 2022 The Kubernetes Authors. diff --git a/pkg/proxy/iptables/proxier.go b/pkg/proxy/iptables/proxier.go index 1109e096324..d673519b859 100644 --- a/pkg/proxy/iptables/proxier.go +++ b/pkg/proxy/iptables/proxier.go @@ -1,3 +1,6 @@ +//go:build linux +// +build linux + /* Copyright 2015 The Kubernetes Authors. diff --git a/pkg/proxy/iptables/proxier_test.go b/pkg/proxy/iptables/proxier_test.go index e0d5e236fcf..32ab725fd4d 100644 --- a/pkg/proxy/iptables/proxier_test.go +++ b/pkg/proxy/iptables/proxier_test.go @@ -1,3 +1,6 @@ +//go:build linux +// +build linux + /* Copyright 2015 The Kubernetes Authors. diff --git a/pkg/proxy/ipvs/graceful_termination.go b/pkg/proxy/ipvs/graceful_termination.go index 5c873af5230..45eaebb5158 100644 --- a/pkg/proxy/ipvs/graceful_termination.go +++ b/pkg/proxy/ipvs/graceful_termination.go @@ -1,3 +1,6 @@ +//go:build linux +// +build linux + /* Copyright 2015 The Kubernetes Authors. diff --git a/pkg/proxy/ipvs/graceful_termination_test.go b/pkg/proxy/ipvs/graceful_termination_test.go index f3b5ba971c1..9d04894731f 100644 --- a/pkg/proxy/ipvs/graceful_termination_test.go +++ b/pkg/proxy/ipvs/graceful_termination_test.go @@ -1,5 +1,5 @@ -//go:build !windows -// +build !windows +//go:build linux +// +build linux /* Copyright 2019 The Kubernetes Authors. diff --git a/pkg/proxy/ipvs/ipset.go b/pkg/proxy/ipvs/ipset.go index 5147c112c4f..056f80ca03d 100644 --- a/pkg/proxy/ipvs/ipset.go +++ b/pkg/proxy/ipvs/ipset.go @@ -1,3 +1,6 @@ +//go:build linux +// +build linux + /* Copyright 2017 The Kubernetes Authors. diff --git a/pkg/proxy/ipvs/ipset/ipset.go b/pkg/proxy/ipvs/ipset/ipset.go index f6532dc090e..2957340d937 100644 --- a/pkg/proxy/ipvs/ipset/ipset.go +++ b/pkg/proxy/ipvs/ipset/ipset.go @@ -1,3 +1,6 @@ +//go:build linux +// +build linux + /* Copyright 2017 The Kubernetes Authors. diff --git a/pkg/proxy/ipvs/ipset/ipset_test.go b/pkg/proxy/ipvs/ipset/ipset_test.go index 8f45227abf2..130bc4ca876 100644 --- a/pkg/proxy/ipvs/ipset/ipset_test.go +++ b/pkg/proxy/ipvs/ipset/ipset_test.go @@ -1,3 +1,6 @@ +//go:build linux +// +build linux + /* Copyright 2017 The Kubernetes Authors. diff --git a/pkg/proxy/ipvs/ipset/testing/fake.go b/pkg/proxy/ipvs/ipset/testing/fake.go index a94c709de79..84377a832ee 100644 --- a/pkg/proxy/ipvs/ipset/testing/fake.go +++ b/pkg/proxy/ipvs/ipset/testing/fake.go @@ -1,3 +1,6 @@ +//go:build linux +// +build linux + /* Copyright 2017 The Kubernetes Authors. diff --git a/pkg/proxy/ipvs/ipset/testing/fake_test.go b/pkg/proxy/ipvs/ipset/testing/fake_test.go index 0d07dfa9e0f..a77215ae6a7 100644 --- a/pkg/proxy/ipvs/ipset/testing/fake_test.go +++ b/pkg/proxy/ipvs/ipset/testing/fake_test.go @@ -1,3 +1,6 @@ +//go:build linux +// +build linux + /* Copyright 2017 The Kubernetes Authors. diff --git a/pkg/proxy/ipvs/ipset/types.go b/pkg/proxy/ipvs/ipset/types.go index 11f98d712c4..45632d27894 100644 --- a/pkg/proxy/ipvs/ipset/types.go +++ b/pkg/proxy/ipvs/ipset/types.go @@ -1,3 +1,6 @@ +//go:build linux +// +build linux + /* Copyright 2017 The Kubernetes Authors. diff --git a/pkg/proxy/ipvs/ipset_test.go b/pkg/proxy/ipvs/ipset_test.go index dafde0b4808..6f5842f2e96 100644 --- a/pkg/proxy/ipvs/ipset_test.go +++ b/pkg/proxy/ipvs/ipset_test.go @@ -1,5 +1,5 @@ -//go:build !windows -// +build !windows +//go:build linux +// +build linux /* Copyright 2017 The Kubernetes Authors. diff --git a/pkg/proxy/ipvs/netlink_unsupported.go b/pkg/proxy/ipvs/netlink_unsupported.go deleted file mode 100644 index 1cb38d3fb8f..00000000000 --- a/pkg/proxy/ipvs/netlink_unsupported.go +++ /dev/null @@ -1,82 +0,0 @@ -//go:build !linux -// +build !linux - -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package ipvs - -import ( - "fmt" - "net" - - "k8s.io/apimachinery/pkg/util/sets" -) - -// The type must match the one in proxier_test.go -type netlinkHandle struct { - isIPv6 bool -} - -// NewNetLinkHandle will create an EmptyHandle -func NewNetLinkHandle(ipv6 bool) NetLinkHandle { - return &netlinkHandle{} -} - -// EnsureAddressBind checks if address is bound to the interface and, if not, binds it. If the address is already bound, return true. -func (h *netlinkHandle) EnsureAddressBind(address, devName string) (exist bool, err error) { - return false, fmt.Errorf("netlink not supported for this platform") -} - -// UnbindAddress unbind address from the interface -func (h *netlinkHandle) UnbindAddress(address, devName string) error { - return fmt.Errorf("netlink not supported for this platform") -} - -// EnsureDummyDevice is part of interface -func (h *netlinkHandle) EnsureDummyDevice(devName string) (bool, error) { - return false, fmt.Errorf("netlink is not supported in this platform") -} - -// DeleteDummyDevice is part of interface. -func (h *netlinkHandle) DeleteDummyDevice(devName string) error { - return fmt.Errorf("netlink is not supported in this platform") -} - -// ListBindAddress is part of interface. -func (h *netlinkHandle) ListBindAddress(devName string) ([]string, error) { - return nil, fmt.Errorf("netlink is not supported in this platform") -} - -// GetAllLocalAddresses is part of interface. -func (h *netlinkHandle) GetAllLocalAddresses() (sets.Set[string], error) { - return nil, fmt.Errorf("netlink is not supported in this platform") -} - -// GetLocalAddresses is part of interface. -func (h *netlinkHandle) GetLocalAddresses(dev string) (sets.Set[string], error) { - return nil, fmt.Errorf("netlink is not supported in this platform") -} - -// GetAllLocalAddressesExcept is part of interface. -func (h *netlinkHandle) GetAllLocalAddressesExcept(dev string) (sets.Set[string], error) { - return nil, fmt.Errorf("netlink is not supported in this platform") -} - -// Must match the one in proxier_test.go -func (h *netlinkHandle) isValidForSet(ip net.IP) bool { - return false -} diff --git a/pkg/proxy/ipvs/proxier.go b/pkg/proxy/ipvs/proxier.go index 05afd762045..f3f5f8813fa 100644 --- a/pkg/proxy/ipvs/proxier.go +++ b/pkg/proxy/ipvs/proxier.go @@ -1,3 +1,6 @@ +//go:build linux +// +build linux + /* Copyright 2017 The Kubernetes Authors. diff --git a/pkg/proxy/ipvs/proxier_test.go b/pkg/proxy/ipvs/proxier_test.go index eebd10256ea..360fc051782 100644 --- a/pkg/proxy/ipvs/proxier_test.go +++ b/pkg/proxy/ipvs/proxier_test.go @@ -1,5 +1,5 @@ -//go:build !windows -// +build !windows +//go:build linux +// +build linux /* Copyright 2017 The Kubernetes Authors. diff --git a/pkg/proxy/ipvs/testing/fake.go b/pkg/proxy/ipvs/testing/fake.go index b0cdce8abd1..cd5958ccd53 100644 --- a/pkg/proxy/ipvs/testing/fake.go +++ b/pkg/proxy/ipvs/testing/fake.go @@ -1,3 +1,6 @@ +//go:build linux +// +build linux + /* Copyright 2017 The Kubernetes Authors. diff --git a/pkg/proxy/ipvs/testing/fake_test.go b/pkg/proxy/ipvs/testing/fake_test.go index bba5503f386..227facceb0c 100644 --- a/pkg/proxy/ipvs/testing/fake_test.go +++ b/pkg/proxy/ipvs/testing/fake_test.go @@ -1,3 +1,6 @@ +//go:build linux +// +build linux + /* Copyright 2017 The Kubernetes Authors. diff --git a/pkg/proxy/ipvs/testing/util.go b/pkg/proxy/ipvs/testing/util.go index cd3bb7ebf0f..599532e1d89 100644 --- a/pkg/proxy/ipvs/testing/util.go +++ b/pkg/proxy/ipvs/testing/util.go @@ -1,3 +1,6 @@ +//go:build linux +// +build linux + /* Copyright 2017 The Kubernetes Authors. diff --git a/pkg/proxy/ipvs/util/ipvs.go b/pkg/proxy/ipvs/util/ipvs.go index c9b2ff4b332..ac8853c4406 100644 --- a/pkg/proxy/ipvs/util/ipvs.go +++ b/pkg/proxy/ipvs/util/ipvs.go @@ -1,3 +1,6 @@ +//go:build linux +// +build linux + /* Copyright 2017 The Kubernetes Authors. diff --git a/pkg/proxy/ipvs/util/ipvs_test.go b/pkg/proxy/ipvs/util/ipvs_test.go index 8aaedb1afd0..7cf3b25d615 100644 --- a/pkg/proxy/ipvs/util/ipvs_test.go +++ b/pkg/proxy/ipvs/util/ipvs_test.go @@ -1,3 +1,6 @@ +//go:build linux +// +build linux + /* Copyright 2017 The Kubernetes Authors. diff --git a/pkg/proxy/ipvs/util/ipvs_unsupported.go b/pkg/proxy/ipvs/util/ipvs_unsupported.go deleted file mode 100644 index 74d821561d9..00000000000 --- a/pkg/proxy/ipvs/util/ipvs_unsupported.go +++ /dev/null @@ -1,79 +0,0 @@ -//go:build !linux -// +build !linux - -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package ipvs - -import ( - "fmt" - "time" -) - -// New returns a dummy Interface for unsupported platform. -func New() Interface { - return &runner{} -} - -type runner struct { -} - -func (runner *runner) Flush() error { - return fmt.Errorf("IPVS not supported for this platform") -} - -func (runner *runner) AddVirtualServer(*VirtualServer) error { - return fmt.Errorf("IPVS not supported for this platform") -} - -func (runner *runner) UpdateVirtualServer(*VirtualServer) error { - return fmt.Errorf("IPVS not supported for this platform") -} - -func (runner *runner) DeleteVirtualServer(*VirtualServer) error { - return fmt.Errorf("IPVS not supported for this platform") -} - -func (runner *runner) GetVirtualServer(*VirtualServer) (*VirtualServer, error) { - return nil, fmt.Errorf("IPVS not supported for this platform") -} - -func (runner *runner) GetVirtualServers() ([]*VirtualServer, error) { - return nil, fmt.Errorf("IPVS not supported for this platform") -} - -func (runner *runner) AddRealServer(*VirtualServer, *RealServer) error { - return fmt.Errorf("IPVS not supported for this platform") -} - -func (runner *runner) GetRealServers(*VirtualServer) ([]*RealServer, error) { - return nil, fmt.Errorf("IPVS not supported for this platform") -} - -func (runner *runner) DeleteRealServer(*VirtualServer, *RealServer) error { - return fmt.Errorf("IPVS not supported for this platform") -} - -func (runner *runner) UpdateRealServer(*VirtualServer, *RealServer) error { - return fmt.Errorf("IPVS not supported for this platform") -} - -func (runner *runner) ConfigureTimeouts(time.Duration, time.Duration, time.Duration) error { - return fmt.Errorf("IPVS not supported for this platform") -} - -var _ = Interface(&runner{}) diff --git a/pkg/proxy/ipvs/util/testing/fake.go b/pkg/proxy/ipvs/util/testing/fake.go index dc80cf38eec..2d946517d04 100644 --- a/pkg/proxy/ipvs/util/testing/fake.go +++ b/pkg/proxy/ipvs/util/testing/fake.go @@ -1,3 +1,6 @@ +//go:build linux +// +build linux + /* Copyright 2017 The Kubernetes Authors. diff --git a/pkg/proxy/ipvs/util/testing/fake_test.go b/pkg/proxy/ipvs/util/testing/fake_test.go index ec48e17784b..69aac3b1c85 100644 --- a/pkg/proxy/ipvs/util/testing/fake_test.go +++ b/pkg/proxy/ipvs/util/testing/fake_test.go @@ -1,3 +1,6 @@ +//go:build linux +// +build linux + /* Copyright 2017 The Kubernetes Authors. diff --git a/pkg/proxy/nftables/helpers_test.go b/pkg/proxy/nftables/helpers_test.go index b5286b952a3..05c51caa822 100644 --- a/pkg/proxy/nftables/helpers_test.go +++ b/pkg/proxy/nftables/helpers_test.go @@ -1,3 +1,6 @@ +//go:build linux +// +build linux + /* Copyright 2015 The Kubernetes Authors. diff --git a/pkg/proxy/nftables/proxier.go b/pkg/proxy/nftables/proxier.go index 57374f5ce20..1ebba166724 100644 --- a/pkg/proxy/nftables/proxier.go +++ b/pkg/proxy/nftables/proxier.go @@ -1,3 +1,6 @@ +//go:build linux +// +build linux + /* Copyright 2015 The Kubernetes Authors. diff --git a/pkg/proxy/nftables/proxier_test.go b/pkg/proxy/nftables/proxier_test.go index c5ea7db8760..10f8c11f9e0 100644 --- a/pkg/proxy/nftables/proxier_test.go +++ b/pkg/proxy/nftables/proxier_test.go @@ -1,3 +1,6 @@ +//go:build linux +// +build linux + /* Copyright 2015 The Kubernetes Authors. diff --git a/pkg/util/iptables/iptables.go b/pkg/util/iptables/iptables.go index 8533a1ca624..c6c64e45f73 100644 --- a/pkg/util/iptables/iptables.go +++ b/pkg/util/iptables/iptables.go @@ -1,3 +1,6 @@ +//go:build linux +// +build linux + /* Copyright 2014 The Kubernetes Authors. diff --git a/pkg/util/iptables/iptables_unsupported.go b/pkg/util/iptables/iptables_unsupported.go deleted file mode 100644 index 0c7c5ee3e65..00000000000 --- a/pkg/util/iptables/iptables_unsupported.go +++ /dev/null @@ -1,33 +0,0 @@ -//go:build !linux -// +build !linux - -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package iptables - -import ( - "fmt" - "os" -) - -func grabIptablesLocks(lock14filePath, lock16filePath string) (iptablesLocker, error) { - return nil, fmt.Errorf("iptables unsupported on this platform") -} - -func grabIptablesFileLock(f *os.File) error { - return fmt.Errorf("iptables unsupported on this platform") -} diff --git a/pkg/util/iptables/save_restore.go b/pkg/util/iptables/save_restore.go index d61de34c16a..d507adde737 100644 --- a/pkg/util/iptables/save_restore.go +++ b/pkg/util/iptables/save_restore.go @@ -1,3 +1,6 @@ +//go:build linux +// +build linux + /* Copyright 2014 The Kubernetes Authors. diff --git a/pkg/util/iptables/save_restore_test.go b/pkg/util/iptables/save_restore_test.go index 1030f6194c5..26da4bb3e1c 100644 --- a/pkg/util/iptables/save_restore_test.go +++ b/pkg/util/iptables/save_restore_test.go @@ -1,3 +1,6 @@ +//go:build linux +// +build linux + /* Copyright 2018 The Kubernetes Authors. diff --git a/pkg/util/iptables/testing/fake.go b/pkg/util/iptables/testing/fake.go index 10c91b3021e..6152113dd15 100644 --- a/pkg/util/iptables/testing/fake.go +++ b/pkg/util/iptables/testing/fake.go @@ -1,3 +1,6 @@ +//go:build linux +// +build linux + /* Copyright 2015 The Kubernetes Authors. diff --git a/pkg/util/iptables/testing/fake_test.go b/pkg/util/iptables/testing/fake_test.go index a20917c036d..b2edaa59549 100644 --- a/pkg/util/iptables/testing/fake_test.go +++ b/pkg/util/iptables/testing/fake_test.go @@ -1,3 +1,6 @@ +//go:build linux +// +build linux + /* Copyright 2022 The Kubernetes Authors. diff --git a/pkg/util/iptables/testing/parse.go b/pkg/util/iptables/testing/parse.go index c46adfafac0..d7957e8c760 100644 --- a/pkg/util/iptables/testing/parse.go +++ b/pkg/util/iptables/testing/parse.go @@ -1,3 +1,6 @@ +//go:build linux +// +build linux + /* Copyright 2022 The Kubernetes Authors. diff --git a/pkg/util/iptables/testing/parse_test.go b/pkg/util/iptables/testing/parse_test.go index c439ef61fcd..848b27e4021 100644 --- a/pkg/util/iptables/testing/parse_test.go +++ b/pkg/util/iptables/testing/parse_test.go @@ -1,3 +1,6 @@ +//go:build linux +// +build linux + /* Copyright 2022 The Kubernetes Authors.