Kubeslice Worker Operator Opensource Repository: The KubeSlice Worker Operator is a Kubernetes operator that manages the lifecycle of KubeSlice worker clusters.
Apache License 2.0
58
stars
19
forks
source link
Bug: Operator panicking out as `Client` not set #335
The operator is panicking out due to nil pointer dereference on master.
Earlier, the field client.Client in SliceGwReconciler (pkg/hub/controllers/slicegateway_controller.go) was being set by sigs.k8s.io/controller-runtime/pkg/controller by calling the InjectClient method that the reconciler(s) implement in worker-operator.
But in the commit 8077621e3faaf798e0fa1ac4218e99765a89198b, the sigs.k8s.io/controller-runtime was bumped up from v0.11.1 to v0.16.3. And in v0.15.0, the controller-runtime had some breaking changes, and removing InjectClient is one of them.
So, after that, the client.Client is no longer set by controller-runtime and so, the operator panics of nil pointer dereference.
π Reproduction steps
Run the controller and worker setup and check for the kubeslice-operator deployment's logs.
π Expected behavior
It shouldn't panic. And the worker operator should function as usual.
π Description
The operator is panicking out due to nil pointer dereference on master.
Earlier, the field
client.Client
inSliceGwReconciler
(pkg/hub/controllers/slicegateway_controller.go) was being set bysigs.k8s.io/controller-runtime/pkg/controller
by calling theInjectClient
method that the reconciler(s) implement in worker-operator.But in the commit
8077621e3faaf798e0fa1ac4218e99765a89198b
, thesigs.k8s.io/controller-runtime
was bumped up fromv0.11.1
tov0.16.3
. And in v0.15.0, the controller-runtime had some breaking changes, and removingInjectClient
is one of them.So, after that, the
client.Client
is no longer set by controller-runtime and so, the operator panics of nil pointer dereference.π Reproduction steps
Run the controller and worker setup and check for the
kubeslice-operator
deployment's logs.π Expected behavior
It shouldn't panic. And the worker operator should function as usual.
π Actual Behavior
It panics due to nil pointer dereference.
π Relevant log output
Version
Latest master. Commit:
8077621e3faaf798e0fa1ac4218e99765a89198b
π₯οΈ What operating system are you seeing the problem on?
Linux
β Proposed Solution
Set the client in
SliceGwReconciler
at the hub/manager level itself.Probably need to clean up all the code around
InjectClient
in multiple places as it is obsolete now. And in tests (many).π Have you spent some time to check if this issue has been raised before?
Code of Conduct