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

Quickstart instructions leads runtime panic #6777

Closed
Dentrax opened this issue Jun 27, 2024 · 1 comment
Closed

Quickstart instructions leads runtime panic #6777

Dentrax opened this issue Jun 27, 2024 · 1 comment
Labels
language/go Issue is related to a Go operator project triage/duplicate Indicates an issue is a duplicate of other open issue.

Comments

@Dentrax
Copy link

Dentrax commented Jun 27, 2024

Bug Report

What did you do?

$ operator-sdk init --domain foo --repo bar --plugins=go/v4
$ operator-sdk create api --group baz --version v1alpha1 --kind Qux --resource=true --controller=true --namespaced=true

What did you expect to see?

It should succeeded?

What did you see instead? Under which circumstances?

INFO[0000] Writing kustomize manifests for you to edit...
INFO[0000] Writing scaffold for you to edit...
INFO[0000] api/v1alpha1/qux_types.go
INFO[0000] api/v1alpha1/groupversion_info.go
INFO[0000] internal/controller/suite_test.go
INFO[0000] internal/controller/qux_controller.go
INFO[0000] internal/controller/qux_controller_test.go
INFO[0000] Update dependencies:
$ go mod tidy
INFO[0000] Running make:
$ make generate
mkdir -p /Users/furkan/foo/bin
test -s /Users/furkan/foo/bin/controller-gen && /Users/furkan/foo/bin/controller-gen --version | grep -q v0.13.0 || \
	GOBIN=/Users/furkan/foo/bin go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.13.0
/Users/furkan/foo/bin/controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
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=0x2 addr=0x0 pc=0x104ad4f64]

goroutine 146 [running]:
go/types.(*Checker).handleBailout(0x14000c67400, 0x14000f2dd18)
	/opt/homebrew/Cellar/go/1.22.4/libexec/src/go/types/check.go:367 +0x9c
panic({0x104dada60?, 0x105348af0?})
	/opt/homebrew/Cellar/go/1.22.4/libexec/src/runtime/panic.go:770 +0x124
go/types.(*StdSizes).Sizeof(0x0, {0x104e78990, 0x105351300})
	/opt/homebrew/Cellar/go/1.22.4/libexec/src/go/types/sizes.go:228 +0x314
go/types.(*Config).sizeof(...)
	/opt/homebrew/Cellar/go/1.22.4/libexec/src/go/types/sizes.go:333
go/types.representableConst.func1({0x104e78990?, 0x105351300?})
	/opt/homebrew/Cellar/go/1.22.4/libexec/src/go/types/const.go:76 +0x9c
go/types.representableConst({0x104e7ec30, 0x10531c240}, 0x14000c67400, 0x105351300, 0x0)
	/opt/homebrew/Cellar/go/1.22.4/libexec/src/go/types/const.go:92 +0x138
go/types.(*Checker).arrayLength(0x14000c67400, {0x104e7cf78, 0x140014bb0a0?})
	/opt/homebrew/Cellar/go/1.22.4/libexec/src/go/types/typexpr.go:510 +0x238
go/types.(*Checker).typInternal(0x14000c67400, {0x104e7b598, 0x140014cc390}, 0x0)
	/opt/homebrew/Cellar/go/1.22.4/libexec/src/go/types/typexpr.go:299 +0x3bc
go/types.(*Checker).definedType(0x14000c67400, {0x104e7b598, 0x140014cc390}, 0x10454ca5c?)
	/opt/homebrew/Cellar/go/1.22.4/libexec/src/go/types/typexpr.go:180 +0x2c
go/types.(*Checker).varType(0x14000c67400, {0x104e7b598, 0x140014cc390})
	/opt/homebrew/Cellar/go/1.22.4/libexec/src/go/types/typexpr.go:145 +0x2c
go/types.(*Checker).structType(0x14000c67400, 0x140014d5a10, 0x140014d5a10?)
	/opt/homebrew/Cellar/go/1.22.4/libexec/src/go/types/struct.go:113 +0x128
