Comments (3)
I get the same error when running make generate
from operator-sdk.
I've tracked it down to this command:
[gallen@gallen-thinkpadp1gen5 memcached-operator]$ /home/gallen/work/tutorial/memcached-operator/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=0x1 addr=0x0 pc=0xa0a20f]
goroutine 209 [running]:
go/types.(*Checker).handleBailout(0xc001902800, 0xc000a35d40)
/usr/local/go/src/go/types/check.go:367 +0x88
panic({0xbc29e0?, 0x12a94e0?})
/usr/local/go/src/runtime/panic.go:770 +0x132
go/types.(*StdSizes).Sizeof(0x0, {0xdbd6b8, 0x12b1ce0})
/usr/local/go/src/go/types/sizes.go:228 +0x30f
go/types.(*Config).sizeof(...)
/usr/local/go/src/go/types/sizes.go:333
go/types.representableConst.func1({0xdbd6b8?, 0x12b1ce0?})
/usr/local/go/src/go/types/const.go:76 +0x9e
go/types.representableConst({0xdc3a10, 0x127cc60}, 0xc001902800, 0x12b1ce0, 0x0)
/usr/local/go/src/go/types/const.go:92 +0x192
go/types.(*Checker).arrayLength(0xc001902800, {0xdc1cb8, 0xc000d71160?})
/usr/local/go/src/go/types/typexpr.go:510 +0x2d3
go/types.(*Checker).typInternal(0xc001902800, {0xdc02d8, 0xc0019101e0}, 0x0)
/usr/local/go/src/go/types/typexpr.go:299 +0x49d
go/types.(*Checker).definedType(0xc001902800, {0xdc02d8, 0xc0019101e0}, 0x10?)
/usr/local/go/src/go/types/typexpr.go:180 +0x37
go/types.(*Checker).varType(0xc001902800, {0xdc02d8, 0xc0019101e0})
/usr/local/go/src/go/types/typexpr.go:145 +0x25
go/types.(*Checker).structType(0xc001902800, 0xc00191d860, 0xc00191d860?)
/usr/local/go/src/go/types/struct.go:113 +0x19f
go/types.(*Checker).typInternal(0xc001902800, {0xdc0248, 0xc0019005d0}, 0xc001921cc0)
/usr/local/go/src/go/types/typexpr.go:316 +0x1345
go/types.(*Checker).definedType(0xc001902800, {0xdc0248, 0xc0019005d0}, 0xc8bf2e?)
/usr/local/go/src/go/types/typexpr.go:180 +0x37
go/types.(*Checker).typeDecl(0xc001902800, 0xc001921cc0, 0xc000d6d640, 0x0)
/usr/local/go/src/go/types/decl.go:615 +0x44d
go/types.(*Checker).objDecl(0xc001902800, {0xdc8f60, 0xc001921cc0}, 0x0)
/usr/local/go/src/go/types/decl.go:197 +0xa7f
go/types.(*Checker).packageObjects(0xc001902800)
/usr/local/go/src/go/types/resolver.go:681 +0x425
go/types.(*Checker).checkFiles(0xc001902800, {0xc000ab1458, 0x3, 0x3})
/usr/local/go/src/go/types/check.go:408 +0x1a5
go/types.(*Checker).Files(...)
/usr/local/go/src/go/types/check.go:372
sigs.k8s.io/controller-tools/pkg/loader.(*loader).typeCheck(0xc0002a7380, 0xc0008ea3c0)
/home/gallen/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/loader/loader.go:286 +0x36a
sigs.k8s.io/controller-tools/pkg/loader.(*Package).NeedTypesInfo(0xc0008ea3c0)
/home/gallen/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/loader/loader.go:99 +0x39
sigs.k8s.io/controller-tools/pkg/loader.(*TypeChecker).check(0xc00024c6f0, 0xc0008ea3c0)
/home/gallen/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/loader/refs.go:268 +0x2b7
sigs.k8s.io/controller-tools/pkg/loader.(*TypeChecker).check.func1(0x49?)
/home/gallen/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/loader/refs.go:262 +0x53
created by sigs.k8s.io/controller-tools/pkg/loader.(*TypeChecker).check in goroutine 145
/home/gallen/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/loader/refs.go:260 +0x1c5
[gallen@gallen-thinkpadp1gen5 memcached-operator]$
from operator-sdk.
OK, I made the incorrect assumption the go version wasn't that important. And a later go version would probably work just fine.
I was using go 1.22, when the instructions clearly say to use go 1.21.
Thanks to @joelanford for pointing this out. Once I downgraded to 1.21 the command works.
from operator-sdk.
Related Issues (20)
- Update golang Operator docs for "Advanced Topics - Leader Election - Leader-with-lease"
- Go Operator Tutorial Page: Incorrect Link(s) and some file path corrections HOT 2
- Bundle generation issues warnings for APIs removed in k8s 1.25 but their v2 is still available
- Default labels do not comply with recommendation
- operator sdk 1.34 broken with ansible
- Helm-based operator does not reconcile operand with base image v1.34.0 HOT 3
- Release name must not be longer than 53 HOT 1
- Struct Type String Value Empty on Reconciliation HOT 1
- SyncPeriod for controllers HOT 1
- MultiNamespacedCacheBuilder is deprecated and can't be used to define the operator scope HOT 1
- Unable to (re)generate `roles.yaml` using RBAC markers HOT 4
- Operator SDK installs resources in the same namespace as the operator instead of the CRD namespace. HOT 1
- Create API/make generate controller-gen panics with a SIGSEGV HOT 3
- Support for Go version 1.21 HOT 5
- Docs website not updating HOT 1
- Meta Issue for k8s 1.30 bump HOT 1
- Operator-SDK version 1.34.1 removed RBAC privs that previous versions were correctly generating from Helm HOT 2
- Designing Lean Operators, example code is longer valid after `sigs.k8s.io/[email protected]` HOT 1
- A potential risk in operator-sdk that could lead to takeover of the cluster HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from operator-sdk.