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 cee69f1a0eb2d..7e0ff787fe1d0 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 9d90ca92fa523..b91adaf5154f5 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 959e2972b0189..ec47c5d6c48ac 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 4d25ff2f861aa..f99ab89770a84 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 450ca1dda3a38..3a1925b867570 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 18a7aab4e7bb0..a4b17ca5b0755 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 e160d5407f155..959b3f165cbe0 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 2736226e65b0e..ffaa2ed88f1cb 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 e0d5e236fcfb5..32ab725fd4de1 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 5c873af52306a..45eaebb5158f6 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 f3b5ba971c1c7..9d04894731f93 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 5147c112c4f00..056f80ca03dd8 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 f6532dc090efa..2957340d937fa 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 8f45227abf291..130bc4ca876d7 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 a94c709de7994..84377a832ee1a 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 0d07dfa9e0f68..a77215ae6a7b8 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 11f98d712c454..45632d278943f 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 dafde0b480867..6f5842f2e9631 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 1cb38d3fb8f08..0000000000000 --- 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 d1594707f3511..f3f5f8813fabf 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. @@ -489,10 +492,8 @@ func NewDualStackProxier( initOnly bool, ) (proxy.Provider, error) { - safeIpset := newSafeIpset(ipset) - // Create an ipv4 instance of the single-stack proxier - ipv4Proxier, err := NewProxier(v1.IPv4Protocol, ipt[0], ipvs, safeIpset, sysctl, + ipv4Proxier, err := NewProxier(v1.IPv4Protocol, ipt[0], ipvs, ipset, sysctl, exec, syncPeriod, minSyncPeriod, filterCIDRs(false, excludeCIDRs), strictARP, tcpTimeout, tcpFinTimeout, udpTimeout, masqueradeAll, masqueradeBit, localDetectors[0], hostname, nodeIPs[v1.IPv4Protocol], recorder, @@ -501,7 +502,7 @@ func NewDualStackProxier( return nil, fmt.Errorf("unable to create ipv4 proxier: %v", err) } - ipv6Proxier, err := NewProxier(v1.IPv6Protocol, ipt[1], ipvs, safeIpset, sysctl, + ipv6Proxier, err := NewProxier(v1.IPv6Protocol, ipt[1], ipvs, ipset, sysctl, exec, syncPeriod, minSyncPeriod, filterCIDRs(true, excludeCIDRs), strictARP, tcpTimeout, tcpFinTimeout, udpTimeout, masqueradeAll, masqueradeBit, localDetectors[1], hostname, nodeIPs[v1.IPv6Protocol], recorder, diff --git a/pkg/proxy/ipvs/proxier_test.go b/pkg/proxy/ipvs/proxier_test.go index eebd10256ea63..360fc051782aa 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/safe_ipset.go b/pkg/proxy/ipvs/safe_ipset.go deleted file mode 100644 index 1dbad0eb5cd8f..0000000000000 --- a/pkg/proxy/ipvs/safe_ipset.go +++ /dev/null @@ -1,104 +0,0 @@ -/* -Copyright 2019 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 ( - "sync" - - "k8s.io/kubernetes/pkg/proxy/ipvs/ipset" -) - -type safeIpset struct { - ipset ipset.Interface - mu sync.Mutex -} - -func newSafeIpset(ipset ipset.Interface) ipset.Interface { - return &safeIpset{ - ipset: ipset, - } -} - -// FlushSet deletes all entries from a named set. -func (s *safeIpset) FlushSet(set string) error { - s.mu.Lock() - defer s.mu.Unlock() - return s.ipset.FlushSet(set) -} - -// DestroySet deletes a named set. -func (s *safeIpset) DestroySet(set string) error { - s.mu.Lock() - defer s.mu.Unlock() - return s.ipset.DestroySet(set) -} - -// DestroyAllSets deletes all sets. -func (s *safeIpset) DestroyAllSets() error { - s.mu.Lock() - defer s.mu.Unlock() - return s.ipset.DestroyAllSets() -} - -// CreateSet creates a new set. It will ignore error when the set already exists if ignoreExistErr=true. -func (s *safeIpset) CreateSet(set *ipset.IPSet, ignoreExistErr bool) error { - s.mu.Lock() - defer s.mu.Unlock() - return s.ipset.CreateSet(set, ignoreExistErr) -} - -// AddEntry adds a new entry to the named set. It will ignore error when the entry already exists if ignoreExistErr=true. -func (s *safeIpset) AddEntry(entry string, set *ipset.IPSet, ignoreExistErr bool) error { - s.mu.Lock() - defer s.mu.Unlock() - return s.ipset.AddEntry(entry, set, ignoreExistErr) -} - -// DelEntry deletes one entry from the named set -func (s *safeIpset) DelEntry(entry string, set string) error { - s.mu.Lock() - defer s.mu.Unlock() - return s.ipset.DelEntry(entry, set) -} - -// Test test if an entry exists in the named set -func (s *safeIpset) TestEntry(entry string, set string) (bool, error) { - s.mu.Lock() - defer s.mu.Unlock() - return s.ipset.TestEntry(entry, set) -} - -// ListEntries lists all the entries from a named set -func (s *safeIpset) ListEntries(set string) ([]string, error) { - s.mu.Lock() - defer s.mu.Unlock() - return s.ipset.ListEntries(set) -} - -// ListSets list all set names from kernel -func (s *safeIpset) ListSets() ([]string, error) { - s.mu.Lock() - defer s.mu.Unlock() - return s.ipset.ListSets() -} - -// GetVersion returns the "X.Y" version string for ipset. -func (s *safeIpset) GetVersion() (string, error) { - s.mu.Lock() - defer s.mu.Unlock() - return s.ipset.GetVersion() -} diff --git a/pkg/proxy/ipvs/testing/fake.go b/pkg/proxy/ipvs/testing/fake.go index b0cdce8abd1f3..cd5958ccd5301 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 bba5503f386ae..227facceb0c9e 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 cd3bb7ebf0fd5..599532e1d8933 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 c9b2ff4b33244..ac8853c440691 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 8aaedb1afd01c..7cf3b25d61569 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 74d821561d98a..0000000000000 --- 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 dc80cf38eec29..2d946517d0485 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 ec48e17784b3e..69aac3b1c85e2 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 b5286b952a35d..05c51caa82239 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 57374f5ce20ad..1ebba16672474 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 c5ea7db876003..10f8c11f9e086 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 8533a1ca624e4..c6c64e45f73a1 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 0c7c5ee3e6516..0000000000000 --- 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 d61de34c16a79..d507adde73789 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 1030f6194c5db..26da4bb3e1cff 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 10c91b3021ecd..6152113dd15a3 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 a20917c036da5..b2edaa5954927 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 c46adfafac09a..d7957e8c76029 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 c439ef61fcdac..848b27e4021b9 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.