diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index beed37e5..f21fbadb 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -10,8 +10,8 @@ on: env: # Common versions - GO_VERSION: '1.18' - GOLANGCI_VERSION: 'v1.47' + GO_VERSION: '1.19' + GOLANGCI_VERSION: 'v1.51' DOCKER_BUILDX_VERSION: 'v0.4.2' # Common users. We can't run a step 'if secrets.AWS_USR != ""' but we can run @@ -43,7 +43,7 @@ jobs: run: | make generate - name: Lint golang code - uses: golangci/golangci-lint-action@v3.2.0 + uses: golangci/golangci-lint-action@v3.5.0 with: version: ${{ env.GOLANGCI_VERSION }} args: --verbose --timeout=10m diff --git a/.github/workflows/e2e-1.24.yaml b/.github/workflows/e2e-1.26.yaml similarity index 95% rename from .github/workflows/e2e-1.24.yaml rename to .github/workflows/e2e-1.26.yaml index ea8fad21..0ec8eb8a 100644 --- a/.github/workflows/e2e-1.24.yaml +++ b/.github/workflows/e2e-1.26.yaml @@ -1,4 +1,4 @@ -name: E2E-1.24 +name: E2E-1.26 on: push: @@ -10,10 +10,10 @@ on: env: # Common versions - GO_VERSION: '1.18' + GO_VERSION: '1.19' KIND_ACTION_VERSION: 'v1.3.0' KIND_VERSION: 'v0.14.0' - KIND_IMAGE: 'kindest/node:v1.24.2' + KIND_IMAGE: 'kindest/node:v1.26.4' KIND_CLUSTER_NAME: 'ci-testing' jobs: @@ -47,7 +47,7 @@ jobs: make helm helm repo add openkruise https://openkruise.github.io/charts/ helm repo update - helm install kruise openkruise/kruise --version 1.3.0 --set featureGates="PodProbeMarkerGate=true" + helm install kruise openkruise/kruise --version 1.5.0 for ((i=1;i<10;i++)); do set +e diff --git a/go.mod b/go.mod index 10a3e4bb..9d1ad1c4 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/openkruise/kruise-game -go 1.18 +go 1.19 require ( github.com/BurntSushi/toml v0.3.1 @@ -8,6 +8,7 @@ require ( github.com/onsi/ginkgo v1.16.5 github.com/onsi/gomega v1.18.1 github.com/openkruise/kruise-api v1.3.0 + github.com/prometheus/client_golang v1.12.1 google.golang.org/grpc v1.40.0 google.golang.org/protobuf v1.27.1 k8s.io/api v0.24.0 @@ -57,7 +58,6 @@ require ( github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/nxadm/tail v1.4.8 // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/prometheus/client_golang v1.12.1 // indirect github.com/prometheus/client_model v0.2.0 // indirect github.com/prometheus/common v0.32.1 // indirect github.com/prometheus/procfs v0.7.3 // indirect diff --git a/pkg/webhook/util/writer/atomic/atomic_writer.go b/pkg/webhook/util/writer/atomic/atomic_writer.go index b2387f79..1167fb60 100644 --- a/pkg/webhook/util/writer/atomic/atomic_writer.go +++ b/pkg/webhook/util/writer/atomic/atomic_writer.go @@ -20,7 +20,6 @@ package atomic import ( "bytes" "fmt" - "io/ioutil" "os" "path" "path/filepath" @@ -301,7 +300,7 @@ func shouldWriteFile(path string, content []byte) (bool, error) { return true, nil } - contentOnFs, err := ioutil.ReadFile(path) + contentOnFs, err := os.ReadFile(path) if err != nil { return false, err } @@ -353,7 +352,7 @@ func (w *Writer) pathsToRemove(payload map[string]FileProjection, oldTsDir strin // newTimestampDir creates a new timestamp directory func (w *Writer) newTimestampDir() (string, error) { - tsDir, err := ioutil.TempDir(w.targetDir, time.Now().UTC().Format("..2006_01_02_15_04_05.")) + tsDir, err := os.MkdirTemp(w.targetDir, time.Now().UTC().Format("..2006_01_02_15_04_05.")) if err != nil { klog.Error(err, "unable to create new temp directory") return "", err @@ -386,12 +385,12 @@ func (w *Writer) writePayloadToDir(payload map[string]FileProjection, dir string return err } - err = ioutil.WriteFile(fullPath, content, mode) + err = os.WriteFile(fullPath, content, mode) if err != nil { klog.Error(err, "unable to write file", "file", fullPath, "mode", mode) return err } - // Chmod is needed because ioutil.WriteFile() ends up calling + // Chmod is needed because os.WriteFile() ends up calling // open(2) to create the file, so the final mode used is "mode & // ~umask". But we want to make sure the specified mode is used // in the file no matter what the umask is. diff --git a/pkg/webhook/util/writer/fs.go b/pkg/webhook/util/writer/fs.go index 93350e35..e3fa3556 100644 --- a/pkg/webhook/util/writer/fs.go +++ b/pkg/webhook/util/writer/fs.go @@ -20,7 +20,6 @@ package writer import ( "errors" "fmt" - "io/ioutil" "os" "path" @@ -158,19 +157,19 @@ func (f *fsCertWriter) read() (*generator.Artifacts, error) { if err := ensureExist(f.Path); err != nil { return nil, err } - caKeyBytes, err := ioutil.ReadFile(path.Join(f.Path, CAKeyName)) + caKeyBytes, err := os.ReadFile(path.Join(f.Path, CAKeyName)) if err != nil { return nil, err } - caCertBytes, err := ioutil.ReadFile(path.Join(f.Path, CACertName)) + caCertBytes, err := os.ReadFile(path.Join(f.Path, CACertName)) if err != nil { return nil, err } - certBytes, err := ioutil.ReadFile(path.Join(f.Path, ServerCertName)) + certBytes, err := os.ReadFile(path.Join(f.Path, ServerCertName)) if err != nil { return nil, err } - keyBytes, err := ioutil.ReadFile(path.Join(f.Path, ServerKeyName)) + keyBytes, err := os.ReadFile(path.Join(f.Path, ServerKeyName)) if err != nil { return nil, err }