openstack-k8s-operators / openstack-operator

Meta Operator for OpenStack
https://openstack-k8s-operators.github.io/openstack-operator/
Apache License 2.0
25 stars 72 forks source link

unable to install CRD #697

Open CooperTrooper21 opened 4 months ago

CooperTrooper21 commented 4 months ago

Hi team,

I am trying to install this operator into my cluster running make install but I am getting the following error:

/Users/reece.cooper/Documents/projects/github/openstack-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=0xfeecb7e]

goroutine 618 [running]:
go/types.(*Checker).handleBailout(0xc00281d000, 0xc0027f5d40)
    /usr/local/Cellar/go/1.22.0/libexec/src/go/types/check.go:367 +0x88
panic({0x101e2560?, 0x10798e30?})
    /usr/local/Cellar/go/1.22.0/libexec/src/runtime/panic.go:770 +0x132
go/types.(*StdSizes).Sizeof(0x0, {0x102ace30, 0x107a1560})
    /usr/local/Cellar/go/1.22.0/libexec/src/go/types/sizes.go:228 +0x31e
go/types.(*Config).sizeof(...)
    /usr/local/Cellar/go/1.22.0/libexec/src/go/types/sizes.go:333
go/types.representableConst.func1({0x102ace30?, 0x107a1560?})
    /usr/local/Cellar/go/1.22.0/libexec/src/go/types/const.go:76 +0x9e
go/types.representableConst({0x102b3070, 0x1076d760}, 0xc00281d000, 0x107a1560, 0x0)
    /usr/local/Cellar/go/1.22.0/libexec/src/go/types/const.go:92 +0x192
go/types.(*Checker).arrayLength(0xc00281d000, {0x102b1440, 0xc002cef500?})
    /usr/local/Cellar/go/1.22.0/libexec/src/go/types/typexpr.go:510 +0x2d3
go/types.(*Checker).typInternal(0xc00281d000, {0x102afa60, 0xc002cf16b0}, 0x0)
    /usr/local/Cellar/go/1.22.0/libexec/src/go/types/typexpr.go:299 +0x49d
go/types.(*Checker).definedType(0xc00281d000, {0x102afa60, 0xc002cf16b0}, 0xc0027f5328?)
    /usr/local/Cellar/go/1.22.0/libexec/src/go/types/typexpr.go:180 +0x37
go/types.(*Checker).varType(0xc00281d000, {0x102afa60, 0xc002cf16b0})
    /usr/local/Cellar/go/1.22.0/libexec/src/go/types/typexpr.go:145 +0x25
go/types.(*Checker).structType(0xc00281d000, 0xc003408f90, 0xc003408f90?)
    /usr/local/Cellar/go/1.22.0/libexec/src/go/types/struct.go:113 +0x19f
go/types.(*Checker).typInternal(0xc00281d000, {0x102af9d0, 0xc002ce7d58}, 0xc003407220)
    /usr/local/Cellar/go/1.22.0/libexec/src/go/types/typexpr.go:316 +0x1345
go/types.(*Checker).definedType(0xc00281d000, {0x102af9d0, 0xc002ce7d58}, 0x100203e6?)
    /usr/local/Cellar/go/1.22.0/libexec/src/go/types/typexpr.go:180 +0x37
go/types.(*Checker).typeDecl(0xc00281d000, 0xc003407220, 0xc002cfe900, 0x0)
    /usr/local/Cellar/go/1.22.0/libexec/src/go/types/decl.go:615 +0x44d
go/types.(*Checker).objDecl(0xc00281d000, {0x102b7f18, 0xc003407220}, 0x0)
    /usr/local/Cellar/go/1.22.0/libexec/src/go/types/decl.go:197 +0xa7f
go/types.(*Checker).packageObjects(0xc00281d000)
    /usr/local/Cellar/go/1.22.0/libexec/src/go/types/resolver.go:681 +0x425
go/types.(*Checker).checkFiles(0xc00281d000, {0xc002c7e108, 0x3, 0x3})
    /usr/local/Cellar/go/1.22.0/libexec/src/go/types/check.go:408 +0x1a5
go/types.(*Checker).Files(...)
    /usr/local/Cellar/go/1.22.0/libexec/src/go/types/check.go:372
sigs.k8s.io/controller-tools/pkg/loader.(*loader).typeCheck(0xc000356fc0, 0xc000aa07a0)
    /Users/reece.cooper/go/pkg/mod/sigs.k8s.io/controller-tools@v0.11.1/pkg/loader/loader.go:286 +0x36a
sigs.k8s.io/controller-tools/pkg/loader.(*Package).NeedTypesInfo(0xc000aa07a0)
    /Users/reece.cooper/go/pkg/mod/sigs.k8s.io/controller-tools@v0.11.1/pkg/loader/loader.go:99 +0x39
