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

rbd: add functions to parse json in mirroring status description field #842

Merged
merged 4 commits into from
Mar 17, 2023

Commits on Mar 16, 2023

  1. rbd: add functions to parse json in mirroring status description field

    Add UnmarshalDescriptionJSON method to SiteMirrorImageStatus
    Add DescriptionReplayStatus method to SiteMirrorImageStatus
    
    Both these functions are meant to help extract the JSON object that is
    some times appended to the Description field in the
    SiteMirrorImageStatus struct. I have only seen the JSON appear after
    "replaying, " but there's little docs for this and I skimmed to code to
    even find out what fields the JSON might include.  As such, the
    UnmarshalDescriptionJSON tries to unmarshal the appended JSON into an
    object the caller provides in case skimming the code was insufficient or
    the caller has other needs. For most cases, DescriptionReplayStatus can
    be used to parse the JSON into a struct containing known fields.
    
    Signed-off-by: John Mulligan <jmulligan@redhat.com>
    phlogistonjohn committed Mar 16, 2023
    Configuration menu
    Copy the full SHA
    d74d218 View commit details
    Browse the repository at this point in the history
  2. rbd: add tests for DescriptionReplayStatus and UnmarshalDescriptionJSON

    Add unit and simplistic functional tests for new JSON/status description
    extraction functions.  Because these are preview functions we also add a
    stub file to add a no-op function to be built on non-preview builds.
    This avoids having to reimplement large parts of the existing mirroring
    tests just to validate this small aspect of the SiteMirrorImageStatus
    struct.
    
    Signed-off-by: John Mulligan <jmulligan@redhat.com>
    phlogistonjohn committed Mar 16, 2023
    Configuration menu
    Copy the full SHA
    d796f5b View commit details
    Browse the repository at this point in the history
  3. docs: update api-status for new mirroring image replay status funcs

    Signed-off-by: John Mulligan <jmulligan@redhat.com>
    phlogistonjohn committed Mar 16, 2023
    Configuration menu
    Copy the full SHA
    9ad3e92 View commit details
    Browse the repository at this point in the history
  4. rbd: remove stray debugging prints from mirror tests

    It is doubtful that these Print(f)s have been useful to any one for a
    long time.  Remove them.
    
    Signed-off-by: John Mulligan <jmulligan@redhat.com>
    phlogistonjohn committed Mar 16, 2023
    Configuration menu
    Copy the full SHA
    0139940 View commit details
    Browse the repository at this point in the history