Handle nil error in machinepool reconciler
shyamradhakrishnan opened this issue · 0 comments
shyamradhakrishnan commented
What happened:
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=0x1bf0a1d]
goroutine 467 [running]:
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile.func1()
/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.15.0/pkg/internal/controller/controller.go:115 +0x1fa
panic({0x1ec0480, 0x3636390})
/usr/local/go/src/runtime/panic.go:884 +0x213
github.com/oracle/cluster-api-provider-oci/cloud/scope.GetNsgNamesFromId(...)
/workspace/cloud/scope/util.go:32
github.com/oracle/cluster-api-provider-oci/cloud/scope.(*ManagedMachinePoolScope).getSpecFromAPIObject(0xc00051b570, 0xc0009e8f08)
/workspace/cloud/scope/managed_machine_pool.go:758 +0x127d
github.com/oracle/cluster-api-provider-oci/cloud/scope.(*ManagedMachinePoolScope).UpdateNodePool(0xc00051b570, {0x2524340, 0xc00042c240}, 0xc0009e8f08)
/workspace/cloud/scope/managed_machine_pool.go:601 +0x119
github.com/oracle/cluster-api-provider-oci/exp/controllers.(*OCIManagedMachinePoolReconciler).reconcileNormal(0xc000760780, {0x2524340, 0xc00042c240}, {{0x2527118?, 0xc0002da2c0?}, 0x252ad10?}, 0xc00051b570)
/workspace/exp/controllers/ocimanaged_machinepool_controller.go:331 +0xf85
github.com/oracle/cluster-api-provider-oci/exp/controllers.(*OCIManagedMachinePoolReconciler).Reconcile(0xc000760780, {0x2524340, 0xc00042c240}, {{{0xc0003c5c06?, 0x0?}, {0xc0003c5c50?, 0x40e087?}}})
/workspace/exp/controllers/ocimanaged_machinepool_controller.go:177 +0xabc
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile(0x2524340?, {0x2524340?, 0xc00042c240?}, {{{0xc0003c5c06?, 0x1dfaee0?}, {0xc0003c5c50?, 0x2509560?}}})
/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.15.0/pkg/internal/controller/controller.go:118 +0xc8
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler(0xc0002fa500, {0x2524298, 0xc0000f1950}, {0x1fac7a0?, 0xc0006578c0?})
/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.15.0/pkg/internal/controller/controller.go:314 +0x377
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem(0xc0002fa500, {0x2524298, 0xc0000f1950})
/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.15.0/pkg/internal/controller/controller.go:265 +0x1d9
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2()
/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.15.0/pkg/internal/controller/controller.go:226 +0x85
created by sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2
/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.15.0/pkg/internal/controller/controller.go:222 +0x587
What you expected to happen:
How to reproduce it (as minimally and precisely as possible):
Anything else we need to know?:
Environment:
- CAPOCI version:
- Cluster-API version (use
clusterctl version
): - Kubernetes version (use
kubectl version
): - Docker version (use
docker info
): - OS (e.g. from
/etc/os-release
):