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:
@@ -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++
|
||||
|
||||
Reference in New Issue
Block a user