Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not check the pod's deletionTimestamp when determining if a pod is active #203

Merged
merged 1 commit into from
Apr 10, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Do not check the pod's deletionTimestamp
This was causing nil entries in the pod index which resulted in credentials failing to be issued.
See #178 for more information.
  • Loading branch information
rifelpet committed Mar 7, 2019
commit 49a5e5dcae17e1b9c2b245600f9d67f03355d700
8 changes: 1 addition & 7 deletions pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"fmt"

log "github.com/sirupsen/logrus"
"k8s.io/client-go/pkg/api/unversioned"
"k8s.io/client-go/pkg/api/v1"
"k8s.io/client-go/tools/cache"
)
Expand Down Expand Up @@ -72,14 +71,9 @@ func (p *PodHandler) OnDelete(obj interface{}) {
}

func isPodActive(p *v1.Pod) bool {
podDeleted := false
if p.DeletionTimestamp != nil {
podDeleted = p.DeletionTimestamp.Before(unversioned.Now())
}
return p.Status.PodIP != "" &&
v1.PodSucceeded != p.Status.Phase &&
v1.PodFailed != p.Status.Phase &&
!podDeleted
v1.PodFailed != p.Status.Phase
}

// PodIPIndexFunc maps a given Pod to it's IP for caching.
Expand Down