Skip to content

Commit

Permalink
Fixed bug where pod not found errors would be reported for pods that …
Browse files Browse the repository at this point in the history
…have already terminated during DB user reconciler flow
  • Loading branch information
orishoshan committed May 12, 2024
1 parent 67b8d3f commit 9b65b8b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/operator/controllers/intents/database_user_reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,10 @@ func (r *DatabaseUserReconciler) getPostgresUserForWorkload(ctx context.Context,
func (r *DatabaseUserReconciler) fetchWorkloadPassword(ctx context.Context, clientIntents otterizev1alpha3.ClientIntents) (string, error) {
pod, err := r.serviceIdResolver.ResolveClientIntentToPod(ctx, clientIntents)
if err != nil {
if errors.Is(err, serviceidresolver.ErrPodNotFound) {
// Reconciler will be called again if needed, safe to ignore this error since the pod is gone.
return "", nil
}
return "", errors.Wrap(err)
}
secretName, ok := pod.Annotations[metadata.UserAndPasswordSecretNameAnnotation]
Expand Down

0 comments on commit 9b65b8b

Please sign in to comment.