AMDEPYC / AMDEPYC/kubernetes-power-manager

`PowerPodReconciler` panics when Pod Resources API is not available

Aperta
#54 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
bug
Lingua principale
Go
Stelle
5
Fork
4
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

### 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

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.