Feature request: Include restore error details in VirtualMachineFileRestore phase-wait failures

Ouverte
#2,847 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
3/5
Temps estimé
1-2 jours
Accessibilité débutants
67/100
Type d'issue
Fonctionnalité
Clarté
Clairement spécifiée
Activité
Active
Stack technique
python
Domaine
backend

Piste de recherche

Read ocp_resources/virtual_machine_file_restore.py and inspect the existing wait behavior in ocp_resources/resource.py to choose the helper interface. Add focused tests for reaching the requested phase, failure with status.errorMessage, and failure without it. Done means the helper reports useful failure details while inherited wait_for_status() behavior remains unchanged for other callers and phases.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

Summary

Add a restore-specific phase-wait helper to VirtualMachineFileRestore in a follow-up PR.

When a restore reaches Failed while a caller waits for a successful phase, include the operator-provided status.errorMessage in the failure details. This will make restore failures easier to diagnose without a separate status lookup.

Required changes

  • Add the helper in ocp_resources/virtual_machine_file_restore.py, outside the generated-code markers.
  • Detect the Failed phase while waiting for the requested successful phase and report status.errorMessage when available.
  • Handle an absent or empty error message without introducing a secondary exception.
  • Preserve the inherited wait_for_status() behavior for other callers and phases.
  • Document the helper and add focused tests.

The implementation can inspect ocp_resources/resource.py for the existing wait behavior before selecting the helper's interface.

Acceptance criteria

  • A successful restore returns as documented when it reaches the requested phase.
  • A failed restore reports the failed phase and the operator error message when available.
  • Missing error details still produce a useful failure diagnostic.
  • Existing wait behavior remains unchanged outside the new helper.
  • Tests cover success, failure with an error message, and failure without an error message.

Context

Requested by @ema-aka-young for a separate PR, rather than expanding PR #2846.

Langage dominant
Python
Étoiles
28
Forks
85
Merge moyen
1 j 3 min
PR mergées (30 j)
30

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de RedHatQE/openshift-python-wrapper

Toutes les issues de RedHatQE/openshift-python-wrapper

Issues similaires

Plus d'issues Python

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.