-
Notifications
You must be signed in to change notification settings - Fork 60
policy-engine: add OpenAPI spec and endpoint #40
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: add OpenAPI spec and endpoint #40
Conversation
c293c17 to
d0c6e17
Compare
c3f4232 to
65125cf
Compare
65125cf to
7d91fab
Compare
|
The OpenAPI spec is still missing the input arguments on the graph endpoint. Therefore putting this on hold. |
19a04d0 to
04835bb
Compare
|
@lucab |
04835bb to
30a4d22
Compare
|
All the comments addressed in best-effort manner. It could likely be optimized further but IMO that's not worth it for this code-path, as we're talking about the OpenAPI endpoint which I expect to have really low traffic. |
|
/hold cancel |
|
/lgtm |
|
Looks like there were changes on quay.io causing the following issues with the manifest: There's currently an incident on quay.io but I've yet to figure out if we're facing a backwards-compatibility issue or a temporary issue. |
|
I tracked down the issue to a permanent quay.io change. I proposed a band-aid for dkregistry-rs with room for improvement. |
This adds a new `/v1/openapi` route to the policy-engine, serving an OpenAPI v3 specification which describes the service. The specification is manually written as it seems overkill to have it autogenerated as adding more endpoints to the policy-engine is not anticipated.
30a4d22 to
d717acc
Compare
|
[test] |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: crawford, lucab, steveeJ The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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
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
Contains #41.
Closes https://jira.coreos.com/browse/CORS-955.