From 8b5ad071ebca372f110bd6ae5c7832e484fef24e Mon Sep 17 00:00:00 2001 From: Daniel Fajmon Date: Wed, 14 Aug 2024 16:03:06 +0200 Subject: [PATCH 1/2] Squashed 'release-tools/' changes from adb3af9..988496a 988496a Merge pull request #257 from jakobmoellerdev/csi-prow-sidecar-e2e-path 028f8c6 chore: bump to Go 1.22.5 69bd71e chore: add CSI_PROW_SIDECAR_E2E_PATH f40f0cc Merge pull request #256 from solumath/master cfa9210 Instruction update 379a1bb Merge pull request #255 from humblec/sidecar-md a5667bb fix typo in sidecar release process 4967685 Merge pull request #254 from bells17/add-github-actions d9bd160 Update skip list in codespell GitHub Action f5aebfc Add GitHub Actions workflows git-subtree-dir: release-tools git-subtree-split: 988496a1fc3849ed793e03012fdd56813d13d46c --- .github/dependabot.yaml | 12 ++++++++++++ .github/workflows/codespell.yml | 15 +++++++++++++++ .github/workflows/trivy.yaml | 29 +++++++++++++++++++++++++++++ SIDECAR_RELEASE_PROCESS.md | 2 +- generate-patch-release-notes.sh | 16 ++++++++++------ prow.sh | 11 +++++++---- 6 files changed, 74 insertions(+), 11 deletions(-) create mode 100644 .github/dependabot.yaml create mode 100644 .github/workflows/codespell.yml create mode 100644 .github/workflows/trivy.yaml diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml new file mode 100644 index 00000000..814a3449 --- /dev/null +++ b/.github/dependabot.yaml @@ -0,0 +1,12 @@ +version: 2 +enable-beta-ecosystems: true +updates: +- package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + labels: + - "area/dependency" + - "release-note-none" + - "ok-to-test" + open-pull-requests-limit: 10 diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml new file mode 100644 index 00000000..e74edcef --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,15 @@ +# GitHub Action to automate the identification of common misspellings in text files. +# https://github.com/codespell-project/actions-codespell +# https://github.com/codespell-project/codespell +name: codespell +on: [push, pull_request] +jobs: + codespell: + name: Check for spelling errors + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: codespell-project/actions-codespell@master + with: + check_filenames: true + skip: "*.png,*.jpg,*.svg,*.sum,./.git,./.github/workflows/codespell.yml,./prow.sh" diff --git a/.github/workflows/trivy.yaml b/.github/workflows/trivy.yaml new file mode 100644 index 00000000..47298478 --- /dev/null +++ b/.github/workflows/trivy.yaml @@ -0,0 +1,29 @@ +name: Run Trivy scanner for Go version vulnerabilities +on: + push: + branches: + - master + pull_request: +jobs: + trivy: + name: Build + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Get Go version + id: go-version + run: | + GO_VERSION=$(cat prow.sh | grep "configvar CSI_PROW_GO_VERSION_BUILD" | awk '{print $3}' | sed 's/"//g') + echo "version=$GO_VERSION" >> $GITHUB_OUTPUT + + - name: Run Trivy scanner for Go version vulnerabilities + uses: aquasecurity/trivy-action@master + with: + image-ref: 'golang:${{ steps.go-version.outputs.version }}' + format: 'table' + exit-code: '1' + ignore-unfixed: true + vuln-type: 'library' + severity: 'CRITICAL,HIGH,MEDIUM,LOW,UNKNOWN' diff --git a/SIDECAR_RELEASE_PROCESS.md b/SIDECAR_RELEASE_PROCESS.md index 647d2342..aab8d6e2 100644 --- a/SIDECAR_RELEASE_PROCESS.md +++ b/SIDECAR_RELEASE_PROCESS.md @@ -84,7 +84,7 @@ naming convention `-on-`. 1. Compare the generated output to the new commits for the release to check if any notable change missed a release note. 1. Reword release notes as needed, ideally in the original PRs so that the - release notes can be regnerated. Make sure to check notes for breaking + release notes can be regenerated. Make sure to check notes for breaking changes and deprecations. 1. If release is a new major/minor version, create a new `CHANGELOG-..md` file. diff --git a/generate-patch-release-notes.sh b/generate-patch-release-notes.sh index 2b9c13c3..536a1490 100755 --- a/generate-patch-release-notes.sh +++ b/generate-patch-release-notes.sh @@ -23,13 +23,17 @@ # CSI_RELEASE_TOKEN: Github token needed for generating release notes # GITHUB_USER: Github username to create PRs with # +# Required tools: +# - gh +# - release-notes (https://github.com/kubernetes/release/blob/master/cmd/release-notes/README.md) +# # Instructions: -# 1. Login with "gh auth login" -# 2. Copy this script to the kubernetes-csi directory (one directory above the -# repos) -# 3. Update the repos and versions in the $releases array -# 4. Set environment variables -# 5. Run script from the kubernetes-csi directory +# 1. Install the required tools +# 2. Login with "gh auth login" +# 3. Copy this script to the kubernetes-csi directory (one directory above the repos) +# 4. Update the repos and versions in the $releases array +# 5. Set environment variables +# 6. Run script from the kubernetes-csi directory # # Caveats: # - This script doesn't handle regenerating and updating existing PRs yet. diff --git a/prow.sh b/prow.sh index 049fb79a..df8c6150 100755 --- a/prow.sh +++ b/prow.sh @@ -86,7 +86,7 @@ configvar CSI_PROW_BUILD_PLATFORMS "linux amd64 amd64; linux ppc64le ppc64le -pp # which is disabled with GOFLAGS=-mod=vendor). configvar GOFLAGS_VENDOR "$( [ -d vendor ] && echo '-mod=vendor' )" "Go flags for using the vendor directory" -configvar CSI_PROW_GO_VERSION_BUILD "1.22.3" "Go version for building the component" # depends on component's source code +configvar CSI_PROW_GO_VERSION_BUILD "1.22.5" "Go version for building the component" # depends on component's source code configvar CSI_PROW_GO_VERSION_E2E "" "override Go version for building the Kubernetes E2E test suite" # normally doesn't need to be set, see install_e2e configvar CSI_PROW_GO_VERSION_SANITY "${CSI_PROW_GO_VERSION_BUILD}" "Go version for building the csi-sanity test suite" # depends on CSI_PROW_SANITY settings below configvar CSI_PROW_GO_VERSION_KIND "${CSI_PROW_GO_VERSION_BUILD}" "Go version for building 'kind'" # depends on CSI_PROW_KIND_VERSION below @@ -231,8 +231,11 @@ configvar CSI_PROW_E2E_VERSION "$(version_to_git "${CSI_PROW_KUBERNETES_VERSION} configvar CSI_PROW_E2E_REPO "https://github.com/kubernetes/kubernetes" "E2E repo" configvar CSI_PROW_E2E_IMPORT_PATH "k8s.io/kubernetes" "E2E package" -# Local path for e2e tests. Set to "none" to disable. -configvar CSI_PROW_SIDECAR_E2E_IMPORT_PATH "none" "CSI Sidecar E2E package" +# Local path & package path for e2e tests. Set to "none" to disable. +# When using versioned go modules, the import path is the module path whereas the path +# should not contain the version and be the directory where the module is checked out. +configvar CSI_PROW_SIDECAR_E2E_IMPORT_PATH "none" "CSI Sidecar E2E package (go import path)" +configvar CSI_PROW_SIDECAR_E2E_PATH "${CSI_PROW_SIDECAR_E2E_IMPORT_PATH}" "CSI Sidecar E2E path (directory)" # csi-sanity testing from the csi-test repo can be run against the installed # CSI driver. For this to work, deploying the driver must expose the Unix domain @@ -1035,7 +1038,7 @@ run_e2e () ( trap move_junit EXIT if [ "${name}" == "local" ]; then - cd "${GOPATH}/src/${CSI_PROW_SIDECAR_E2E_IMPORT_PATH}" && + cd "${GOPATH}/src/${CSI_PROW_SIDECAR_E2E_PATH}" && run_with_loggers env KUBECONFIG="$KUBECONFIG" KUBE_TEST_REPO_LIST="$(if [ -e "${CSI_PROW_WORK}/e2e-repo-list" ]; then echo "${CSI_PROW_WORK}/e2e-repo-list"; fi)" ginkgo --timeout="${CSI_PROW_GINKGO_TIMEOUT}" -v "$@" "${CSI_PROW_WORK}/e2e-local.test" -- -report-dir "${ARTIFACTS}" -report-prefix local else cd "${GOPATH}/src/${CSI_PROW_E2E_IMPORT_PATH}" && From a6ffb68fabced9d6fcb5fd811e94cd4b404f7c79 Mon Sep 17 00:00:00 2001 From: Daniel Fajmon Date: Wed, 14 Aug 2024 16:04:27 +0200 Subject: [PATCH 2/2] update kubernetes to v1.31.0 --- .github/workflows/trivy.yaml | 2 +- go.mod | 8 ++++---- go.sum | 12 ++++++------ vendor/modules.txt | 8 ++++---- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/trivy.yaml b/.github/workflows/trivy.yaml index 09505012..c9f83283 100644 --- a/.github/workflows/trivy.yaml +++ b/.github/workflows/trivy.yaml @@ -15,7 +15,7 @@ jobs: - name: Install go uses: actions/setup-go@v5 with: - go-version: ^1.22.3 + go-version: ^1.22.5 - name: Build an image from Dockerfile run: | diff --git a/go.mod b/go.mod index 4004b177..79c55a49 100644 --- a/go.mod +++ b/go.mod @@ -1,13 +1,13 @@ module github.com/kubernetes-csi/livenessprobe -go 1.22.3 +go 1.22.5 require ( github.com/container-storage-interface/spec v1.9.0 github.com/golang/mock v1.6.0 - github.com/kubernetes-csi/csi-lib-utils v0.19.0-beta.0 + github.com/kubernetes-csi/csi-lib-utils v0.19.0 github.com/kubernetes-csi/csi-test/v5 v5.2.0 - k8s.io/component-base v0.31.0-rc.0 + k8s.io/component-base v0.31.0 k8s.io/klog/v2 v2.130.1 ) @@ -49,7 +49,7 @@ require ( google.golang.org/protobuf v1.34.2 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect - k8s.io/apimachinery v0.31.0-rc.0 // indirect + k8s.io/apimachinery v0.31.0 // indirect k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect diff --git a/go.sum b/go.sum index d91fb21d..18f1e2f3 100644 --- a/go.sum +++ b/go.sum @@ -42,8 +42,8 @@ github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kubernetes-csi/csi-lib-utils v0.19.0-beta.0 h1:v06gHJT03w4GqSIHqY70fusyRP52c7mNGjwDP/rXlls= -github.com/kubernetes-csi/csi-lib-utils v0.19.0-beta.0/go.mod h1:UeXs7eT5VF7FC1M8NiN/+c0D3QcSVSzqvRYudXVwtf8= +github.com/kubernetes-csi/csi-lib-utils v0.19.0 h1:3sT8mL9+St2acyrEtuR7CQ5L78GR4lgsb+sfon9tGfA= +github.com/kubernetes-csi/csi-lib-utils v0.19.0/go.mod h1:lBuMKvoyd8c3EG+itmnVWApLDHnLkU7ibxxZSPuOw0M= github.com/kubernetes-csi/csi-test/v5 v5.2.0 h1:Z+sdARWC6VrONrxB24clCLCmnqCnZF7dzXtzx8eM35o= github.com/kubernetes-csi/csi-test/v5 v5.2.0/go.mod h1:o/c5w+NU3RUNE+DbVRhEUTmkQVBGk+tFOB2yPXT8teo= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -149,10 +149,10 @@ gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/apimachinery v0.31.0-rc.0 h1:8guKYtBUM/ZEvvQoWfm3hl/NEj+1eVhuSnSpDHheJmw= -k8s.io/apimachinery v0.31.0-rc.0/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= -k8s.io/component-base v0.31.0-rc.0 h1:dPS5Pm17748Ur+h5u6G2679qBT3Vq9xDlq2TNsQL1Sk= -k8s.io/component-base v0.31.0-rc.0/go.mod h1:LYJyURUhpbHK6ldqnTIPJdj9C83AqkgLhAazWv2k7Ec= +k8s.io/apimachinery v0.31.0 h1:m9jOiSr3FoSSL5WO9bjm1n6B9KROYYgNZOb4tyZ1lBc= +k8s.io/apimachinery v0.31.0/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= +k8s.io/component-base v0.31.0 h1:/KIzGM5EvPNQcYgwq5NwoQBaOlVFrghoVGr8lG6vNRs= +k8s.io/component-base v0.31.0/go.mod h1:TYVuzI1QmN4L5ItVdMSXKvH7/DtvIuas5/mm8YT3rTo= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1J8+AsQnQCKsi8A= diff --git a/vendor/modules.txt b/vendor/modules.txt index 30d857cd..f3f1bf8f 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -56,8 +56,8 @@ github.com/inconshreveable/mousetrap # github.com/json-iterator/go v1.1.12 ## explicit; go 1.12 github.com/json-iterator/go -# github.com/kubernetes-csi/csi-lib-utils v0.19.0-beta.0 -## explicit; go 1.22.0 +# github.com/kubernetes-csi/csi-lib-utils v0.19.0 +## explicit; go 1.22.5 github.com/kubernetes-csi/csi-lib-utils/connection github.com/kubernetes-csi/csi-lib-utils/metrics github.com/kubernetes-csi/csi-lib-utils/protosanitizer @@ -265,7 +265,7 @@ gopkg.in/inf.v0 # gopkg.in/yaml.v2 v2.4.0 ## explicit; go 1.15 gopkg.in/yaml.v2 -# k8s.io/apimachinery v0.31.0-rc.0 +# k8s.io/apimachinery v0.31.0 ## explicit; go 1.22.0 k8s.io/apimachinery/pkg/api/resource k8s.io/apimachinery/pkg/apis/meta/v1 @@ -292,7 +292,7 @@ k8s.io/apimachinery/pkg/util/version k8s.io/apimachinery/pkg/version k8s.io/apimachinery/pkg/watch k8s.io/apimachinery/third_party/forked/golang/reflect -# k8s.io/component-base v0.31.0-rc.0 +# k8s.io/component-base v0.31.0 ## explicit; go 1.22.0 k8s.io/component-base/cli/flag k8s.io/component-base/featuregate