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

Parsing changes for podman support #303

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Commits on Sep 29, 2023

  1. Add tests for docker inspect parsing

    This includes a failing test for a result observed with podman
    Rory-Reid committed Sep 29, 2023
    Configuration menu
    Copy the full SHA
    ff3b528 View commit details
    Browse the repository at this point in the history
  2. Change Container.State.Health.Status to be nullable

    The only place this is used (.WaitForHealthy()) already performs a null-
    safe check against the Status, comparing it to "Healthy" only. Changing
    the property to nullable allows more defensive parsing if it is an empty
    string for whatever reason, and is still interpreted as "Unhealthy"
    where it matters.
    Rory-Reid committed Sep 29, 2023
    Configuration menu
    Copy the full SHA
    1dd0dd6 View commit details
    Browse the repository at this point in the history
  3. Parse container EntryPoint from array or string

    This adds and uses a custom converter which will parse
    Container.Config.Entrypoint from a json string array I.E.
    
    ```json
    {
      "EntryPoint": [
        "my-entrypoint"
      ]
    }
    ```
    
    Or from a single string value, I.E:
    
    ```json
    {
      "EntryPoint": "my-entrypoint"
    }
    ```
    Rory-Reid committed Sep 29, 2023
    Configuration menu
    Copy the full SHA
    b43feb4 View commit details
    Browse the repository at this point in the history
  4. Parse minimal network ls output if full output fails

    In some cases the `--format` specification doesn't match the output
    resulting in an error such as:
    
    `Error: template: ls:1:43: executing "ls" at <.Scope>: can't evaluate field Scope in type network.ListPrintReports"`
    
    If the full command is unsuccessful, this falls back to parsing just the
    ID and Name, which prevents crashes at the cost of a less rich
    experience.
    Rory-Reid committed Sep 29, 2023
    Configuration menu
    Copy the full SHA
    d37ad0a View commit details
    Browse the repository at this point in the history
  5. Parse process timespans with format 0h0m0s

    This introduces a slightly more complex parsing method for timespans
    in the ProcessRow class in order to deal with more diverse formats (such
    as the format output by `podman top` - 1h2m3s vs 01:02:03).
    
    This also adds a simple test to validate the parser's current behaviour
    with docker, and a test to confirm it can parse podman output too
    without crashing.
    Rory-Reid committed Sep 29, 2023
    Configuration menu
    Copy the full SHA
    083f533 View commit details
    Browse the repository at this point in the history