sigs.k8s.io/controller-tools/pkg/loader.(*TypeChecker).check(0xc000a01cb0, 0xc000aa07a0)
    /Users/reece.cooper/go/pkg/mod/sigs.k8s.io/controller-tools@v0.11.1/pkg/loader/refs.go:268 +0x2b7
sigs.k8s.io/controller-tools/pkg/loader.(*TypeChecker).check.func1(0x7e?)
    /Users/reece.cooper/go/pkg/mod/sigs.k8s.io/controller-tools@v0.11.1/pkg/loader/refs.go:262 +0x53
created by sigs.k8s.io/controller-tools/pkg/loader.(*TypeChecker).check in goroutine 26
    /Users/reece.cooper/go/pkg/mod/sigs.k8s.io/controller-tools@v0.11.1/pkg/loader/refs.go:260 +0x1c5
make: *** [generate] Error 2

Have I missed a step?

Thanks in advance, Reece

stuggi commented 4 months ago

seems to be an issue with golang 1.22 and the controller-gen util we default to right now ( https://github.com/kubernetes-sigs/cluster-api/issues/10240 ) . we are currently using golang 1.20 with controller tools v0.11.1

stuggi commented 4 months ago

btw. there are bre-built images at quay.io/openstack-k8s-operators (index, bundle, operator). if you want to test them, you might want also have a look at https://github.com/openstack-k8s-operators/install_yamls/?tab=readme-ov-file#deploy-dev-env-using-crc-edpm-nodes-with-isolated-networks . we still lack docs

CooperTrooper21 commented 4 months ago

Thank you so much for that information 😁 If there is a way I can help out with the docs, please let me know

CooperTrooper21 commented 4 months ago

Hi @stuggi,

I have tried to install the CRDs using go v1.20.0 and still getting an error:

go version  
go version go1.20 darwin/amd64
make install
/Users/reece.cooper/Documents/projects/github/openstack-operator/bin/controller-gen rbac:roleName=manager-role crd:maxDescLen=0 webhook paths="./..." output:crd:artifacts:config=config/crd/bases && \
    rm -f apis/bases/* && cp -a config/crd/bases apis/
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=0x5259b7e]

goroutine 1 [running]:
go/types.(*Checker).handleBailout(0xc000cb8c00, 0xc0014a6b10)
    /usr/local/Cellar/go/1.22.0/libexec/src/go/types/check.go:367 +0x88
panic({0x554f560?, 0x5b05e30?})
    /usr/local/Cellar/go/1.22.0/libexec/src/runtime/panic.go:770 +0x132
go/types.(*StdSizes).Sizeof(0x0, {0x5619e30, 0x5b0e560})
    /usr/local/Cellar/go/1.22.0/libexec/src/go/types/sizes.go:228 +0x31e
go/types.(*Config).sizeof(...)
    /usr/local/Cellar/go/1.22.0/libexec/src/go/types/sizes.go:333
go/types.representableConst.func1({0x5619e30?, 0x5b0e560?})
    /usr/local/Cellar/go/1.22.0/libexec/src/go/types/const.go:76 +0x9e
go/types.representableConst({0x5620070, 0x5ada760}, 0xc000cb8c00, 0x5b0e560, 0xc0014a6280)
    /usr/local/Cellar/go/1.22.0/libexec/src/go/types/const.go:92 +0x192
go/types.(*Checker).representation(0xc000cb8c00, 0xc0013c17c0, 0x5b0e560)
    /usr/local/Cellar/go/1.22.0/libexec/src/go/types/const.go:256 +0x65
go/types.(*Checker).implicitTypeAndValue(0xc000cb8c00, 0xc0013c17c0, {0x5619e58, 0xc0011c03f0})
    /usr/local/Cellar/go/1.22.0/libexec/src/go/types/expr.go:375 +0x30d
go/types.(*Checker).assignment(0xc000cb8c00, 0xc0013c17c0, {0x5619e58, 0xc0011c03f0}, {0x5390e71, 0x14})
    /usr/local/Cellar/go/1.22.0/libexec/src/go/types/assignments.go:52 +0x2e5
go/types.(*Checker).initConst(0xc000cb8c00, 0xc001294900, 0xc0013c17c0)
    /usr/local/Cellar/go/1.22.0/libexec/src/go/types/assignments.go:126 +0x336
go/types.(*Checker).constDecl(0xc000cb8c00, 0xc001294900, {0x561ca00, 0xc001414360}, {0x561ca00, 0xc001414380}, 0x0)
    /usr/local/Cellar/go/1.22.0/libexec/src/go/types/decl.go:490 +0x348
go/types.(*Checker).objDecl(0xc000cb8c00, {0x56250f8, 0xc001294900}, 0x0)
    /usr/local/Cellar/go/1.22.0/libexec/src/go/types/decl.go:191 +0xa49
go/types.(*Checker).packageObjects(0xc000cb8c00)
    /usr/local/Cellar/go/1.22.0/libexec/src/go/types/resolver.go:693 +0x4dd
go/types.(*Checker).checkFiles(0xc000cb8c00, {0xc000b900c0, 0x18, 0x18})
    /usr/local/Cellar/go/1.22.0/libexec/src/go/types/check.go:408 +0x1a5
go/types.(*Checker).Files(...)
    /usr/local/Cellar/go/1.22.0/libexec/src/go/types/check.go:372
sigs.k8s.io/controller-tools/pkg/loader.(*loader).typeCheck(0xc0003963c0, 0xc0000b9060)
    /Users/reece.cooper/go/pkg/mod/sigs.k8s.io/controller-tools@v0.11.1/pkg/loader/loader.go:286 +0x36a
sigs.k8s.io/controller-tools/pkg/loader.(*Package).NeedTypesInfo(0xc0000b9060)
    /Users/reece.cooper/go/pkg/mod/sigs.k8s.io/controller-tools@v0.11.1/pkg/loader/loader.go:99 +0x39
sigs.k8s.io/controller-tools/pkg/loader.(*TypeChecker).check(0xc00123a180, 0xc0000b9060)
    /Users/reece.cooper/go/pkg/mod/sigs.k8s.io/controller-tools@v0.11.1/pkg/loader/refs.go:268 +0x2b7
sigs.k8s.io/controller-tools/pkg/loader.(*TypeChecker).Check(...)
    /Users/reece.cooper/go/pkg/mod/sigs.k8s.io/controller-tools@v0.11.1/pkg/loader/refs.go:216
sigs.k8s.io/controller-tools/pkg/crd.(*Parser).AddPackage(0xc001294f60, 0xc0000b9060)
    /Users/reece.cooper/go/pkg/mod/sigs.k8s.io/controller-tools@v0.11.1/pkg/crd/parser.go:224 +0xfd
sigs.k8s.io/controller-tools/pkg/crd.(*Parser).NeedPackage(0xc001294f60, 0xc0000b9060)
    /Users/reece.cooper/go/pkg/mod/sigs.k8s.io/controller-tools@v0.11.1/pkg/crd/parser.go:242 +0xee
sigs.k8s.io/controller-tools/pkg/crd.Generator.Generate({0x0, 0x0, 0xc0003920f8, {0x0, 0x0, 0x0}, 0x0}, 0xc000ec1e50)
    /Users/reece.cooper/go/pkg/mod/sigs.k8s.io/controller-tools@v0.11.1/pkg/crd/gen.go:109 +0x15b
sigs.k8s.io/controller-tools/pkg/genall.(*Runtime).Run(0xc000b52510)
    /Users/reece.cooper/go/pkg/mod/sigs.k8s.io/controller-tools@v0.11.1/pkg/genall/genall.go:261 +0x23d
main.main.func1(0xc000340200?, {0xc000372730?, 0x4?, 0x5386f19?})
    /Users/reece.cooper/go/pkg/mod/sigs.k8s.io/controller-tools@v0.11.1/cmd/controller-gen/main.go:176 +0x6a
github.com/spf13/cobra.(*Command).execute(0xc0001bb808, {0xc00012e130, 0x5, 0x5})
    /Users/reece.cooper/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:916 +0x882
github.com/spf13/cobra.(*Command).ExecuteC(0xc0001bb808)
    /Users/reece.cooper/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:1044 +0x3a5
github.com/spf13/cobra.(*Command).Execute(...)
    /Users/reece.cooper/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:968
main.main()
    /Users/reece.cooper/go/pkg/mod/sigs.k8s.io/controller-tools@v0.11.1/cmd/controller-gen/main.go:200 +0x2f6
make: *** [manifests] Error 2

I have looked at the docs for https://github.com/openstack-k8s-operators/install_yamls and it's focused at an OpenShift environment for installation. I am running a Kubernetes environment and it seems to not be supported or am I wrong? If so, is there docs supporting Kubernetes?

Thanks in advance, Reece

stuggi commented 3 months ago

@CooperTrooper21 sorry for the delay, missed the reply. from the output it seems its still using go 1.22:

    /usr/local/Cellar/go/1.22.0/libexec/src/go/types/check.go:367 +0x88

In general, right now we have a dependency on routes within the openstack-operator. So its not possible to use the openstack-operator with native kubernetes without the support for routes. What could be possible is to deploy each service operator on its own, which don't have that dependency. But then the automation done in the openstack-operator needs to be done manually, like creating each service CR, the ingress for the public endpoints, certificates,...