Skip to content
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

Upgrade controller-tools to 0.14.0 and fix formatting #181

Merged
merged 2 commits into from
Jun 3, 2024

Conversation

lisguo
Copy link
Contributor

@lisguo lisguo commented May 31, 2024

Issue #, if available:
Running make generate causes a nil pointer exception on a machine with go 1.22:

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=0x90e382f]

goroutine 22 [running]:
go/types.(*Checker).handleBailout(0xc00084c600, 0xc000f7bd40)
	/usr/local/Cellar/go/1.22.1/libexec/src/go/types/check.go:367 +0x88
panic({0x93db560?, 0x9990eb0?})
	/usr/local/Cellar/go/1.22.1/libexec/src/runtime/panic.go:770 +0x132
go/types.(*StdSizes).Sizeof(0x0, {0x94a6270, 0x9999600})
	/usr/local/Cellar/go/1.22.1/libexec/src/go/types/sizes.go:228 +0x30f
go/types.(*Config).sizeof(...)
	/usr/local/Cellar/go/1.22.1/libexec/src/go/types/sizes.go:333
go/types.representableConst.func1({0x94a6270?, 0x9999600?})
	/usr/local/Cellar/go/1.22.1/libexec/src/go/types/const.go:76 +0x9e
go/types.representableConst({0x94ac4d0, 0x99657a0}, 0xc00084c600, 0x9999600, 0x0)
	/usr/local/Cellar/go/1.22.1/libexec/src/go/types/const.go:92 +0x192
go/types.(*Checker).arrayLength(0xc00084c600, {0x94aa880, 0xc000a50da0?})
	/usr/local/Cellar/go/1.22.1/libexec/src/go/types/typexpr.go:510 +0x2d3
go/types.(*Checker).typInternal(0xc00084c600, {0x94a8ea0, 0xc000a56840}, 0x0)
	/usr/local/Cellar/go/1.22.1/libexec/src/go/types/typexpr.go:299 +0x49d
go/types.(*Checker).definedType(0xc00084c600, {0x94a8ea0, 0xc000a56840}, 0xc000f7b328?)
	/usr/local/Cellar/go/1.22.1/libexec/src/go/types/typexpr.go:180 +0x37
go/types.(*Checker).varType(0xc00084c600, {0x94a8ea0, 0xc000a56840})
	/usr/local/Cellar/go/1.22.1/libexec/src/go/types/typexpr.go:145 +0x25
go/types.(*Checker).structType(0xc00084c600, 0xc0011cbdd0, 0xc0011cbdd0?)
	/usr/local/Cellar/go/1.22.1/libexec/src/go/types/struct.go:113 +0x19f
go/types.(*Checker).typInternal(0xc00084c600, {0x94a8e10, 0xc000a7a2d0}, 0xc00112d2c0)
	/usr/local/Cellar/go/1.22.1/libexec/src/go/types/typexpr.go:316 +0x1345
go/types.(*Checker).definedType(0xc00084c600, {0x94a8e10, 0xc000a7a2d0}, 0x9216adc?)
	/usr/local/Cellar/go/1.22.1/libexec/src/go/types/typexpr.go:180 +0x37
go/types.(*Checker).typeDecl(0xc00084c600, 0xc00112d2c0, 0xc000a41580, 0x0)
	/usr/local/Cellar/go/1.22.1/libexec/src/go/types/decl.go:615 +0x44d
go/types.(*Checker).objDecl(0xc00084c600, {0x94b1440, 0xc00112d2c0}, 0x0)
	/usr/local/Cellar/go/1.22.1/libexec/src/go/types/decl.go:197 +0xa7f
go/types.(*Checker).packageObjects(0xc00084c600)
	/usr/local/Cellar/go/1.22.1/libexec/src/go/types/resolver.go:681 +0x425
go/types.(*Checker).checkFiles(0xc00084c600, {0xc000f5bf68, 0x3, 0x3})
	/usr/local/Cellar/go/1.22.1/libexec/src/go/types/check.go:408 +0x1a5
go/types.(*Checker).Files(...)
	/usr/local/Cellar/go/1.22.1/libexec/src/go/types/check.go:372
sigs.k8s.io/controller-tools/pkg/loader.(*loader).typeCheck(0xc0002853b0, 0xc000ddc7e0)
	/Users/lisaguo/go/pkg/mod/sigs.k8s.io/controller-tools@v0.12.0/pkg/loader/loader.go:286 +0x36a
sigs.k8s.io/controller-tools/pkg/loader.(*Package).NeedTypesInfo(0xc000ddc7e0)
	/Users/lisaguo/go/pkg/mod/sigs.k8s.io/controller-tools@v0.12.0/pkg/loader/loader.go:99 +0x39
sigs.k8s.io/controller-tools/pkg/loader.(*TypeChecker).check(0xc0009bc7e0, 0xc000ddc7e0)
	/Users/lisaguo/go/pkg/mod/sigs.k8s.io/controller-tools@v0.12.0/pkg/loader/refs.go:268 +0x2b7
sigs.k8s.io/controller-tools/pkg/loader.(*TypeChecker).check.func1(0x33?)
	/Users/lisaguo/go/pkg/mod/sigs.k8s.io/controller-tools@v0.12.0/pkg/loader/refs.go:262 +0x53
created by sigs.k8s.io/controller-tools/pkg/loader.(*TypeChecker).check in goroutine 77
	/Users/lisaguo/go/pkg/mod/sigs.k8s.io/controller-tools@v0.12.0/pkg/loader/refs.go:260 +0x1c5
make: *** [generate] Error 2

Related github issue: kubernetes-sigs/controller-tools#888

After upgrading controller-tools to 0.14.0 the problem goes away.

Description of changes:
Upgraded 0.14.0 and ran make test. This fixes formatting and updates the api docs.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@lisguo lisguo changed the title Upgrade controller-tools to 1.14.0 and fix formatting Upgrade controller-tools to 0.14.0 and fix formatting May 31, 2024
@@ -50,7 +50,7 @@ CHLOGGEN ?= $(LOCALBIN)/chloggen
ADDLICENSE ?= $(LOCALBIN)/addlicense

KUSTOMIZE_VERSION ?= v5.0.3
CONTROLLER_TOOLS_VERSION ?= v0.12.0
CONTROLLER_TOOLS_VERSION ?= v0.14.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not use the latest version v0.15.0 instead?

Copy link
Contributor Author

@lisguo lisguo May 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just saw in the github issue that 0.14.0 fixed it. Upstream is using 0.14.0 as well: https://github.com/open-telemetry/opentelemetry-operator/blob/main/Makefile#L393

@lisguo lisguo merged commit 52179e4 into aws:main Jun 3, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants