Skip to content

Commit

Permalink
Set go version to 1.21.7 (#7179)
Browse files Browse the repository at this point in the history
# Description

Set go version to 1.21.7 because controller-gen throws nil error with go
1.22

```
=> Generating CRDs for ucp.dev...
controller-gen object paths=./pkg/ucp/store/apiserverstore/api/ucp.dev/v1alpha1/... object:headerFile=./boilerplate.go.txt
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xa0117e]

goroutine 81 [running]:
go/types.(*Checker).handleBailout(0xc0002e6600, 0xc000459d40)
	/opt/hostedtoolcache/go/1.22.0/x64/src/go/types/check.go:367 +0x88
panic({0xbb2600?, 0x128ed00?})
	/opt/hostedtoolcache/go/1.22.0/x64/src/runtime/panic.go:770 +0x132
go/types.(*StdSizes).Sizeof(0x0, {0xda56d8, 0x1297540})
	/opt/hostedtoolcache/go/1.22.0/x64/src/go/types/sizes.go:228 +0x31e
go/types.(*Config).sizeof(...)
	/opt/hostedtoolcache/go/1.22.0/x64/src/go/types/sizes.go:333
go/types.representableConst.func1({0xda56d8?, 0x1297540?})
	/opt/hostedtoolcache/go/1.22.0/x64/src/go/types/const.go:76 +0x9e
go/types.representableConst({0xdab9f8, 0x12635a0}, 0xc0002e6600, 0x1297540, 0x0)
	/opt/hostedtoolcache/go/1.22.0/x64/src/go/types/const.go:92 +0x192
go/types.(*Checker).arrayLength(0xc0002e6600, {0xda9d08, 0xc00093cbc0?})
	/opt/hostedtoolcache/go/1.22.0/x64/src/go/types/typexpr.go:510 +0x2d3
go/types.(*Checker).typInternal(0xc0002e6600, {0xda8358, 0xc000936f60}, 0x0)
	/opt/hostedtoolcache/go/1.22.0/x64/src/go/types/typexpr.go:299 +0x49d
go/types.(*Checker).definedType(0xc0002e6600, {0xda8358, 0xc000936f60}, 0xc000459328?)
	/opt/hostedtoolcache/go/1.22.0/x64/src/go/types/typexpr.go:180 +0x37
go/types.(*Checker).varType(0xc0002e6600, {0xda8358, 0xc000936f60})
	/opt/hostedtoolcache/go/1.22.0/x64/src/go/types/typexpr.go:145 +0x25
go/types.(*Checker).structType(0xc0002e6600, 0xc00095e660, 0xc00095e660?)
	/opt/hostedtoolcache/go/1.22.0/x64/src/go/types/struct.go:113 +0x19f
go/types.(*Checker).typInternal(0xc0002e6600, {0xda82c8, 0xc000935728}, 0xc00095b590)
	/opt/hostedtoolcache/go/1.22.0/x64/src/go/types/typexpr.go:316 +0x1345
go/types.(*Checker).definedType(0xc0002e6600, {0xda82c8, 0xc000935728}, 0xc7a5e2?)
	/opt/hostedtoolcache/go/1.22.0/x64/src/go/types/typexpr.go:180 +0x37
go/types.(*Checker).typeDecl(0xc0002e6600, 0xc00095b590, 0xc0009389c0, 0x0)
	/opt/hostedtoolcache/go/1.22.0/x64/src/go/types/decl.go:615 +0x44d
go/types.(*Checker).objDecl(0xc0002e6600, {0xdb0e58, 0xc00095b590}, 0x0)
	/opt/hostedtoolcache/go/1.22.0/x64/src/go/types/decl.go:197 +0xa7f
go/types.(*Checker).packageObjects(0xc0002e6600)
	/opt/hostedtoolcache/go/1.22.0/x64/src/go/types/resolver.go:681 +0x425
go/types.(*Checker).checkFiles(0xc0002e6600, {0xc000580ed0, 0x3, 0x3})
	/opt/hostedtoolcache/go/1.22.0/x64/src/go/types/check.go:408 +0x1a5
go/types.(*Checker).Files(...)
	/opt/hostedtoolcache/go/1.22.0/x64/src/go/types/check.go:372
sigs.k8s.io/controller-tools/pkg/loader.(*loader).typeCheck(0xc0003eb080, 0xc0004[2008](https://github.com/radius-project/radius/actions/runs/7924253811/job/21635483458?pr=7179#step:13:2009)0)
	/home/runner/go/pkg/mod/sigs.k8s.io/controller-tools@v0.9.1/pkg/loader/loader.go:286 +0x36a
sigs.k8s.io/controller-tools/pkg/loader.(*Package).NeedTypesInfo(0xc000420080)
	/home/runner/go/pkg/mod/sigs.k8s.io/controller-tools@v0.9.1/pkg/loader/loader.go:99 +0x39
sigs.k8s.io/controller-tools/pkg/loader.(*TypeChecker).check(0xc0003b60c0, 0xc000420080)
	/home/runner/go/pkg/mod/sigs.k8s.io/controller-tools@v0.9.1/pkg/loader/refs.go:268 +0x2b7
sigs.k8s.io/controller-tools/pkg/loader.(*TypeChecker).check.func1(0x51?)
	/home/runner/go/pkg/mod/sigs.k8s.io/controller-tools@v0.9.1/pkg/loader/refs.go:262 +0x53
created by sigs.k8s.io/controller-tools/pkg/loader.(*TypeChecker).check in goroutine 9
	/home/runner/go/pkg/mod/sigs.k8s.io/controller-tools@v0.9.1/pkg/loader/refs.go:260 +0x1c5
make: *** [build/generate.mk:65: generate-ucp-crd] Error 2
Error: Process completed with exit code 2.
```

## Type of change

- This pull request is a minor refactor, code cleanup, test improvement,
or other maintenance task and doesn't change the functionality of Radius
(issue link optional).

<!--

Please update the following to link the associated issue. This is
required for some kinds of changes (see above).

-->

Fixes: #issue_number

Signed-off-by: Young Bu Park <youngp@microsoft.com>
youngbupark authored Feb 16, 2024
1 parent 647c0c7 commit c52aa00
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -35,7 +35,7 @@ concurrency:

env:
# Go version to install
GOVER: '^1.21'
GOVER: '1.21.7'

# gotestsum version - see: https://github.com/gotestyourself/gotestsum
GOTESTSUMVERSION: 1.10.0
2 changes: 1 addition & 1 deletion .github/workflows/functional-test.yaml
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@ on:

env:
# Go version
GOVER: '^1.21'
GOVER: '1.21.7'
GOPROXY: https://proxy.golang.org

# gotestsum version - see: https://github.com/gotestyourself/gotestsum
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 30
env:
GOVER: '^1.21'
GOVER: '1.21.7'
GOPROXY: https://proxy.golang.org
HELM_CHARTS_DIR: deploy/Chart
steps:
2 changes: 1 addition & 1 deletion .github/workflows/long-running-azure.yaml
Original file line number Diff line number Diff line change
@@ -49,7 +49,7 @@ on:

env:
# Go version
GOVER: "^1.21"
GOVER: "1.21.7"
GOPROXY: https://proxy.golang.org

# gotestsum version - see: https://github.com/gotestyourself/gotestsum
2 changes: 1 addition & 1 deletion .github/workflows/publish-docs.yaml
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ jobs:
runs-on: ubuntu-latest
if: github.repository == 'radius-project/radius'
env:
GOVER: '^1.21'
GOVER: '1.21.7'
GOPRIVATE: github.com/radius-project
steps:
- name: Checkout radius repository

0 comments on commit c52aa00

Please sign in to comment.