Closed
Description
I am getting the following error when trying to get list of pods with their state filetered with fieldSelector.
"error":"non-exact field matches are not supported by the cache"
Here is the sample code:
fieldSelector, err := fields.ParseSelector("spec.nodeName=" + nodeName + ",status.phase!=" + string(corev1.PodSucceeded) + ",status.phase!=" + string(corev1.PodFailed))
activePodsList := &corev1.PodList{}
listOptions := &client.ListOptions{FieldSelector: fieldSelector}
if err := r.List(context.TODO(), listOptions, activePodsList); err != nil {
return reconcile.Result{}, err
}
This look like a current limitation and not supported. See https://github.com/kubernetes-sigs/controller-runtime/blob/master/pkg/cache/internal/cache_reader.go#L99
Metadata
Metadata
Assignees
Labels
Categorizes issue or PR as related to design.Categorizes issue or PR as related to a new feature.Denotes an issue or PR that has aged beyond stale and will be auto-closed.Lowest priority. Possibly useful, but not yet enough support to actually get it done.Higher priority than priority/awaiting-more-evidence.