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:
parent
0be5255be9
commit
367156f60b
12 changed files with 17 additions and 18 deletions
2
.github/actions/setup-build-env/action.yaml
vendored
2
.github/actions/setup-build-env/action.yaml
vendored
|
@ -18,7 +18,7 @@ runs:
|
||||||
git fetch --prune --unshallow
|
git fetch --prune --unshallow
|
||||||
- uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
|
- uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
|
||||||
with:
|
with:
|
||||||
go-version: ~1.19.4
|
go-version: ~1.20.2
|
||||||
- uses: actions/cache@4723a57e26efda3a62cbde1812113b730952852d # v3.2.2
|
- uses: actions/cache@4723a57e26efda3a62cbde1812113b730952852d # v3.2.2
|
||||||
with:
|
with:
|
||||||
path: ~/go/pkg/mod
|
path: ~/go/pkg/mod
|
||||||
|
|
2
.github/workflows/tests.yaml
vendored
2
.github/workflows/tests.yaml
vendored
|
@ -29,7 +29,7 @@ jobs:
|
||||||
- name: golangci-lint
|
- name: golangci-lint
|
||||||
uses: golangci/golangci-lint-action@08e2f20817b15149a52b5b3ebe7de50aff2ba8c5 # v3.4.0
|
uses: golangci/golangci-lint-action@08e2f20817b15149a52b5b3ebe7de50aff2ba8c5 # v3.4.0
|
||||||
with:
|
with:
|
||||||
version: v1.48
|
version: v1.52.2
|
||||||
skip-cache: true
|
skip-cache: true
|
||||||
- name: go fmt check
|
- name: go fmt check
|
||||||
run: make fmt-check
|
run: make fmt-check
|
||||||
|
|
2
Makefile
2
Makefile
|
@ -660,7 +660,7 @@ test: test-clean test-unit ## Clean tests cache then run unit tests
|
||||||
.PHONY: test-clean
|
.PHONY: test-clean
|
||||||
test-clean: ## Clean tests cache
|
test-clean: ## Clean tests cache
|
||||||
@echo Clean test cache... >&2
|
@echo Clean test cache... >&2
|
||||||
@go clean -testcache ./...
|
@go clean -testcache
|
||||||
|
|
||||||
.PHONY: test-unit
|
.PHONY: test-unit
|
||||||
test-unit: test-clean $(GO_ACC) ## Run unit tests
|
test-unit: test-clean $(GO_ACC) ## Run unit tests
|
||||||
|
|
2
go.mod
2
go.mod
|
@ -1,6 +1,6 @@
|
||||||
module github.com/kyverno/kyverno
|
module github.com/kyverno/kyverno
|
||||||
|
|
||||||
go 1.19
|
go 1.20
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/IGLOU-EU/go-wildcard v1.0.3
|
github.com/IGLOU-EU/go-wildcard v1.0.3
|
||||||
|
|
|
@ -7,10 +7,9 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
|
||||||
|
|
||||||
. "github.com/onsi/ginkgo"
|
. "github.com/onsi/ginkgo"
|
||||||
. "github.com/onsi/gomega"
|
. "github.com/onsi/gomega"
|
||||||
|
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -3,10 +3,9 @@ package dclient
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -6,7 +6,6 @@ import (
|
||||||
|
|
||||||
kyverno "github.com/kyverno/kyverno/api/kyverno/v1"
|
kyverno "github.com/kyverno/kyverno/api/kyverno/v1"
|
||||||
"github.com/kyverno/kyverno/pkg/autogen"
|
"github.com/kyverno/kyverno/pkg/autogen"
|
||||||
|
|
||||||
"gotest.tools/assert"
|
"gotest.tools/assert"
|
||||||
admissionregistrationv1 "k8s.io/api/admissionregistration/v1"
|
admissionregistrationv1 "k8s.io/api/admissionregistration/v1"
|
||||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||||
|
|
|
@ -11,7 +11,6 @@ import (
|
||||||
kyvernov1 "github.com/kyverno/kyverno/api/kyverno/v1"
|
kyvernov1 "github.com/kyverno/kyverno/api/kyverno/v1"
|
||||||
enginecontext "github.com/kyverno/kyverno/pkg/engine/context"
|
enginecontext "github.com/kyverno/kyverno/pkg/engine/context"
|
||||||
"gotest.tools/assert"
|
"gotest.tools/assert"
|
||||||
|
|
||||||
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
|
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@ package jmespath
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"crypto/rand"
|
||||||
"crypto/x509"
|
"crypto/x509"
|
||||||
"encoding/asn1"
|
"encoding/asn1"
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
|
@ -9,14 +10,12 @@ import (
|
||||||
"encoding/pem"
|
"encoding/pem"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"math/rand"
|
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"reflect"
|
"reflect"
|
||||||
"regexp"
|
"regexp"
|
||||||
"sort"
|
"sort"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
|
||||||
|
|
||||||
trunc "github.com/aquilax/truncate"
|
trunc "github.com/aquilax/truncate"
|
||||||
"github.com/blang/semver/v4"
|
"github.com/blang/semver/v4"
|
||||||
|
@ -1033,7 +1032,13 @@ func jpRandom(arguments []interface{}) (interface{}, error) {
|
||||||
if pattern == "" {
|
if pattern == "" {
|
||||||
return "", errors.New("no pattern provided")
|
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)
|
ans, err := regen.Generate(pattern)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
@ -4,7 +4,6 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/go-logr/logr"
|
"github.com/go-logr/logr"
|
||||||
|
|
||||||
"github.com/kyverno/kyverno/pkg/engine/context"
|
"github.com/kyverno/kyverno/pkg/engine/context"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -97,10 +97,10 @@ func ParsePath(rawPath string) Pointer {
|
||||||
sb.Reset()
|
sb.Reset()
|
||||||
}
|
}
|
||||||
|
|
||||||
var pos int
|
var pos, width int
|
||||||
var escaped, quoted bool
|
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
|
var r rune
|
||||||
r, width = utf8.DecodeRuneInString(rawPath[i:])
|
r, width = utf8.DecodeRuneInString(rawPath[i:])
|
||||||
if r == utf8.RuneError && width == 1 {
|
if r == utf8.RuneError && width == 1 {
|
||||||
|
|
|
@ -11,9 +11,8 @@ import (
|
||||||
"github.com/kyverno/kyverno/pkg/policycache"
|
"github.com/kyverno/kyverno/pkg/policycache"
|
||||||
"gotest.tools/assert"
|
"gotest.tools/assert"
|
||||||
v1 "k8s.io/api/admission/v1"
|
v1 "k8s.io/api/admission/v1"
|
||||||
"k8s.io/apimachinery/pkg/runtime"
|
|
||||||
|
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
"k8s.io/apimachinery/pkg/runtime"
|
||||||
)
|
)
|
||||||
|
|
||||||
var policyCheckLabel = `{
|
var policyCheckLabel = `{
|
||||||
|
|
Loading…
Reference in a new issue