Fix a case where provider pod status is not found

Updates the pod status in Kubernetes to "Failed" when the pod status is
not found from the provider.

Note that currently thet most providers return `nil, nil` when a pod is
not found. This works but should possibly return a typed error so we can
determine if the error means not found or something else... but this
works as is so I haven't changed it.
This commit is contained in:
Brian Goff
2018-11-01 14:02:55 -07:00
parent bec818bf3c
commit aee1fde504
2 changed files with 66 additions and 21 deletions

View File

@@ -160,8 +160,8 @@ func (s *Server) reconcile(ctx context.Context) {
var failedDeleteCount int64
for _, pod := range deletePods {
logger := logger.WithField("pod", pod.Name)
logger.Debug("Deleting pod '%s'\n", pod.Name)
logger := logger.WithField("pod", pod.GetName()).WithField("namespace", pod.GetNamespace())
logger.Debug("Deleting pod")
if err := s.deletePod(ctx, pod); err != nil {
logger.WithError(err).Error("Error deleting pod")
failedDeleteCount++