File tree Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -49,10 +49,6 @@ type Request struct {
4949func (r Request ) CacheKey () string {
5050 return r .Namespace + "/" + r .Name
5151}
52- func (r Request ) WithNotification () Request {
53- r .RequestNotification = true
54- return r
55- }
5652
5753type Response struct {
5854 RoleARN string
Original file line number Diff line number Diff line change @@ -433,12 +433,13 @@ 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 }
437- response := m .Cache .Get (request . WithNotification () )
436+ request := cache.Request {Namespace : pod .Namespace , Name : pod .Spec .ServiceAccountName , RequestNotification : true }
437+ response := m .Cache .Get (request )
438438 if ! response .FoundInCache && m .saLookupGraceTime > 0 {
439439 klog .Warningf ("Service account %s not found in the cache. Waiting up to %s to be notified" , request .CacheKey (), m .saLookupGraceTime )
440440 select {
441441 case <- response .Notifier :
442+ request = cache.Request {Namespace : pod .Namespace , Name : pod .Spec .ServiceAccountName , RequestNotification : false }
442443 response = m .Cache .Get (request )
443444 if ! response .FoundInCache {
444445 klog .Warningf ("Service account %s not found in the cache after being notified. Not mutating." , request .CacheKey ())
You can’t perform that action at this time.
0 commit comments