1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2024-12-14 11:57:48 +00:00

[Chore] Bump to Go 1.20 (#6683)

* changed go version 1.19->1.20

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* updated go version in actions

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* bumped golangci-lint

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* fix

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* fix conflicts

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* fix

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* fixed some linter issues

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* fixed some linter issues

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* possible fix

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* fix

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* small fix

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* fix

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

---------

Signed-off-by: Ved Ratan <vedratan8@gmail.com>
Signed-off-by: Ved Ratan <82467006+VedRatan@users.noreply.github.com>
This commit is contained in:
Ved Ratan 2023-04-03 17:10:47 +05:30 committed by GitHub
parent 0be5255be9
commit 367156f60b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 17 additions and 18 deletions

View file

@ -18,7 +18,7 @@ runs:
git fetch --prune --unshallow
- uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
with:
go-version: ~1.19.4
go-version: ~1.20.2
- uses: actions/cache@4723a57e26efda3a62cbde1812113b730952852d # v3.2.2
with:
path: ~/go/pkg/mod

View file

@ -29,7 +29,7 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@08e2f20817b15149a52b5b3ebe7de50aff2ba8c5 # v3.4.0
with:
version: v1.48
version: v1.52.2
skip-cache: true
- name: go fmt check
run: make fmt-check

View file

@ -660,7 +660,7 @@ test: test-clean test-unit ## Clean tests cache then run unit tests
.PHONY: test-clean
test-clean: ## Clean tests cache
@echo Clean test cache... >&2
@go clean -testcache ./...
@go clean -testcache
.PHONY: test-unit
test-unit: test-clean $(GO_ACC) ## Run unit tests

2
go.mod
View file

@ -1,6 +1,6 @@
module github.com/kyverno/kyverno
go 1.19
go 1.20
require (
github.com/IGLOU-EU/go-wildcard v1.0.3

View file

@ -7,10 +7,9 @@ import (
"testing"
"time"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
)
var (

View file

@ -3,10 +3,9 @@ package dclient
import (
"testing"
"k8s.io/apimachinery/pkg/runtime/schema"
"github.com/stretchr/testify/assert"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
)
var (

View file

@ -6,7 +6,6 @@ import (
kyverno "github.com/kyverno/kyverno/api/kyverno/v1"
"github.com/kyverno/kyverno/pkg/autogen"
"gotest.tools/assert"
admissionregistrationv1 "k8s.io/api/admissionregistration/v1"
"k8s.io/apimachinery/pkg/runtime/schema"

View file

@ -11,7 +11,6 @@ import (
kyvernov1 "github.com/kyverno/kyverno/api/kyverno/v1"
enginecontext "github.com/kyverno/kyverno/pkg/engine/context"
"gotest.tools/assert"
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
)

View file

@ -2,6 +2,7 @@ package jmespath
import (
"bytes"
"crypto/rand"
"crypto/x509"
"encoding/asn1"
"encoding/base64"
@ -9,14 +10,12 @@ import (
"encoding/pem"
"errors"
"fmt"
"math/rand"
"path/filepath"
"reflect"
"regexp"
"sort"
"strconv"
"strings"
"time"
trunc "github.com/aquilax/truncate"
"github.com/blang/semver/v4"
@ -1033,7 +1032,13 @@ func jpRandom(arguments []interface{}) (interface{}, error) {
if pattern == "" {
return "", errors.New("no pattern provided")
}
rand.Seed(time.Now().UnixNano())
b := make([]byte, 8)
_, err := rand.Read(b)
if err != nil {
return nil, err
}
ans, err := regen.Generate(pattern)
if err != nil {
return nil, err

View file

@ -4,7 +4,6 @@ import (
"testing"
"github.com/go-logr/logr"
"github.com/kyverno/kyverno/pkg/engine/context"
)

View file

@ -97,10 +97,10 @@ func ParsePath(rawPath string) Pointer {
sb.Reset()
}
var pos int
var pos, width int
var escaped, quoted bool
for i, width := 0, 0; i <= len(rawPath); i += width {
for i := 0; i <= len(rawPath); i += width {
var r rune
r, width = utf8.DecodeRuneInString(rawPath[i:])
if r == utf8.RuneError && width == 1 {

View file

@ -11,9 +11,8 @@ import (
"github.com/kyverno/kyverno/pkg/policycache"
"gotest.tools/assert"
v1 "k8s.io/api/admission/v1"
"k8s.io/apimachinery/pkg/runtime"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
)
var policyCheckLabel = `{