File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -433,9 +433,10 @@ func (m *Modifier) buildPodPatchConfig(pod *corev1.Pod) *podPatchConfig {
433433 }
434434
435435 // Use the STS WebIdentity method if set
436- request := cache.Request {Namespace : pod .Namespace , Name : pod .Spec .ServiceAccountName , RequestNotification : true }
436+ gracePeriodEnabled := m .saLookupGraceTime > 0
437+ request := cache.Request {Namespace : pod .Namespace , Name : pod .Spec .ServiceAccountName , RequestNotification : gracePeriodEnabled }
437438 response := m .Cache .Get (request )
438- if ! response .FoundInCache && m . saLookupGraceTime > 0 {
439+ if ! response .FoundInCache && gracePeriodEnabled {
439440 klog .Warningf ("Service account %s not found in the cache. Waiting up to %s to be notified" , request .CacheKey (), m .saLookupGraceTime )
440441 select {
441442 case <- response .Notifier :
You can’t perform that action at this time.
0 commit comments