Skip to content

Commit b5c8905

Browse files
authored
Merge pull request #2585 from oliviassss/check-TGB-namespace
check namespace when update pod condition for deleted TGB
2 parents 88b6bdc + 4c33010 commit b5c8905

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/targetgroupbinding/resource_manager.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,12 +337,16 @@ func (m *defaultResourceManager) updatePodAsHealthyForDeletedTGB(ctx context.Con
337337

338338
allPodKeys := m.podInfoRepo.ListKeys(ctx)
339339
for _, podKey := range allPodKeys {
340+
// check the pod is in the same namespace with the tgb
341+
if podKey.Namespace != tgb.Namespace {
342+
continue
343+
}
340344
pod, exists, err := m.podInfoRepo.Get(ctx, podKey)
341345
if err != nil {
342346
return err
343347
}
344348
if !exists {
345-
return errors.New("couldn't find podInfo for ready endpoint")
349+
continue
346350
}
347351
if pod.HasAnyOfReadinessGates([]corev1.PodConditionType{targetHealthCondType}) {
348352
targetHealth := &elbv2sdk.TargetHealth{

0 commit comments

Comments
 (0)