go/types.(*Checker).typInternal(0x14000c67400, {0x104e7b508, 0x140014ca360}, 0x140014da5f0)
	/opt/homebrew/Cellar/go/1.22.4/libexec/src/go/types/typexpr.go:316 +0xed0
go/types.(*Checker).definedType(0x14000c67400, {0x104e7b508, 0x140014ca360}, 0x104be8f81?)
	/opt/homebrew/Cellar/go/1.22.4/libexec/src/go/types/typexpr.go:180 +0x2c
go/types.(*Checker).typeDecl(0x14000c67400, 0x140014da5f0, 0x140014beac0, 0x0)
	/opt/homebrew/Cellar/go/1.22.4/libexec/src/go/types/decl.go:615 +0x39c
go/types.(*Checker).objDecl(0x14000c67400, {0x104e83b40, 0x140014da5f0}, 0x0)
	/opt/homebrew/Cellar/go/1.22.4/libexec/src/go/types/decl.go:197 +0x880
go/types.(*Checker).packageObjects(0x14000c67400)
	/opt/homebrew/Cellar/go/1.22.4/libexec/src/go/types/resolver.go:681 +0x3c0
go/types.(*Checker).checkFiles(0x14000c67400, {0x14001046ac8, 0x3, 0x3})
	/opt/homebrew/Cellar/go/1.22.4/libexec/src/go/types/check.go:408 +0x164
go/types.(*Checker).Files(...)
	/opt/homebrew/Cellar/go/1.22.4/libexec/src/go/types/check.go:372
sigs.k8s.io/controller-tools/pkg/loader.(*loader).typeCheck(0x140002eb3b0, 0x1400035c240)
	/Users/furkan/go/pkg/mod/sigs.k8s.io/controller-tools@v0.13.0/pkg/loader/loader.go:286 +0x2d8
sigs.k8s.io/controller-tools/pkg/loader.(*Package).NeedTypesInfo(0x1400035c240)
	/Users/furkan/go/pkg/mod/sigs.k8s.io/controller-tools@v0.13.0/pkg/loader/loader.go:99 +0x44
sigs.k8s.io/controller-tools/pkg/loader.(*TypeChecker).check(0x14000930b70, 0x1400035c240)
	/Users/furkan/go/pkg/mod/sigs.k8s.io/controller-tools@v0.13.0/pkg/loader/refs.go:268 +0x304
sigs.k8s.io/controller-tools/pkg/loader.(*TypeChecker).check.func1(0x4c?)
	/Users/furkan/go/pkg/mod/sigs.k8s.io/controller-tools@v0.13.0/pkg/loader/refs.go:262 +0x58
created by sigs.k8s.io/controller-tools/pkg/loader.(*TypeChecker).check in goroutine 90
	/Users/furkan/go/pkg/mod/sigs.k8s.io/controller-tools@v0.13.0/pkg/loader/refs.go:260 +0x230
make: *** [generate] Error 2
Error: failed to create API: unable to run post-scaffold tasks of "base.go.kubebuilder.io/v4": exit status 2

Environment

Operator type:

/language go

Kubernetes cluster type:

$ operator-sdk version

operator-sdk version: "v1.35.0", commit: "e95abdbd5ccb7ca0fd586e0c6f578e491b0a025b", kubernetes version: "v1.28.0", go version: "go1.21.11", GOOS: "darwin", GOARCH: "arm64"

$ go version (if language is Go)

go version go1.22.4 darwin/arm64

$ kubectl version

Client Version: v1.30.2
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.26.6

Possible Solution

-

Additional context

-

@openshift-ci openshift-ci bot added the language/go Issue is related to a Go operator project label Jun 27, 2024
@acornett21 acornett21 added the triage/duplicate Indicates an issue is a duplicate of other open issue. label Jun 27, 2024
@acornett21
Copy link
Contributor

operator-sdk does not support go1.22 at this time, since a dependency used does not support it, please downgrade to 1.21, Or update the version of controller tools in the makefile before creating an api.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
language/go Issue is related to a Go operator project triage/duplicate Indicates an issue is a duplicate of other open issue.
Projects
None yet
Development

No branches or pull requests

2 participants