-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update go to 1.20 and dependencies to latest
Update golangci-lint and fix lint and test problems Signed-off-by: amaslennikov <[email protected]>
- Loading branch information
1 parent
63dfef7
commit a2067df
Showing
31 changed files
with
391 additions
and
738 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: go-static-analysis | ||
on: [push, pull_request] | ||
jobs: | ||
golangci: | ||
name: Lint | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.20.x | ||
- name: checkout PR | ||
uses: actions/checkout@v2 | ||
- name: run make lint | ||
run: make lint | ||
hadolint: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.20.x | ||
- name: checkout PR | ||
uses: actions/checkout@v2 | ||
- name: run make hadolint | ||
run: make hadolint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,6 @@ linters: | |
- contextcheck | ||
#- cyclop | ||
- decorder | ||
- depguard | ||
- dogsled | ||
- durationcheck | ||
- errcheck | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,6 +76,14 @@ unit-test: envtest ## Run unit tests. | |
.PHONY: test | ||
test: lint unit-test ## Run all tests (lint, unit-test). | ||
|
||
HADOLINT_TOOL = $(BINDIR)/hadolint | ||
$(HADOLINT_TOOL): | $(BASE) ; $(info installing hadolint...) | ||
$(call wget-install-tool,$(HADOLINT_TOOL),"https://github.com/hadolint/hadolint/releases/download/v2.12.1-beta/hadolint-Linux-x86_64") | ||
|
||
GOVERALLS = $(BINDIR)/goveralls | ||
$(GOVERALLS): | $(BASE) ; $(info installing goveralls...) | ||
$(call go-install-tool,$(GOVERALLS),github.com/mattn/goveralls@latest) | ||
|
||
.PHONY: test-coverage | ||
test-coverage: | envtest gocovmerge gcov2lcov ## Run coverage tests | ||
mkdir -p $(PROJECT_DIR)/build/coverage/pkgs | ||
|
@@ -129,7 +137,7 @@ kustomize: ## Download kustomize locally if necessary. | |
|
||
.PHONY: golangci-lint | ||
golangci-lint: ## Download golangci-lint locally if necessary. | ||
$(call go-install-tool,$(GOLANGCILINT),github.com/golangci/golangci-lint/cmd/golangci-lint@v1.49.0) | ||
$(call go-install-tool,$(GOLANGCILINT),github.com/golangci/golangci-lint/cmd/golangci-lint@v1.53.3) | ||
|
||
.PHONY: mockery | ||
mockery: ## Download mockery if necessary. | ||
|
@@ -147,6 +155,10 @@ gocovmerge: ## Download gocovmerge if necessary | |
gcov2lcov: ## Download gcov2lcov if necessary | ||
$(call go-install-tool,$(GCOV2LCOV),github.com/jandelgado/[email protected]) | ||
|
||
.PHONY: hadolint | ||
hadolint: $(BASE) $(HADOLINT_TOOL); $(info running hadolint...) @ ## Run hadolint | ||
$Q $(HADOLINT_TOOL) Dockerfile | ||
|
||
.PHONY: clean | ||
clean: | ||
@rm -rf build | ||
|
@@ -161,3 +173,12 @@ echo "Downloading $(2)" ;\ | |
GOBIN=$(PROJECT_DIR)/bin go install $(2) ;\ | ||
} | ||
endef | ||
|
||
define wget-install-tool | ||
@[ -f $(1) ] || { \ | ||
mkdir -p $(BIN_DIR);\ | ||
echo "Downloading $(2)" ;\ | ||
wget -O $(1) $(2);\ | ||
chmod +x $(1) ;\ | ||
} | ||
endef |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,99 +1,104 @@ | ||
module github.com/k8snetworkplumbingwg/multi-networkpolicy-tc | ||
|
||
go 1.18 | ||
go 1.20 | ||
|
||
require ( | ||
github.com/Mellanox/sriovnet v1.1.0 | ||
github.com/containernetworking/cni v1.1.1 | ||
github.com/google/uuid v1.1.2 | ||
github.com/k8snetworkplumbingwg/multi-networkpolicy v0.0.0-20220419111628-220baf5d60c1 | ||
github.com/k8snetworkplumbingwg/network-attachment-definition-client v1.3.0 | ||
github.com/onsi/ginkgo/v2 v2.1.4 | ||
github.com/onsi/gomega v1.19.0 | ||
github.com/containernetworking/cni v1.1.2 | ||
github.com/google/uuid v1.3.0 | ||
github.com/k8snetworkplumbingwg/multi-networkpolicy v0.0.0-20230301165931-f1873dc329c6 | ||
github.com/k8snetworkplumbingwg/network-attachment-definition-client v1.4.0 | ||
github.com/onsi/ginkgo v1.16.5 | ||
github.com/onsi/ginkgo/v2 v2.9.1 | ||
github.com/onsi/gomega v1.27.4 | ||
github.com/pkg/errors v0.9.1 | ||
github.com/spf13/cobra v1.5.0 | ||
github.com/spf13/cobra v1.7.0 | ||
github.com/spf13/pflag v1.0.5 | ||
github.com/stretchr/testify v1.7.0 | ||
github.com/stretchr/testify v1.8.4 | ||
github.com/vishvananda/netlink v1.2.1-beta.2.0.20230206183746-70ca0345eede | ||
golang.org/x/sys v0.0.0-20220804214406-8e32c043e418 | ||
k8s.io/api v0.24.2 | ||
k8s.io/apimachinery v0.24.2 | ||
k8s.io/client-go v0.24.2 | ||
k8s.io/klog/v2 v2.70.1 | ||
k8s.io/kubernetes v1.24.3 | ||
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 | ||
golang.org/x/sys v0.10.0 | ||
k8s.io/api v0.27.3 | ||
k8s.io/apimachinery v0.27.3 | ||
k8s.io/client-go v0.27.3 | ||
k8s.io/klog/v2 v2.100.1 | ||
k8s.io/kubernetes v1.27.3 | ||
k8s.io/utils v0.0.0-20230505201702-9f6742963106 | ||
sigs.k8s.io/controller-runtime v0.12.3 | ||
) | ||
|
||
require ( | ||
github.com/PuerkitoBio/purell v1.1.1 // indirect | ||
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect | ||
github.com/davecgh/go-spew v1.1.1 // indirect | ||
github.com/emicklei/go-restful v2.10.0+incompatible // indirect | ||
github.com/emicklei/go-restful/v3 v3.10.2 // indirect | ||
github.com/evanphx/json-patch v4.12.0+incompatible // indirect | ||
github.com/go-logr/logr v1.2.0 // indirect | ||
github.com/go-openapi/jsonpointer v0.19.5 // indirect | ||
github.com/go-openapi/jsonreference v0.19.5 // indirect | ||
github.com/go-openapi/swag v0.19.14 // indirect | ||
github.com/fsnotify/fsnotify v1.6.0 // indirect | ||
github.com/go-logr/logr v1.2.4 // indirect | ||
github.com/go-openapi/jsonpointer v0.19.6 // indirect | ||
github.com/go-openapi/jsonreference v0.20.2 // indirect | ||
github.com/go-openapi/swag v0.22.4 // indirect | ||
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 // indirect | ||
github.com/gogo/protobuf v1.3.2 // indirect | ||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect | ||
github.com/golang/protobuf v1.5.2 // indirect | ||
github.com/google/gnostic v0.5.7-v3refs // indirect | ||
github.com/google/go-cmp v0.5.5 // indirect | ||
github.com/google/gofuzz v1.1.0 // indirect | ||
github.com/imdario/mergo v0.3.12 // indirect | ||
github.com/inconshreveable/mousetrap v1.0.0 // indirect | ||
github.com/golang/protobuf v1.5.3 // indirect | ||
github.com/google/gnostic v0.6.9 // indirect | ||
github.com/google/go-cmp v0.5.9 // indirect | ||
github.com/google/gofuzz v1.2.0 // indirect | ||
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect | ||
github.com/imdario/mergo v0.3.16 // indirect | ||
github.com/inconshreveable/mousetrap v1.1.0 // indirect | ||
github.com/josharian/intern v1.0.0 // indirect | ||
github.com/json-iterator/go v1.1.12 // indirect | ||
github.com/mailru/easyjson v0.7.6 // indirect | ||
github.com/mailru/easyjson v0.7.7 // indirect | ||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect | ||
github.com/modern-go/reflect2 v1.0.2 // indirect | ||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect | ||
github.com/nxadm/tail v1.4.8 // indirect | ||
github.com/pmezard/go-difflib v1.0.0 // indirect | ||
github.com/spf13/afero v1.6.0 // indirect | ||
github.com/stretchr/objx v0.2.0 // indirect | ||
github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae // indirect | ||
golang.org/x/net v0.0.0-20220225172249-27dd8689420f // indirect | ||
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect | ||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect | ||
golang.org/x/text v0.3.7 // indirect | ||
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect | ||
github.com/spf13/afero v1.9.5 // indirect | ||
github.com/stretchr/objx v0.5.0 // indirect | ||
github.com/vishvananda/netns v0.0.4 // indirect | ||
golang.org/x/net v0.12.0 // indirect | ||
golang.org/x/oauth2 v0.10.0 // indirect | ||
golang.org/x/term v0.10.0 // indirect | ||
golang.org/x/text v0.11.0 // indirect | ||
golang.org/x/time v0.3.0 // indirect | ||
golang.org/x/tools v0.7.0 // indirect | ||
google.golang.org/appengine v1.6.7 // indirect | ||
google.golang.org/protobuf v1.27.1 // indirect | ||
google.golang.org/protobuf v1.31.0 // indirect | ||
gopkg.in/inf.v0 v0.9.1 // indirect | ||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect | ||
gopkg.in/yaml.v2 v2.4.0 // indirect | ||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect | ||
gopkg.in/yaml.v3 v3.0.1 // indirect | ||
k8s.io/apiextensions-apiserver v0.24.2 // indirect | ||
k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42 // indirect | ||
sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 // indirect | ||
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect | ||
k8s.io/kube-openapi v0.0.0-20230525220651-2546d827e515 // indirect | ||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect | ||
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect | ||
sigs.k8s.io/yaml v1.3.0 // indirect | ||
) | ||
|
||
replace ( | ||
k8s.io/api => k8s.io/api v0.24.2 | ||
k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.24.2 | ||
k8s.io/apimachinery => k8s.io/apimachinery v0.24.2 | ||
k8s.io/apiserver => k8s.io/apiserver v0.24.2 | ||
k8s.io/cli-runtime => k8s.io/cli-runtime v0.24.2 | ||
k8s.io/client-go => k8s.io/client-go v0.24.2 | ||
k8s.io/cloud-provider => k8s.io/cloud-provider v0.24.2 | ||
k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.24.2 | ||
k8s.io/code-generator => k8s.io/code-generator v0.24.2 | ||
k8s.io/component-base => k8s.io/component-base v0.24.2 | ||
k8s.io/component-helpers => k8s.io/component-helpers v0.24.2 | ||
k8s.io/controller-manager => k8s.io/controller-manager v0.24.2 | ||
k8s.io/cri-api => k8s.io/cri-api v0.24.2 | ||
k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.24.2 | ||
k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.24.2 | ||
k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.24.2 | ||
k8s.io/kube-proxy => k8s.io/kube-proxy v0.24.2 | ||
k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.24.2 | ||
k8s.io/kubectl => k8s.io/kubectl v0.24.2 | ||
k8s.io/kubelet => k8s.io/kubelet v0.24.2 | ||
k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.24.2 | ||
k8s.io/metrics => k8s.io/metrics v0.24.2 | ||
k8s.io/mount-utils => k8s.io/mount-utils v0.24.2 | ||
k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.24.2 | ||
k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.24.2 | ||
k8s.io/api => k8s.io/api v0.27.3 | ||
k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.27.3 | ||
k8s.io/apimachinery => k8s.io/apimachinery v0.27.3 | ||
k8s.io/apiserver => k8s.io/apiserver v0.27.3 | ||
k8s.io/cli-runtime => k8s.io/cli-runtime v0.27.3 | ||
k8s.io/client-go => k8s.io/client-go v0.27.3 | ||
k8s.io/cloud-provider => k8s.io/cloud-provider v0.27.3 | ||
k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.27.3 | ||
k8s.io/code-generator => k8s.io/code-generator v0.27.3 | ||
k8s.io/component-base => k8s.io/component-base v0.27.3 | ||
k8s.io/component-helpers => k8s.io/component-helpers v0.27.3 | ||
k8s.io/controller-manager => k8s.io/controller-manager v0.27.3 | ||
k8s.io/cri-api => k8s.io/cri-api v0.27.3 | ||
k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.27.3 | ||
k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.27.3 | ||
k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.27.3 | ||
k8s.io/kube-proxy => k8s.io/kube-proxy v0.27.3 | ||
k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.27.3 | ||
k8s.io/kubectl => k8s.io/kubectl v0.27.3 | ||
k8s.io/kubelet => k8s.io/kubelet v0.27.3 | ||
k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.27.3 | ||
k8s.io/metrics => k8s.io/metrics v0.27.3 | ||
k8s.io/mount-utils => k8s.io/mount-utils v0.27.3 | ||
k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.27.3 | ||
k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.27.3 | ||
) |
Oops, something went wrong.