diff --git a/.golangci.yml b/.golangci.yml index 4d2b1d0ca..1a992d2f3 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -7,6 +7,7 @@ run: - deployment/ - doc/ - bindata/ + - pkg/client linters-settings: depguard: list-type: blacklist @@ -46,7 +47,7 @@ linters-settings: gocyclo: min-complexity: 15 goimports: - local-prefixes: github.com/k8snetworkplumbingwg/sriov-network-device-plugin + local-prefixes: github.com/k8snetworkplumbingwg/sriov-network-operator gomnd: settings: mnd: diff --git a/api/v1/helper.go b/api/v1/helper.go index 4ccd1d59e..6479b4c0a 100644 --- a/api/v1/helper.go +++ b/api/v1/helper.go @@ -10,6 +10,7 @@ import ( "strconv" "strings" + netattdefv1 "github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -19,8 +20,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" logf "sigs.k8s.io/controller-runtime/pkg/log" - netattdefv1 "github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1" - render "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/render" + "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/render" ) const ( diff --git a/api/v1/helper_test.go b/api/v1/helper_test.go index 2f0ed91a2..15cb435b3 100644 --- a/api/v1/helper_test.go +++ b/api/v1/helper_test.go @@ -10,10 +10,10 @@ import ( "testing" "github.com/google/go-cmp/cmp" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" v1 "github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1" "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/consts" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) var update = flag.Bool("updategolden", false, "update .golden files") diff --git a/cmd/sriov-network-config-daemon/start.go b/cmd/sriov-network-config-daemon/start.go index 0a3ab4416..c0a40699e 100644 --- a/cmd/sriov-network-config-daemon/start.go +++ b/cmd/sriov-network-config-daemon/start.go @@ -10,14 +10,9 @@ import ( "strings" "time" - configv1 "github.com/openshift/api/config/v1" - "github.com/golang/glog" - sriovnetworkv1 "github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1" - snclientset "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/client/clientset/versioned" - "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/daemon" - "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/utils" - "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/version" + configv1 "github.com/openshift/api/config/v1" + mcfgv1 "github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.openshift.io/v1" "github.com/spf13/cobra" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" @@ -26,7 +21,11 @@ import ( "k8s.io/client-go/tools/clientcmd" "k8s.io/client-go/util/connrotation" - mcfgv1 "github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.openshift.io/v1" + sriovnetworkv1 "github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1" + snclientset "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/client/clientset/versioned" + "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/daemon" + "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/utils" + "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/version" ) var ( diff --git a/cmd/sriov-network-config-daemon/version.go b/cmd/sriov-network-config-daemon/version.go index ddc70a764..b5ae92da1 100644 --- a/cmd/sriov-network-config-daemon/version.go +++ b/cmd/sriov-network-config-daemon/version.go @@ -4,8 +4,9 @@ import ( "flag" "fmt" - "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/version" "github.com/spf13/cobra" + + "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/version" ) var ( diff --git a/controllers/sriovibnetwork_controller_test.go b/controllers/sriovibnetwork_controller_test.go index a1477ddb6..0c2d7d1cf 100644 --- a/controllers/sriovibnetwork_controller_test.go +++ b/controllers/sriovibnetwork_controller_test.go @@ -17,7 +17,7 @@ import ( . "github.com/onsi/gomega" sriovnetworkv1 "github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1" - util "github.com/k8snetworkplumbingwg/sriov-network-operator/test/util" + "github.com/k8snetworkplumbingwg/sriov-network-operator/test/util" ) var _ = Describe("SriovIBNetwork Controller", func() { diff --git a/controllers/sriovnetwork_controller_test.go b/controllers/sriovnetwork_controller_test.go index 613b15cc9..00441dceb 100644 --- a/controllers/sriovnetwork_controller_test.go +++ b/controllers/sriovnetwork_controller_test.go @@ -17,7 +17,7 @@ import ( . "github.com/onsi/gomega" sriovnetworkv1 "github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1" - util "github.com/k8snetworkplumbingwg/sriov-network-operator/test/util" + "github.com/k8snetworkplumbingwg/sriov-network-operator/test/util" ) const on = "on" diff --git a/controllers/sriovnetworknodepolicy_controller.go b/controllers/sriovnetworknodepolicy_controller.go index 919639fb7..3ffe774ee 100644 --- a/controllers/sriovnetworknodepolicy_controller.go +++ b/controllers/sriovnetworknodepolicy_controller.go @@ -46,7 +46,7 @@ import ( sriovnetworkv1 "github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1" "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/apply" constants "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/consts" - render "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/render" + "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/render" ) // SriovNetworkNodePolicyReconciler reconciles a SriovNetworkNodePolicy object diff --git a/controllers/sriovnetworknodepolicy_controller_test.go b/controllers/sriovnetworknodepolicy_controller_test.go index e3bd269fd..2766df52e 100644 --- a/controllers/sriovnetworknodepolicy_controller_test.go +++ b/controllers/sriovnetworknodepolicy_controller_test.go @@ -5,14 +5,14 @@ import ( "encoding/json" "testing" - sriovnetworkv1 "github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1" - v1 "github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1" - corev1 "k8s.io/api/core/v1" - "github.com/google/go-cmp/cmp" - "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/consts" + corev1 "k8s.io/api/core/v1" dptypes "github.com/k8snetworkplumbingwg/sriov-network-device-plugin/pkg/types" + + sriovnetworkv1 "github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1" + v1 "github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1" + "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/consts" ) func TestNodeSelectorMerge(t *testing.T) { diff --git a/controllers/sriovnetworkpoolconfig_controller.go b/controllers/sriovnetworkpoolconfig_controller.go index 635ccb5f4..de8fb32b2 100644 --- a/controllers/sriovnetworkpoolconfig_controller.go +++ b/controllers/sriovnetworkpoolconfig_controller.go @@ -6,6 +6,7 @@ import ( "fmt" "reflect" + mcfgv1 "github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.openshift.io/v1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" @@ -16,9 +17,8 @@ import ( sriovnetworkv1 "github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1" constants "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/consts" - render "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/render" - utils "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/utils" - mcfgv1 "github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.openshift.io/v1" + "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/render" + "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/utils" ) // SriovNetworkPoolConfigReconciler reconciles a SriovNetworkPoolConfig object diff --git a/controllers/sriovnetworkpoolconfig_controller_test.go b/controllers/sriovnetworkpoolconfig_controller_test.go index 03a383639..5b76d1d19 100644 --- a/controllers/sriovnetworkpoolconfig_controller_test.go +++ b/controllers/sriovnetworkpoolconfig_controller_test.go @@ -10,9 +10,10 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + mcfgv1 "github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.openshift.io/v1" + sriovnetworkv1 "github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1" constants "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/consts" - mcfgv1 "github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.openshift.io/v1" ) var _ = Describe("Operator", func() { diff --git a/pkg/client/informers/externalversions/factory.go b/pkg/client/informers/externalversions/factory.go index fbad750a9..57c769d43 100644 --- a/pkg/client/informers/externalversions/factory.go +++ b/pkg/client/informers/externalversions/factory.go @@ -7,13 +7,14 @@ import ( sync "sync" time "time" - versioned "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/client/clientset/versioned" - internalinterfaces "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/client/informers/externalversions/internalinterfaces" - sriovnetwork "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/client/informers/externalversions/sriovnetwork" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" cache "k8s.io/client-go/tools/cache" + + versioned "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/client/clientset/versioned" + internalinterfaces "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/client/informers/externalversions/internalinterfaces" + sriovnetwork "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/client/informers/externalversions/sriovnetwork" ) // SharedInformerOption defines the functional option type for SharedInformerFactory. diff --git a/pkg/client/informers/externalversions/generic.go b/pkg/client/informers/externalversions/generic.go index b04902e75..f225f0d75 100644 --- a/pkg/client/informers/externalversions/generic.go +++ b/pkg/client/informers/externalversions/generic.go @@ -5,9 +5,10 @@ package externalversions import ( "fmt" - v1 "github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1" schema "k8s.io/apimachinery/pkg/runtime/schema" cache "k8s.io/client-go/tools/cache" + + v1 "github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1" ) // GenericInformer is type of SharedIndexInformer which will locate and delegate to other diff --git a/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go b/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go index 7bf092ca9..87fe71c3c 100644 --- a/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go +++ b/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go @@ -5,10 +5,11 @@ package internalinterfaces import ( time "time" - versioned "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/client/clientset/versioned" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" cache "k8s.io/client-go/tools/cache" + + versioned "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/client/clientset/versioned" ) // NewInformerFunc takes versioned.Interface and time.Duration to return a SharedIndexInformer. diff --git a/pkg/client/informers/externalversions/sriovnetwork/v1/sriovnetwork.go b/pkg/client/informers/externalversions/sriovnetwork/v1/sriovnetwork.go index b7fe3e582..f5bed4a9a 100644 --- a/pkg/client/informers/externalversions/sriovnetwork/v1/sriovnetwork.go +++ b/pkg/client/informers/externalversions/sriovnetwork/v1/sriovnetwork.go @@ -6,14 +6,15 @@ import ( "context" time "time" - sriovnetworkv1 "github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1" - versioned "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/client/clientset/versioned" - internalinterfaces "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/client/informers/externalversions/internalinterfaces" - v1 "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/client/listers/sriovnetwork/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" + + sriovnetworkv1 "github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1" + versioned "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/client/clientset/versioned" + internalinterfaces "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/client/informers/externalversions/internalinterfaces" + v1 "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/client/listers/sriovnetwork/v1" ) // SriovNetworkInformer provides access to a shared informer and lister for diff --git a/pkg/client/informers/externalversions/sriovnetwork/v1/sriovnetworknodepolicy.go b/pkg/client/informers/externalversions/sriovnetwork/v1/sriovnetworknodepolicy.go index b711c691b..df6879ee9 100644 --- a/pkg/client/informers/externalversions/sriovnetwork/v1/sriovnetworknodepolicy.go +++ b/pkg/client/informers/externalversions/sriovnetwork/v1/sriovnetworknodepolicy.go @@ -6,14 +6,15 @@ import ( "context" time "time" - sriovnetworkv1 "github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1" - versioned "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/client/clientset/versioned" - internalinterfaces "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/client/informers/externalversions/internalinterfaces" - v1 "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/client/listers/sriovnetwork/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" + + sriovnetworkv1 "github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1" + versioned "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/client/clientset/versioned" + internalinterfaces "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/client/informers/externalversions/internalinterfaces" + v1 "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/client/listers/sriovnetwork/v1" ) // SriovNetworkNodePolicyInformer provides access to a shared informer and lister for diff --git a/pkg/client/informers/externalversions/sriovnetwork/v1/sriovnetworknodestate.go b/pkg/client/informers/externalversions/sriovnetwork/v1/sriovnetworknodestate.go index b77f43eb7..69f5d0b69 100644 --- a/pkg/client/informers/externalversions/sriovnetwork/v1/sriovnetworknodestate.go +++ b/pkg/client/informers/externalversions/sriovnetwork/v1/sriovnetworknodestate.go @@ -6,14 +6,15 @@ import ( "context" time "time" - sriovnetworkv1 "github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1" - versioned "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/client/clientset/versioned" - internalinterfaces "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/client/informers/externalversions/internalinterfaces" - v1 "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/client/listers/sriovnetwork/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" + + sriovnetworkv1 "github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1" + versioned "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/client/clientset/versioned" + internalinterfaces "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/client/informers/externalversions/internalinterfaces" + v1 "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/client/listers/sriovnetwork/v1" ) // SriovNetworkNodeStateInformer provides access to a shared informer and lister for diff --git a/pkg/client/informers/externalversions/sriovnetwork/v1/sriovoperatorconfig.go b/pkg/client/informers/externalversions/sriovnetwork/v1/sriovoperatorconfig.go index bbe5fb7e4..142f261e2 100644 --- a/pkg/client/informers/externalversions/sriovnetwork/v1/sriovoperatorconfig.go +++ b/pkg/client/informers/externalversions/sriovnetwork/v1/sriovoperatorconfig.go @@ -6,14 +6,15 @@ import ( "context" time "time" - sriovnetworkv1 "github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1" - versioned "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/client/clientset/versioned" - internalinterfaces "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/client/informers/externalversions/internalinterfaces" - v1 "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/client/listers/sriovnetwork/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" + + sriovnetworkv1 "github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1" + versioned "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/client/clientset/versioned" + internalinterfaces "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/client/informers/externalversions/internalinterfaces" + v1 "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/client/listers/sriovnetwork/v1" ) // SriovOperatorConfigInformer provides access to a shared informer and lister for diff --git a/pkg/client/listers/sriovnetwork/v1/sriovnetwork.go b/pkg/client/listers/sriovnetwork/v1/sriovnetwork.go index d46a85862..a0eebb626 100644 --- a/pkg/client/listers/sriovnetwork/v1/sriovnetwork.go +++ b/pkg/client/listers/sriovnetwork/v1/sriovnetwork.go @@ -3,10 +3,11 @@ package v1 import ( - v1 "github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" + + v1 "github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1" ) // SriovNetworkLister helps list SriovNetworks. diff --git a/pkg/client/listers/sriovnetwork/v1/sriovnetworknodepolicy.go b/pkg/client/listers/sriovnetwork/v1/sriovnetworknodepolicy.go index cbe737d0b..8e81010a9 100644 --- a/pkg/client/listers/sriovnetwork/v1/sriovnetworknodepolicy.go +++ b/pkg/client/listers/sriovnetwork/v1/sriovnetworknodepolicy.go @@ -3,10 +3,11 @@ package v1 import ( - v1 "github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" + + v1 "github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1" ) // SriovNetworkNodePolicyLister helps list SriovNetworkNodePolicies. diff --git a/pkg/client/listers/sriovnetwork/v1/sriovnetworknodestate.go b/pkg/client/listers/sriovnetwork/v1/sriovnetworknodestate.go index 37dc6c773..efc53d6ee 100644 --- a/pkg/client/listers/sriovnetwork/v1/sriovnetworknodestate.go +++ b/pkg/client/listers/sriovnetwork/v1/sriovnetworknodestate.go @@ -3,10 +3,11 @@ package v1 import ( - v1 "github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" + + v1 "github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1" ) // SriovNetworkNodeStateLister helps list SriovNetworkNodeStates. diff --git a/pkg/client/listers/sriovnetwork/v1/sriovoperatorconfig.go b/pkg/client/listers/sriovnetwork/v1/sriovoperatorconfig.go index 9b495df37..9bad2022a 100644 --- a/pkg/client/listers/sriovnetwork/v1/sriovoperatorconfig.go +++ b/pkg/client/listers/sriovnetwork/v1/sriovoperatorconfig.go @@ -3,10 +3,11 @@ package v1 import ( - v1 "github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" + + v1 "github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1" ) // SriovOperatorConfigLister helps list SriovOperatorConfigs. diff --git a/pkg/daemon/daemon_test.go b/pkg/daemon/daemon_test.go index 15f54470f..5ec0fd443 100644 --- a/pkg/daemon/daemon_test.go +++ b/pkg/daemon/daemon_test.go @@ -7,14 +7,15 @@ import ( "path" "testing" - sriovnetworkv1 "github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1" - "github.com/k8snetworkplumbingwg/sriov-network-operator/test/util/fakefilesystem" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" fakek8s "k8s.io/client-go/kubernetes/fake" + sriovnetworkv1 "github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1" + "github.com/k8snetworkplumbingwg/sriov-network-operator/test/util/fakefilesystem" + snclientset "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/client/clientset/versioned" fakesnclientset "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/client/clientset/versioned/fake" plugin "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/plugins" diff --git a/pkg/plugins/mellanox/mellanox_plugin.go b/pkg/plugins/mellanox/mellanox_plugin.go index 123933cd8..f6b8ab185 100644 --- a/pkg/plugins/mellanox/mellanox_plugin.go +++ b/pkg/plugins/mellanox/mellanox_plugin.go @@ -6,6 +6,7 @@ import ( "strings" "github.com/golang/glog" + sriovnetworkv1 "github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1" constants "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/consts" plugin "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/plugins" diff --git a/pkg/plugins/virtual/virtual_plugin.go b/pkg/plugins/virtual/virtual_plugin.go index 5af20b79d..2d74cbbd3 100644 --- a/pkg/plugins/virtual/virtual_plugin.go +++ b/pkg/plugins/virtual/virtual_plugin.go @@ -4,6 +4,7 @@ import ( "reflect" "github.com/golang/glog" + sriovnetworkv1 "github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1" constants "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/consts" plugin "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/plugins" diff --git a/pkg/utils/shutdown.go b/pkg/utils/shutdown.go index 321e1ddb0..3700efa18 100644 --- a/pkg/utils/shutdown.go +++ b/pkg/utils/shutdown.go @@ -3,15 +3,14 @@ package utils import ( "context" - snclientset "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/client/clientset/versioned" admv1 "k8s.io/api/admissionregistration/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/client-go/kubernetes" ctrl "sigs.k8s.io/controller-runtime" conf "sigs.k8s.io/controller-runtime/pkg/client/config" sriovnetworkv1 "github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1" + snclientset "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/client/clientset/versioned" constants "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/consts" ) diff --git a/pkg/webhook/validate_test.go b/pkg/webhook/validate_test.go index fd81328c9..906d5e85a 100644 --- a/pkg/webhook/validate_test.go +++ b/pkg/webhook/validate_test.go @@ -7,12 +7,13 @@ import ( corev1 "k8s.io/api/core/v1" - . "github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1" - constants "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/consts" . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" "sigs.k8s.io/controller-runtime/pkg/envtest" + + . "github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1" + constants "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/consts" ) func TestMain(m *testing.M) { diff --git a/test/conformance/tests/test_sriov_operator.go b/test/conformance/tests/test_sriov_operator.go index d5ba3ba5d..cf1943db4 100644 --- a/test/conformance/tests/test_sriov_operator.go +++ b/test/conformance/tests/test_sriov_operator.go @@ -15,26 +15,25 @@ import ( . "github.com/onsi/gomega/gstruct" netattdefv1 "github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1" + admission "k8s.io/api/admissionregistration/v1" + appsv1 "k8s.io/api/apps/v1" + corev1 "k8s.io/api/core/v1" + rbacv1 "k8s.io/api/rbac/v1" + k8serrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" + "k8s.io/utils/pointer" + runtimeclient "sigs.k8s.io/controller-runtime/pkg/client" + sriovv1 "github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1" + "github.com/k8snetworkplumbingwg/sriov-network-operator/test/util/clean" "github.com/k8snetworkplumbingwg/sriov-network-operator/test/util/cluster" "github.com/k8snetworkplumbingwg/sriov-network-operator/test/util/discovery" "github.com/k8snetworkplumbingwg/sriov-network-operator/test/util/execute" - - "github.com/k8snetworkplumbingwg/sriov-network-operator/test/util/clean" "github.com/k8snetworkplumbingwg/sriov-network-operator/test/util/namespaces" "github.com/k8snetworkplumbingwg/sriov-network-operator/test/util/network" "github.com/k8snetworkplumbingwg/sriov-network-operator/test/util/nodes" "github.com/k8snetworkplumbingwg/sriov-network-operator/test/util/pod" - appsv1 "k8s.io/api/apps/v1" - corev1 "k8s.io/api/core/v1" - k8serrors "k8s.io/apimachinery/pkg/api/errors" - - admission "k8s.io/api/admissionregistration/v1" - rbacv1 "k8s.io/api/rbac/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" - "k8s.io/utils/pointer" - runtimeclient "sigs.k8s.io/controller-runtime/pkg/client" ) var waitingTime time.Duration = 20 * time.Minute diff --git a/test/util/client/clients.go b/test/util/client/clients.go index 3c6ff54ef..dc800ff20 100644 --- a/test/util/client/clients.go +++ b/test/util/client/clients.go @@ -6,8 +6,6 @@ import ( netattdefv1 "github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1" "github.com/golang/glog" - sriovv1 "github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1" - clientsriovv1 "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/client/clientset/versioned/typed/sriovnetwork/v1" clientconfigv1 "github.com/openshift/client-go/config/clientset/versioned/typed/config/v1" clientmachineconfigv1 "github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned/typed/machineconfiguration.openshift.io/v1" apiext "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" @@ -16,10 +14,12 @@ import ( clientgoscheme "k8s.io/client-go/kubernetes/scheme" appsv1client "k8s.io/client-go/kubernetes/typed/apps/v1" corev1client "k8s.io/client-go/kubernetes/typed/core/v1" - "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" runtimeclient "sigs.k8s.io/controller-runtime/pkg/client" + + sriovv1 "github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1" + clientsriovv1 "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/client/clientset/versioned/typed/sriovnetwork/v1" ) // ClientSet provides the struct to talk with relevant API diff --git a/test/util/discovery/discovery.go b/test/util/discovery/discovery.go index 2d70f1548..713cb15cb 100644 --- a/test/util/discovery/discovery.go +++ b/test/util/discovery/discovery.go @@ -5,12 +5,13 @@ import ( "os" "strconv" - sriovv1 "github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1" - "github.com/k8snetworkplumbingwg/sriov-network-operator/test/util/client" - "github.com/k8snetworkplumbingwg/sriov-network-operator/test/util/cluster" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtimeclient "sigs.k8s.io/controller-runtime/pkg/client" + + sriovv1 "github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1" + "github.com/k8snetworkplumbingwg/sriov-network-operator/test/util/client" + "github.com/k8snetworkplumbingwg/sriov-network-operator/test/util/cluster" ) // Enabled indicates whether test discovery mode is enabled. diff --git a/test/util/k8sreporter/reporter.go b/test/util/k8sreporter/reporter.go index 854b35ce3..aba84de9f 100644 --- a/test/util/k8sreporter/reporter.go +++ b/test/util/k8sreporter/reporter.go @@ -9,13 +9,14 @@ import ( "strings" "sync" - sriovv1 "github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1" - testclient "github.com/k8snetworkplumbingwg/sriov-network-operator/test/util/client" - "github.com/k8snetworkplumbingwg/sriov-network-operator/test/util/namespaces" "github.com/onsi/ginkgo/v2/types" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtimeclient "sigs.k8s.io/controller-runtime/pkg/client" + + sriovv1 "github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1" + testclient "github.com/k8snetworkplumbingwg/sriov-network-operator/test/util/client" + "github.com/k8snetworkplumbingwg/sriov-network-operator/test/util/namespaces" ) type KubernetesReporter struct { diff --git a/test/util/namespaces/namespaces.go b/test/util/namespaces/namespaces.go index 085171937..9e865b7d1 100644 --- a/test/util/namespaces/namespaces.go +++ b/test/util/namespaces/namespaces.go @@ -6,7 +6,6 @@ import ( "strings" "time" - sriovv1 "github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1" k8sv1 "k8s.io/api/core/v1" k8serrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -14,6 +13,7 @@ import ( "k8s.io/utils/pointer" runtimeclient "sigs.k8s.io/controller-runtime/pkg/client" + sriovv1 "github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1" testclient "github.com/k8snetworkplumbingwg/sriov-network-operator/test/util/client" ) diff --git a/test/util/network/network.go b/test/util/network/network.go index 6d29f3849..ea9c31f6e 100644 --- a/test/util/network/network.go +++ b/test/util/network/network.go @@ -7,10 +7,11 @@ import ( "strings" netattdefv1 "github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1" - sriovv1 "github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1" - testclient "github.com/k8snetworkplumbingwg/sriov-network-operator/test/util/client" k8sv1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + sriovv1 "github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1" + testclient "github.com/k8snetworkplumbingwg/sriov-network-operator/test/util/client" ) // Needed for parsing of podinfo diff --git a/test/util/nodes/nodes.go b/test/util/nodes/nodes.go index a157602a7..359ab3d9e 100644 --- a/test/util/nodes/nodes.go +++ b/test/util/nodes/nodes.go @@ -5,10 +5,11 @@ import ( "fmt" "os" - sriovv1 "github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1" - "github.com/k8snetworkplumbingwg/sriov-network-operator/test/util/client" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + sriovv1 "github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1" + "github.com/k8snetworkplumbingwg/sriov-network-operator/test/util/client" ) // NodesSelector represent the label selector used to filter impacted nodes.