diff --git a/.github/workflows/porch-e2e.yaml b/.github/workflows/porch-e2e.yaml index b772e5f7..11c9a49e 100644 --- a/.github/workflows/porch-e2e.yaml +++ b/.github/workflows/porch-e2e.yaml @@ -38,7 +38,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: '>=1.21.5' + go-version: '>=1.22.2' - name: Setup kubectl uses: azure/setup-kubectl@v3 - name: Install kpt diff --git a/.github/workflows/porchctl-cli-e2e.yaml b/.github/workflows/porchctl-cli-e2e.yaml index bdd5a17d..5aee784a 100644 --- a/.github/workflows/porchctl-cli-e2e.yaml +++ b/.github/workflows/porchctl-cli-e2e.yaml @@ -36,7 +36,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: '>=1.21.5' + go-version: '>=1.22.2' - name: Setup kubectl uses: azure/setup-kubectl@v3 - name: Install kpt diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index dd799862..4b4494e6 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -28,7 +28,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: '>=1.21.5' + go-version: '>=1.22.2' - name: Checkout uses: actions/checkout@v4 with: diff --git a/.prow.yaml b/.prow.yaml index 9eed387f..2849fd39 100644 --- a/.prow.yaml +++ b/.prow.yaml @@ -1,7 +1,7 @@ presubmits: - name: presubmit-nephio-go-test decorate: true - run_if_changed: "(\\.go|Makefile)$" + run_if_changed: "(\\.go|Makefile|\\.mk)$" spec: containers: - image: nephio/gotests:1782782171367346176 @@ -9,14 +9,3 @@ presubmits: - make args: - ci-unit - - name: presubmit-porch-e2e - decorate: true - optional: true - run_if_changed: "(\\.go|Makefile)$" - spec: - containers: - - image: nephio/gotests:1782782171367346176 - command: - - make - args: - - ci-test-porch diff --git a/Makefile b/Makefile index 70fa7c2a..f8acabb8 100644 --- a/Makefile +++ b/Makefile @@ -159,19 +159,11 @@ generate: generate-api tidy: @for f in $(MODULES); do (cd $$f; echo "Tidying $$f"; go mod tidy) || exit 1; done -.PHONY: test-porch -test-porch: - #@for f in $(MODULES); do (cd $$f; echo "Testing $$f"; E2E=1 go test -v -race --count=1 ./...) || exit 1; done - @for f in $(MODULES); do (cd $$f; echo "Testing $$f"; go test -v -race --count=1 ./...) || exit 1; done - .PHONY: configure-git configure-git: git config --global --add user.name test git config --global --add user.email test@nephio.org -.PHONY: ci-test-porch -ci-test-porch: configure-git test-porch - .PHONY: ci-unit ci-unit: configure-git test diff --git a/api/go.mod b/api/go.mod index 2562e342..35f45c21 100644 --- a/api/go.mod +++ b/api/go.mod @@ -1,6 +1,6 @@ module github.com/nephio-project/porch/api -go 1.21 +go 1.22 require ( k8s.io/apimachinery v0.29.2 diff --git a/build/Dockerfile b/build/Dockerfile index 8a52ab05..de16a9b3 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -13,7 +13,7 @@ # limitations under the License. -FROM golang:1.21.4-bookworm as builder +FROM golang:1.22.2-bookworm as builder WORKDIR /go/src diff --git a/build/Dockerfile.apiserver b/build/Dockerfile.apiserver index 122178d9..0cacc1ce 100644 --- a/build/Dockerfile.apiserver +++ b/build/Dockerfile.apiserver @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM golang:1.21.4-bookworm as builder +FROM golang:1.22.2-bookworm as builder WORKDIR /workspace/src RUN git clone https://github.com/kubernetes/kubernetes --branch v1.23.2 --depth=1 diff --git a/build/Dockerfile.etcd b/build/Dockerfile.etcd index aaa7dff3..2c46dcd6 100644 --- a/build/Dockerfile.etcd +++ b/build/Dockerfile.etcd @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM golang:1.21.3-bookworm as builder +FROM golang:1.22.2-bookworm as builder WORKDIR /workspace ARG ETCD_VER=v3.5.1 diff --git a/controllers/Dockerfile b/controllers/Dockerfile index 9580faac..67f8899f 100644 --- a/controllers/Dockerfile +++ b/controllers/Dockerfile @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM golang:1.21.4-bookworm as builder +FROM golang:1.22.2-bookworm as builder WORKDIR /go/src COPY porch/ . diff --git a/controllers/go.mod b/controllers/go.mod index f42266fd..8df5b97c 100644 --- a/controllers/go.mod +++ b/controllers/go.mod @@ -1,6 +1,6 @@ module github.com/nephio-project/porch/controllers -go 1.21 +go 1.22 replace ( github.com/go-git/go-git/v5 v5.4.3-0.20220408232334-4f916225cb2f => github.com/platkrm/go-git/v5 v5.4.3-0.20220410165046-c76b262044ce diff --git a/controllers/packagevariantsets/pkg/controllers/packagevariantset/render.go b/controllers/packagevariantsets/pkg/controllers/packagevariantset/render.go index b78c2d08..2f42d416 100644 --- a/controllers/packagevariantsets/pkg/controllers/packagevariantset/render.go +++ b/controllers/packagevariantsets/pkg/controllers/packagevariantset/render.go @@ -319,7 +319,7 @@ func evalExpr(expr string, inputs map[string]interface{}) (string, error) { return "", err } - result, err := val.ConvertToNative(reflect.TypeOf("")) + result, err := val.ConvertToNative(reflect.TypeFor[string]()) if err != nil { return "", err } diff --git a/default-go-lint.mk b/default-go-lint.mk index a0c8cfa4..216786f2 100644 --- a/default-go-lint.mk +++ b/default-go-lint.mk @@ -13,7 +13,7 @@ # limitations under the License. -GOLANG_CI_VER ?= v1.52 +GOLANG_CI_VER ?= v1.57 GIT_ROOT_DIR ?= $(dir $(lastword $(MAKEFILE_LIST))) include $(GIT_ROOT_DIR)/detect-container-runtime.mk diff --git a/default-go-test.mk b/default-go-test.mk index 355b21f3..da976f13 100644 --- a/default-go-test.mk +++ b/default-go-test.mk @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -GO_VERSION ?= 1.20.2 +GO_VERSION ?= 1.22.2 TEST_COVERAGE_FILE=lcov.info TEST_COVERAGE_HTML_FILE=coverage_unit.html TEST_COVERAGE_FUNC_FILE=func_coverage.out @@ -42,4 +42,4 @@ unit-clean: ## Clean up the artifacts created by the unit tests ifeq ($(CONTAINER_RUNNABLE), 0) $(CONTAINER_RUNTIME) system prune -f endif - rm ${TEST_COVERAGE_FILE} ${TEST_COVERAGE_HTML_FILE} ${TEST_COVERAGE_FUNC_FILE} > /dev/null 2>&1 + rm -f ${TEST_COVERAGE_FILE} ${TEST_COVERAGE_HTML_FILE} ${TEST_COVERAGE_FUNC_FILE} > /dev/null 2>&1 diff --git a/default-gosec.mk b/default-gosec.mk index 316c96e3..b0e146f8 100644 --- a/default-gosec.mk +++ b/default-gosec.mk @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -GOSEC_VER ?= 2.15.0 +GOSEC_VER ?= 2.19.0 GIT_ROOT_DIR ?= $(dir $(lastword $(MAKEFILE_LIST))) include $(GIT_ROOT_DIR)/detect-container-runtime.mk diff --git a/docs/tutorials/porch-development-environment/README.md b/docs/tutorials/porch-development-environment/README.md index c91f627a..99e021b8 100644 --- a/docs/tutorials/porch-development-environment/README.md +++ b/docs/tutorials/porch-development-environment/README.md @@ -9,11 +9,11 @@ and running to which a Porch instance running in Visual Studio Code can connect # Setup kind with MetalLB and Gitea -Follow steps 1-5 inclusive of the [Starting with Porch](https://github.com/nephio-project/porch/tree/main/docs/tutorials/starting-with-porch) tutorial. You now have two Kind clusters `management` and `edge1` running with Gitea installed on the `management` cluster. Gitea has the repositories `management` and `edge1` defined. +Follow steps 1-5 inclusive of the [Starting with Porch](https://github.com/nephio-project/porch/tree/main/docs/tutorials/starting-with-porch) tutorial. You now have the Kind cluster `management` running with Gitea installed on it. Gitea has the repository `management` defined. > **_NOTE:_** This [setup script](bin/setup.sh) automates steps 1-5 of the Starting with Porch tutorial. You may need to adapt this script to your local environment and also have [pre requisites](https://github.com/nephio-project/porch/tree/main/docs/tutorials/starting-with-porch#prerequisites) installed on the target machine. -> **_NOTE:_** This [cleardown script script](bin/cleardown.sh) clears everything down by deleting the `management` and `edge1` Kind clusters. USE WITH CARE. +> **_NOTE:_** This [cleardown script script](bin/cleardown.sh) clears everything down by deleting the `management` Kind cluster. USE WITH CARE. Switch to use the kind-management context if necessary: ``` @@ -492,7 +492,6 @@ porchctl repo get -A Sample output: ``` NAME TYPE CONTENT DEPLOYMENT READY ADDRESS -edge1 git Package true True http://172.18.255.200:3000/nephio/edge1.git external-blueprints git Package false True https://github.com/nephio-project/free5gc-packages.git management git Package false True http://172.18.255.200:3000/nephio/management.git ``` @@ -506,7 +505,6 @@ kubectl get repositories -n porch-demo Sample output: ``` NAME TYPE CONTENT DEPLOYMENT READY ADDRESS -edge1 git Package true True http://172.18.255.200:3000/nephio/edge1.git external-blueprints git Package false True https://github.com/nephio-project/free5gc-packages.git management git Package false True http://172.18.255.200:3000/nephio/management.git ``` diff --git a/examples/apps/hello-server/Dockerfile b/examples/apps/hello-server/Dockerfile index 84111e13..07ec06e7 100644 --- a/examples/apps/hello-server/Dockerfile +++ b/examples/apps/hello-server/Dockerfile @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM golang:1.21.4-bookworm as builder +FROM golang:1.22.2-bookworm as builder WORKDIR /src COPY go.mod go.sum ./ diff --git a/examples/apps/hello-server/go.mod b/examples/apps/hello-server/go.mod index c92d847a..f8409a31 100644 --- a/examples/apps/hello-server/go.mod +++ b/examples/apps/hello-server/go.mod @@ -1,3 +1,3 @@ module github.com/nephio-project/porch/config/samples/apps/hello -go 1.21 +go 1.22 diff --git a/go.mod b/go.mod index 8edc0e23..2f4c390c 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/nephio-project/porch -go 1.21 +go 1.22 replace ( github.com/go-git/go-git/v5 v5.4.3-0.20220408232334-4f916225cb2f => github.com/platkrm/go-git/v5 v5.4.3-0.20220410165046-c76b262044ce diff --git a/test/Dockerfile b/test/Dockerfile index 7a08cf93..f0a0dcc3 100644 --- a/test/Dockerfile +++ b/test/Dockerfile @@ -13,7 +13,7 @@ # limitations under the License. -FROM golang:1.21.4-bookworm as builder +FROM golang:1.22.2-bookworm as builder WORKDIR /go/src