cluster-api-provider-aws icon indicating copy to clipboard operation
cluster-api-provider-aws copied to clipboard

Panic when controlPlaneRef is nil

Open patrickdillon opened this issue 1 year ago • 6 comments
trafficstars

Seeing a panic when creating a cluster with a nil Cluster.Spec.ControlPlaneRef. Fix in #4817

E0226 15:27:32.383242      89 controller.go:329] "Reconciler error" err="panic: runtime error: invalid memory address or nil pointer dereference [recovered]" controller="awsmachine" controllerGroup="infrastructure.cluster.x-k8s.io" controllerKind="AWSMachine" AWSMachine="openshift-cluster-api-guests/padillon-02261020-n4wfw-master-2" namespace="openshift-cluster-api-guests" name="padillon-02261020-n4wfw-master-2" reconcileID="7249cfa7-ab4b-4d82-a00c-a66eada86cb3"
E0226 15:27:32.383280      89 runtime.go:79] Observed a panic: "invalid memory address or nil pointer dereference" (runtime error: invalid memory address or nil pointer dereference)
goroutine 449 [running]:
k8s.io/apimachinery/pkg/util/runtime.logPanic({0x2e84f20?, 0x5abd740})
	/home/padillon/go/src/github.com/openshift/installer/cluster-api/providers/aws/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:75 +0x85
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile.func1()
	/home/padillon/go/src/github.com/openshift/installer/cluster-api/providers/aws/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:108 +0xb2
panic({0x2e84f20?, 0x5abd740?})
	/usr/local/go/src/runtime/panic.go:914 +0x21f
sigs.k8s.io/cluster-api-provider-aws/v2/controllers.(*AWSMachineReconciler).getControlPlane(0xc000a22ab0?, {0x3bcb8d8, 0xc000b45b30}, 0xc000cefac0?, 0xc00115b040)
	/home/padillon/go/src/github.com/openshift/installer/cluster-api/providers/aws/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/controllers/awsmachine_controller.go:1234 +0x3e
sigs.k8s.io/cluster-api-provider-aws/v2/controllers.(*AWSMachineReconciler).Reconcile(0xc000a22ab0, {0x3bcb8d8, 0xc000b45b30}, {{{0xc000bcc8c0?, 0x0?}, {0xc000a2ba10?, 0xc001215d48?}}})
	/home/padillon/go/src/github.com/openshift/installer/cluster-api/providers/aws/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/controllers/awsmachine_controller.go:205 +0x74f
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile(0x3bcfce0?, {0x3bcb8d8?, 0xc000b45b30?}, {{{0xc000bcc8c0?, 0xb?}, {0xc000a2ba10?, 0x0?}}})
	/home/padillon/go/src/github.com/openshift/installer/cluster-api/providers/aws/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:119 +0xb7
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler(0xc0003e0b40, {0x3bcb910, 0xc000c05f90}, {0x3030ac0?, 0xc000cef4e0?})
	/home/padillon/go/src/github.com/openshift/installer/cluster-api/providers/aws/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:316 +0x3cc
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem(0xc0003e0b40, {0x3bcb910, 0xc000c05f90})
	/home/padillon/go/src/github.com/openshift/installer/cluster-api/providers/aws/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:266 +0x1c9
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2()
	/home/padillon/go/src/github.com/openshift/installer/cluster-api/providers/aws/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:227 +0x79
created by sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2 in goroutine 249
	/home/padillon/go/src/github.com/openshift/installer/cluster-api/providers/aws/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:223 +0x565

patrickdillon avatar Feb 26 '24 15:02 patrickdillon