Skip to content

Commit

Permalink
Merge pull request #369 from mauriciopoppe/revert-go-1-23
Browse files Browse the repository at this point in the history
Revert "Add min go runtime to be 1.23 and add  godebug winsymlink=0"
  • Loading branch information
k8s-ci-robot authored Feb 23, 2025
2 parents 154e6db + 058c869 commit 0c80fc0
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ jobs:
- uses: codespell-project/actions-codespell@master
with:
check_filenames: true
skip: ./.git,./.github/workflows/codespell.yml,.git,*.png,*.jpg,*.svg,*.sum,./vendor,go.sum,./release-tools/prow.sh
skip: ./.git,./.github/workflows/codespell.yml,.git,*.png,*.jpg,*.svg,*.sum,./vendor,go.sum,./release-tools/prow.sh,./docs
6 changes: 3 additions & 3 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ jobs:
integration_tests:
strategy:
matrix:
go: ['1.23']
go: ['1.22']
platform: [windows-latest]
runs-on: ${{ matrix.platform }}
steps:
Expand Down Expand Up @@ -51,7 +51,7 @@ jobs:
unit_tests:
strategy:
matrix:
go: ['1.23']
go: ['1.22']
platform: [windows-latest]
runs-on: ${{ matrix.platform }}
steps:
Expand All @@ -69,7 +69,7 @@ jobs:
bump_version_test:
strategy:
matrix:
go: ['1.23']
go: ['1.22']
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}
steps:
Expand Down
22 changes: 22 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,28 @@ BUILD_TOOLS_DIR = $(BUILD_DIR)/tools
GO_ENV_VARS = GO111MODULE=on GOOS=windows
CSI_PROXY_API_GEN = $(BUILD_DIR)/csi-proxy-api-gen

# overrides the $(CMDS:%=build-%) rule in release-tools/build.make because this project is not compatible with go >1.23
# TODO: remove this override as part of https://github.com/kubernetes-csi/csi-proxy/issues/361
build-csi-proxy: check-go-version-go
# Checks that the go version is 1.22 or lower
if (( "$$(go version | awk '{print $3}' | sed 's/go//' | cut -d'.' -f2)" > 22 )); then echo "This project requires go 1.22 or lower"; exit 1; fi;
mkdir -p bin
# os_arch_seen captures all of the $$os-$$arch-$$buildx_platform seen for the current binary
# that we want to build, if we've seen an $$os-$$arch-$$buildx_platform before it means that
# we don't need to build it again, this is done to avoid building
# the windows binary multiple times (see the default value of $$BUILD_PLATFORMS)
export os_arch_seen="" && echo '$(BUILD_PLATFORMS)' | tr ';' '\n' | while read -r os arch buildx_platform suffix base_image addon_image; do \
os_arch_seen_pre=$${os_arch_seen%%$$os-$$arch-$$buildx_platform*}; \
if ! [ $${#os_arch_seen_pre} = $${#os_arch_seen} ]; then \
continue; \
fi; \
if ! (set -x; cd ./$(CMDS_DIR)/$* && CGO_ENABLED=0 GOOS="$$os" GOARCH="$$arch" go build $(GOFLAGS_VENDOR) -a -ldflags '$(FULL_LDFLAGS)' -o "$(abspath ./bin)/$*$$suffix" .); then \
echo "Building $* for GOOS=$$os GOARCH=$$arch failed, see error(s) above."; \
exit 1; \
fi; \
os_arch_seen+=";$$os-$$arch-$$buildx_platform"; \
done

.PHONY: compile-csi-proxy-api-gen
compile-csi-proxy-api-gen:
GO111MODULE=on go build -o $(CSI_PROXY_API_GEN) ./cmd/csi-proxy-api-gen
Expand Down
7 changes: 5 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
module github.com/kubernetes-csi/csi-proxy

go 1.23
// NOTE: This project must be built with go < 1.23
// `make build` will error if go1.23 or higher is used.

godebug winsymlink=0
go 1.22.0

toolchain go1.22.3

require (
github.com/Microsoft/go-winio v0.6.2
Expand Down
4 changes: 4 additions & 0 deletions scripts/run-integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ pkgdir=${GOPATH}/src/github.com/kubernetes-csi/csi-proxy
source $pkgdir/scripts/utils.sh

main() {
# TODO: remove go version pin as part of https://github.com/kubernetes-csi/csi-proxy/issues/361
wget -q https://go.dev/dl/go1.22.12.linux-amd64.tar.gz
rm -rf /usr/local/go && tar -C /usr/local -xzf go1.22.12.linux-amd64.tar.gz

compile_csi_proxy
compile_csi_proxy_integration_tests
sync_csi_proxy
Expand Down

0 comments on commit 0c80fc0

Please sign in to comment.