Skip to content

Revert "Add min go runtime to be 1.23 and add godebug winsymlink=0" #369

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 23, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -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
@@ -4,7 +4,7 @@ jobs:
integration_tests:
strategy:
matrix:
go: ['1.23']
go: ['1.22']
platform: [windows-latest]
runs-on: ${{ matrix.platform }}
steps:
@@ -51,7 +51,7 @@ jobs:
unit_tests:
strategy:
matrix:
go: ['1.23']
go: ['1.22']
platform: [windows-latest]
runs-on: ${{ matrix.platform }}
steps:
@@ -69,7 +69,7 @@ jobs:
bump_version_test:
strategy:
matrix:
go: ['1.23']
go: ['1.22']
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}
steps:
22 changes: 22 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
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
4 changes: 4 additions & 0 deletions scripts/run-integration.sh
Original file line number Diff line number Diff line change
@@ -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