anchore / anchore-cli

Simple command-line client to the Anchore Engine service
Apache License 2.0
114 stars 55 forks source link

Use predictable ordering for version field retrieval in system status command #89

Closed zhill closed 4 years ago

zhill commented 4 years ago

Make the ordering of results used for the system status command output's version results as stable as possible (subject to system volatility).

It should use the db and service version of the first found "up" API service as sorted by update timestamp descending.

dakaneye commented 4 years ago

Pretty closely related to #106.

@zhill , this is what I'm seeing in the API response for system status:

{
      "base_url": "http://api:8228",
      "hostid": "anchore-quickstart",
      "service_detail": {
        "available": true,
        "busy": false,
        "db_version": "0.0.13",
        "detail": {},
        "message": "all good",
        "up": true,
        "version": "0.8.0"
      },
      "servicename": "apiext",
      "status": true,
      "status_message": "available",
      "version": "v1"
    }

If there are multiple apiext services, not sure how we can sort this by a timestamp, did you mean something different?