AMDEPYC / AMDEPYC/kubernetes-power-manager
`PowerPodReconciler` panics when Pod Resources API is not available
- Dominant language
- Go
- Stars
- 5
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Description
### Steps to reproduce
TBD
### Root cause
The commit https://github.com/AMDEPYC/kubernetes-power-manager/commit/5197a02fd8279b5ea2e6fc0697b8e173013cb438 introduced support for a secondary socket for [Pod Resources API](https://kubernetes.io/docs/concepts/extend-kubernetes/compute-storage-net/device-plugins/#monitoring-device-plugin-resources) (possibly provided by [CPU Control Plane Plugin for Kubernetes](https://github.com/intel/cpu-control-plane-plugin-for-kubernetes)), which is used when the primary socket `/var/lib/kubelet/pod-resources/kubelet.sock` is not available. But in such case all errors are silently ignored:
https://github.com/AMDEPYC/kubernetes-power-manager/blob/bf4edacaed003e01175b23510c7ea67990c2989f/pkg/podresourcesclient/podresourcesclient.go#L88-L93
In turn, downstream logic that assumes the response is non-nil if no error is returned panics when attempting to dereference the nil pointer.
https://github.com/AMDEPYC/kubernetes-power-manager/blob/bf4edacaed003e01175b23510c7ea67990c2989f/pkg/podresourcesclient/podresourcesclient.go#L110-L117
### Possible solution
The secondary socket `/var/lib/kubelet/pod-resources/cci-dra-driver-podrsc.sock` is most likely never available in the AMD case, so we could simply remove `CpuControlPlaneClient` and all uses of it.
https://github.com/AMDEPYC/kubernetes-power-manager/blob/bf4edacaed003e01175b23510c7ea67990c2989f/pkg/podresourcesclient/podresourcesclient.go#L22-L26
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.