Avoid allocations in ByIndex() function

This commit is contained in:
wojtekt
2019-03-26 14:14:42 +01:00
parent 231e372d0c
commit 7d46e27db1
2 changed files with 2 additions and 2 deletions

View File

@@ -827,7 +827,7 @@ func (config *RCConfig) start() error {
if oldRunning != config.Replicas {
// List only pods from a given replication controller.
options := metav1.ListOptions{LabelSelector: label.String()}
if pods, err := config.Client.CoreV1().Pods(metav1.NamespaceAll).List(options); err == nil {
if pods, err := config.Client.CoreV1().Pods(config.Namespace).List(options); err == nil {
for _, pod := range pods.Items {
config.RCConfigLog("Pod %s\t%s\t%s\t%s", pod.Name, pod.Spec.NodeName, pod.Status.Phase, pod.DeletionTimestamp)
}