From 536364266c1d02038cb3f3c8c7f947393a0ab6ce Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Thu, 2 Nov 2023 09:38:40 -0400 Subject: [PATCH] Sort messy kube-proxy imports --- cmd/kube-proxy/app/conntrack.go | 3 +-- cmd/kube-proxy/app/init_windows.go | 4 ++-- cmd/kube-proxy/app/server.go | 5 ++--- cmd/kube-proxy/app/server_linux.go | 13 +++++-------- cmd/kube-proxy/app/server_linux_test.go | 1 + 5 files changed, 11 insertions(+), 15 deletions(-) diff --git a/cmd/kube-proxy/app/conntrack.go b/cmd/kube-proxy/app/conntrack.go index f60b270707c..2014b11be88 100644 --- a/cmd/kube-proxy/app/conntrack.go +++ b/cmd/kube-proxy/app/conntrack.go @@ -22,10 +22,9 @@ import ( "strconv" "strings" + "k8s.io/component-helpers/node/util/sysctl" "k8s.io/klog/v2" "k8s.io/mount-utils" - - "k8s.io/component-helpers/node/util/sysctl" ) // Conntracker is an interface to the global sysctl. Descriptions of the various diff --git a/cmd/kube-proxy/app/init_windows.go b/cmd/kube-proxy/app/init_windows.go index 32ed6dc7fe0..210c7da5672 100644 --- a/cmd/kube-proxy/app/init_windows.go +++ b/cmd/kube-proxy/app/init_windows.go @@ -20,9 +20,9 @@ limitations under the License. package app import ( - "k8s.io/kubernetes/pkg/windows/service" - "github.com/spf13/pflag" + + "k8s.io/kubernetes/pkg/windows/service" ) const ( diff --git a/cmd/kube-proxy/app/server.go b/cmd/kube-proxy/app/server.go index 66d38488c04..0857851d404 100644 --- a/cmd/kube-proxy/app/server.go +++ b/cmd/kube-proxy/app/server.go @@ -28,9 +28,6 @@ import ( "strings" "time" - "k8s.io/kubernetes/pkg/features" - utilnode "k8s.io/kubernetes/pkg/util/node" - "github.com/fsnotify/fsnotify" "github.com/spf13/cobra" "github.com/spf13/pflag" @@ -73,6 +70,7 @@ import ( "k8s.io/kube-proxy/config/v1alpha1" api "k8s.io/kubernetes/pkg/apis/core" "k8s.io/kubernetes/pkg/cluster/ports" + "k8s.io/kubernetes/pkg/features" "k8s.io/kubernetes/pkg/kubelet/qos" "k8s.io/kubernetes/pkg/proxy" "k8s.io/kubernetes/pkg/proxy/apis" @@ -85,6 +83,7 @@ import ( proxyutil "k8s.io/kubernetes/pkg/proxy/util" "k8s.io/kubernetes/pkg/util/filesystem" utilflag "k8s.io/kubernetes/pkg/util/flag" + utilnode "k8s.io/kubernetes/pkg/util/node" "k8s.io/kubernetes/pkg/util/oom" netutils "k8s.io/utils/net" "k8s.io/utils/ptr" diff --git a/cmd/kube-proxy/app/server_linux.go b/cmd/kube-proxy/app/server_linux.go index f36ad10e6f7..75ca44a9b73 100644 --- a/cmd/kube-proxy/app/server_linux.go +++ b/cmd/kube-proxy/app/server_linux.go @@ -31,19 +31,18 @@ import ( "github.com/google/cadvisor/machine" "github.com/google/cadvisor/utils/sysfs" - "k8s.io/apimachinery/pkg/watch" - - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/client-go/tools/cache" - - "k8s.io/apimachinery/pkg/fields" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/fields" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/watch" utilfeature "k8s.io/apiserver/pkg/util/feature" clientset "k8s.io/client-go/kubernetes" + "k8s.io/client-go/tools/cache" toolswatch "k8s.io/client-go/tools/watch" utilsysctl "k8s.io/component-helpers/node/util/sysctl" + "k8s.io/klog/v2" "k8s.io/kubernetes/pkg/features" "k8s.io/kubernetes/pkg/proxy" proxyconfigapi "k8s.io/kubernetes/pkg/proxy/apis/config" @@ -57,8 +56,6 @@ import ( proxyutiliptables "k8s.io/kubernetes/pkg/proxy/util/iptables" utiliptables "k8s.io/kubernetes/pkg/util/iptables" "k8s.io/utils/exec" - - "k8s.io/klog/v2" ) // timeoutForNodePodCIDR is the time to wait for allocators to assign a PodCIDR to the diff --git a/cmd/kube-proxy/app/server_linux_test.go b/cmd/kube-proxy/app/server_linux_test.go index 66664d0cc47..917f2e6d48b 100644 --- a/cmd/kube-proxy/app/server_linux_test.go +++ b/cmd/kube-proxy/app/server_linux_test.go @@ -31,6 +31,7 @@ import ( "time" "github.com/spf13/pflag" + v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime"