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

pkg/cincinnati: update unamrshal to node to match the result from cincinnati #113

Merged

Commits on Feb 8, 2019

  1. pkg/cincinnati: update unamrshal to node to match the result from cin…

    …cinnati
    
    Based on [1] the fields for a node must be `version`, `image` and `metadata`. But response from current api:
    
    ```console
    $ curl --silent --header 'Accept:application/json' https://api.openshift.com/api/upgrades_info/v1/graph | jq .
    {
      "nodes": [
        {
          "version": "4.0.0-5",
          "payload": "quay.io/openshift-release-dev/ocp-release:4.0.0-5",
          "metadata": {}
        },
        {
          "version": "4.0.0-4",
          "payload": "quay.io/openshift-release-dev/ocp-release:4.0.0-4",
          "metadata": {}
        },
        {
          "version": "4.0.0-6",
          "payload": "quay.io/openshift-release-dev/ocp-release:4.0.0-6",
          "metadata": {}
        },
        {
          "version": "4.0.0-7",
          "payload": "quay.io/openshift-release-dev/ocp-release:4.0.0-7",
          "metadata": {}
        },
        {
          "version": "4.0.0-8",
          "payload": "quay.io/openshift-release-dev/ocp-release:4.0.0-8",
          "metadata": {}
        },
        {
          "version": "4.0.0-9",
          "payload": "quay.io/openshift-release-dev/ocp-release:4.0.0-9",
          "metadata": {}
        },
        {
          "version": "4.0.0-0.1",
          "payload": "quay.io/openshift-release-dev/ocp-release:4.0.0-0.1",
          "metadata": {
            "description": "This is the beta1 image based on the 4.0.0-0.nightly-2019-01-15-010905 build"
          }
        },
        {
          "version": "4.0.0-0.okd-0",
          "payload": "quay.io/openshift-release-dev/ocp-release:4.0.0-0.okd-0",
          "metadata": {}
        },
        {
          "version": "4.0.0-0.2",
          "payload": "quay.io/openshift-release-dev/ocp-release:4.0.0-0.2",
          "metadata": {}
        },
        {
          "version": "4.0.0-0.3",
          "payload": "quay.io/openshift-release-dev/ocp-release:4.0.0-0.3",
          "metadata": {}
        }
      ],
      "edges": [
        [
          1,
          0
        ],
        [
          0,
          2
        ],
        [
          2,
          3
        ],
        [
          3,
          4
        ],
        [
          4,
          5
        ],
        [
          6,
          8
        ],
        [
          8,
          9
        ]
      ]
    }
    ```
    has fields `version`, `payload` and `metadata` for a node.
    
    3956b76 changed the previouly `Payload` field to `Image` creating invalid node object when fetching updates from cincinnati.
    
    With this PR, we are using the unmarshalling `version` and `payload` fields for a node.
    
    [1]: https://github.com/openshift/cincinnati/blob/3616af287436ebe3b47262cbd1d32ad7e238a277/docs/design/cincinnati.md#response
    abhinavdahiya committed Feb 8, 2019
    Configuration menu
    Copy the full SHA
    bb95420 View commit details
    Browse the repository at this point in the history