From 7ca7353956633c56728a738f52c74b70d9daac1b Mon Sep 17 00:00:00 2001 From: Casey Davenport Date: Mon, 18 Apr 2022 08:31:01 -0700 Subject: [PATCH 1/3] Update go-build version --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index edd0de79..0c2d2fa4 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ PACKAGE_NAME=github.com/projectcalico/cni-plugin -GO_BUILD_VER=v0.54 +GO_BUILD_VER=v0.65.1 ORGANIZATION=projectcalico SEMAPHORE_PROJECT_ID?=$(SEMAPHORE_CNI_PLUGIN_PROJECT_ID) From 2fd0dde9219bb41e12a42d84b5fa21a8bc17734c Mon Sep 17 00:00:00 2001 From: Casey Davenport Date: Mon, 18 Apr 2022 09:31:04 -0700 Subject: [PATCH 2/3] Make fix --- internal/pkg/testutils/utils_windows.go | 7 ++++--- internal/pkg/utils/network_linux.go | 1 + internal/pkg/utils/winpol/windows_policy.go | 3 ++- pkg/dataplane/dataplane_linux.go | 3 ++- pkg/dataplane/dataplane_windows.go | 3 ++- pkg/dataplane/windows/dataplane_windows.go | 9 +++++---- pkg/install/install.go | 3 ++- win_tests/calico_cni_k8s_windows_test.go | 11 ++++++----- 8 files changed, 24 insertions(+), 16 deletions(-) diff --git a/internal/pkg/testutils/utils_windows.go b/internal/pkg/testutils/utils_windows.go index bbc3ecb1..9ca4f3ed 100644 --- a/internal/pkg/testutils/utils_windows.go +++ b/internal/pkg/testutils/utils_windows.go @@ -34,13 +34,14 @@ import ( types020 "github.com/containernetworking/cni/pkg/types/020" "github.com/containernetworking/cni/pkg/types/current" "github.com/mcuadros/go-version" - "github.com/projectcalico/cni-plugin/pkg/k8s" - plugintypes "github.com/projectcalico/cni-plugin/pkg/types" - client "github.com/projectcalico/libcalico-go/lib/clientv3" log "github.com/sirupsen/logrus" kerrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/projectcalico/cni-plugin/pkg/k8s" + plugintypes "github.com/projectcalico/cni-plugin/pkg/types" + client "github.com/projectcalico/libcalico-go/lib/clientv3" + "golang.org/x/sys/windows/registry" ) diff --git a/internal/pkg/utils/network_linux.go b/internal/pkg/utils/network_linux.go index 3b74b038..14e085c7 100644 --- a/internal/pkg/utils/network_linux.go +++ b/internal/pkg/utils/network_linux.go @@ -21,6 +21,7 @@ import ( "github.com/sirupsen/logrus" "github.com/containernetworking/cni/pkg/skel" + "github.com/projectcalico/cni-plugin/pkg/types" api "github.com/projectcalico/libcalico-go/lib/apis/v3" calicoclient "github.com/projectcalico/libcalico-go/lib/clientv3" diff --git a/internal/pkg/utils/winpol/windows_policy.go b/internal/pkg/utils/winpol/windows_policy.go index 445ddcd5..3026a06e 100644 --- a/internal/pkg/utils/winpol/windows_policy.go +++ b/internal/pkg/utils/winpol/windows_policy.go @@ -21,8 +21,9 @@ import ( "net" "strings" - "github.com/projectcalico/cni-plugin/internal/pkg/utils/hcn" "github.com/sirupsen/logrus" + + "github.com/projectcalico/cni-plugin/internal/pkg/utils/hcn" ) type PolicyMarshaller interface { diff --git a/pkg/dataplane/dataplane_linux.go b/pkg/dataplane/dataplane_linux.go index af2fe353..e5538bd9 100644 --- a/pkg/dataplane/dataplane_linux.go +++ b/pkg/dataplane/dataplane_linux.go @@ -15,9 +15,10 @@ package dataplane import ( + "github.com/sirupsen/logrus" + "github.com/projectcalico/cni-plugin/pkg/dataplane/linux" "github.com/projectcalico/cni-plugin/pkg/types" - "github.com/sirupsen/logrus" ) func getDefaultSystemDataplane(conf types.NetConf, logger *logrus.Entry) (Dataplane, error) { diff --git a/pkg/dataplane/dataplane_windows.go b/pkg/dataplane/dataplane_windows.go index 2aca1807..60fa4b36 100644 --- a/pkg/dataplane/dataplane_windows.go +++ b/pkg/dataplane/dataplane_windows.go @@ -15,9 +15,10 @@ package dataplane import ( + "github.com/sirupsen/logrus" + "github.com/projectcalico/cni-plugin/pkg/dataplane/windows" "github.com/projectcalico/cni-plugin/pkg/types" - "github.com/sirupsen/logrus" ) func getDefaultSystemDataplane(conf types.NetConf, logger *logrus.Entry) (Dataplane, error) { diff --git a/pkg/dataplane/windows/dataplane_windows.go b/pkg/dataplane/windows/dataplane_windows.go index 263c3d96..0f074bdd 100644 --- a/pkg/dataplane/windows/dataplane_windows.go +++ b/pkg/dataplane/windows/dataplane_windows.go @@ -32,16 +32,17 @@ import ( "github.com/juju/clock" "github.com/juju/errors" "github.com/juju/mutex" + "github.com/rakelkar/gonetsh/netsh" + "github.com/sirupsen/logrus" + "k8s.io/apimachinery/pkg/util/wait" + utilexec "k8s.io/utils/exec" + "github.com/projectcalico/cni-plugin/internal/pkg/utils/cri" "github.com/projectcalico/cni-plugin/internal/pkg/utils/winpol" "github.com/projectcalico/cni-plugin/pkg/types" api "github.com/projectcalico/libcalico-go/lib/apis/v3" calicoclient "github.com/projectcalico/libcalico-go/lib/clientv3" "github.com/projectcalico/libcalico-go/lib/options" - "github.com/rakelkar/gonetsh/netsh" - "github.com/sirupsen/logrus" - "k8s.io/apimachinery/pkg/util/wait" - utilexec "k8s.io/utils/exec" ) const ( diff --git a/pkg/install/install.go b/pkg/install/install.go index 589381ed..d8b4bad4 100644 --- a/pkg/install/install.go +++ b/pkg/install/install.go @@ -28,11 +28,12 @@ import ( "github.com/howeyc/fsnotify" "github.com/kelseyhightower/envconfig" cp "github.com/nmrshll/go-cp" - "github.com/projectcalico/libcalico-go/lib/names" "github.com/prometheus/common/log" "github.com/sirupsen/logrus" "go.etcd.io/etcd/pkg/fileutil" "k8s.io/client-go/rest" + + "github.com/projectcalico/libcalico-go/lib/names" ) type config struct { diff --git a/win_tests/calico_cni_k8s_windows_test.go b/win_tests/calico_cni_k8s_windows_test.go index 68d147c4..41acd1a9 100755 --- a/win_tests/calico_cni_k8s_windows_test.go +++ b/win_tests/calico_cni_k8s_windows_test.go @@ -28,6 +28,12 @@ import ( "github.com/Microsoft/hcsshim" "github.com/containernetworking/cni/pkg/types/current" + log "github.com/sirupsen/logrus" + v1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/client-go/kubernetes" + api "github.com/projectcalico/api/pkg/apis/projectcalico/v3" "github.com/projectcalico/api/pkg/lib/numorstring" "github.com/projectcalico/cni-plugin/internal/pkg/testutils" @@ -40,11 +46,6 @@ import ( "github.com/projectcalico/libcalico-go/lib/logutils" "github.com/projectcalico/libcalico-go/lib/names" "github.com/projectcalico/libcalico-go/lib/options" - log "github.com/sirupsen/logrus" - v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/client-go/kubernetes" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" From fd7dcf24dae2262395ed50d5d9241184242a29ce Mon Sep 17 00:00:00 2001 From: Casey Davenport Date: Mon, 18 Apr 2022 10:13:49 -0700 Subject: [PATCH 3/3] Pin k8s version for tests --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index 0c2d2fa4..7127074d 100644 --- a/Makefile +++ b/Makefile @@ -50,6 +50,9 @@ endif include Makefile.common +# Override K8S_VERSION to last available hyperkube. +K8S_VERSION = v1.18.6 + ############################################################################### # fail if unable to download