[OTA-2089] fall back to local source for plc_lookup - #45
Conversation
Signed-off-by: Ankita Thomas <ankithom@redhat.com>
65e5b71 to
ee6eb76
Compare
| FROM registry.access.redhat.com/ubi9/ubi-minimal:latest AS builder | ||
|
|
||
| RUN mkdir -p /cincinnati-graph-data && \ | ||
| curl -L -o /cincinnati-graph-data/products.json https://access.redhat.com/product-life-cycles/api/v2/products || true |
There was a problem hiding this comment.
This will fail in ART/Konflux builds, which happen in a hermetic, zero-egress environment to protect against bringing in potentially-dangerous content from the wider internet. If we want to go with the "bake a recent product snapshot into the skills image to ship with OCP" approach, we need to actually commit periodic snapshots of the product JSON to this repo in Git commits. And we can do that via OCPBUGS into 5.0.z releases, without needing to make any changes by the feature-development cutoff.
There was a problem hiding this comment.
I have an initial snapshot added to the PR and removed any changes to the Containerfiles. I can look into automating the snapshot PRs if this looks okay
049d6d5 to
caf8fcf
Compare
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: ankitathomas The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
caf8fcf to
c6b66eb
Compare
c6b66eb to
a8fabb4
Compare
|
@ankitathomas: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
jrangelramos
left a comment
There was a problem hiding this comment.
Just a few nits. Also perhaps data/product.json should be back to the repo (and later addressed/updated via PR with github action or something similar)
| import urllib.request | ||
|
|
||
| API_BASE = "https://access.redhat.com/product-life-cycles/api/v2/products" | ||
| PRODUCTS_PATH = "data/products.json" |
There was a problem hiding this comment.
Here it should resolve the full path first relative to the script dir
| PRODUCTS_PATH = "data/products.json" | |
| PRODUCTS_PATH = os.path.join(os.path.dirname(__file__), "data", "products.json") |
othwise it shall fails when calling from outside the script dir
{
"error": "file_open_error",
"detail": "[Errno 2] No such file or directory: 'data/products.json'"
}
| for i in body["data"]: | ||
| if "name" in i and cleaned_name in i["name"].lower(): | ||
| result.append(i) | ||
| return {"data": result} |
There was a problem hiding this comment.
here cmd_products() expects the returned data as a list and iterate over the result directly. Returning it inside a "data" fails to iterate over it.
| return {"data": result} | |
| return result |
| return body["data"] | ||
|
|
||
| result = [] | ||
| cleaned_name=name.lower() |
There was a problem hiding this comment.
| cleaned_name=name.lower() | |
| cleaned_name = name.lower() |
Include product lifecycle data as a file in agentic-skills image and have plc_lookup.py use the local file if the products lifecycle API is unreachable, such as in a disconnected environment.