Skip to content

Commit de74d1c

Browse files
committed
Remove retry
Signed-off-by: jukie <10012479+Jukie@users.noreply.github.com>
1 parent 2172ac3 commit de74d1c

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

internal/provider/kubernetes/topology_injector.go

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99
"context"
1010
"encoding/json"
1111
"fmt"
12-
"time"
1312

1413
corev1 "k8s.io/api/core/v1"
1514
"k8s.io/apimachinery/pkg/types"
@@ -50,16 +49,11 @@ func (m *ProxyTopologyInjector) Handle(ctx context.Context, req admission.Reques
5049
}
5150

5251
pod := &corev1.Pod{}
53-
// Cache isn't guaranteed to be updated yet, so we retry a few times.
5452
var getErr error
55-
for i := 0; i < 2; i++ {
56-
getErr = m.Get(ctx, podName, pod)
57-
if getErr == nil {
58-
break
59-
}
60-
time.Sleep(10 * time.Millisecond)
61-
}
62-
// If the pod is not found in the cache, try to get it from the API server directly.
53+
getErr = m.Get(ctx, podName, pod)
54+
55+
// Cache isn't guaranteed to be updated yet so if it's not
56+
// found try getting the Pod from API server directly.
6357
if getErr != nil {
6458
if m.APIReader != nil {
6559
if err := m.APIReader.Get(ctx, podName, pod); err != nil {

0 commit comments

Comments
 (0)