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

policy-engine/src/openapiv3: additionalProperties for Node.metadata #347

Merged

Conversation

wking
Copy link
Member

@wking wking commented Nov 7, 2020

The metadata value is not a string, it is an object whose sub-properties have string values:

$ curl -sH Accept:application/json 'https://api.openshift.com/api/upgrades_info/v1/graph?channel=stable-4.6' | jq -S '.nodes[] | select(.version == "4.6.1")'
{
  "metadata": {
    "description": "",
    "io.openshift.upgrades.graph.previous.remove_regex": "4\\.5\\.1[45]",
    "io.openshift.upgrades.graph.release.channels": "candidate-4.6,fast-4.6,stable-4.6",
    "io.openshift.upgrades.graph.release.manifestref": "sha256:d78292e9730dd387ff6198197c8b0598da340be7678e8e1e4810b557a926c2b9",
    "url": "https://access.redhat.com/errata/RHBA-2020:4196"
  },
  "payload": "quay.io/openshift-release-dev/ocp-release@sha256:d78292e9730dd387ff6198197c8b0598da340be7678e8e1e4810b557a926c2b9",
  "version": "4.6.1"
}

In OpenAPI, that is represented by an additionalProperties object declaring the type of the child values.

The previous string claim was from the original OpenAPI declaration in d717acc (#40).

The metadata value is not a string, it is an object whose
sub-properties have string values:

  $ curl -sH Accept:application/json 'https://api.openshift.com/api/upgrades_info/v1/graph?channel=stable-4.6' | jq -S '.nodes[] | select(.version == "4.6.1")'
  {
    "metadata": {
      "description": "",
      "io.openshift.upgrades.graph.previous.remove_regex": "4\\.5\\.1[45]",
      "io.openshift.upgrades.graph.release.channels": "candidate-4.6,fast-4.6,stable-4.6",
      "io.openshift.upgrades.graph.release.manifestref": "sha256:d78292e9730dd387ff6198197c8b0598da340be7678e8e1e4810b557a926c2b9",
      "url": "https://access.redhat.com/errata/RHBA-2020:4196"
    },
    "payload": "quay.io/openshift-release-dev/ocp-release@sha256:d78292e9730dd387ff6198197c8b0598da340be7678e8e1e4810b557a926c2b9",
    "version": "4.6.1"
  }

In OpenAPI, that is represented by an additionalProperties object
declaring the type of the child values [1,2].

The previous string claim was from the original OpenAPI declaration in
d717acc (policy-engine: add OpenAPI content and route, 2019-01-10, #40).

[1]: https://github.com/OAI/OpenAPI-Specification/blame/3.0.2/versions/3.0.2.md#L2404-L2421
[2]: https://github.com/OAI/OpenAPI-Specification/blame/3.0.2/versions/3.0.2.md#L2305
@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 7, 2020
@LalatenduMohanty
Copy link
Member

/lgtm
/hold for @steveej @vrutkovs to take a look.

Wondering if this will cause if any tool using the type already

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 9, 2020
@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Nov 9, 2020
@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: LalatenduMohanty, wking

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [LalatenduMohanty,wking]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@vrutkovs
Copy link
Member

vrutkovs commented Nov 9, 2020

/hold cancel

LGTM

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 9, 2020
@openshift-merge-robot openshift-merge-robot merged commit 607db7e into openshift:master Nov 9, 2020
@wking wking deleted the open-api-node-metadata-object branch November 10, 2020 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants