fix(ocp-admin): remove oc CLI dependency from coreos-cve-validator (MGMT-24450)#147
Open
p-rog wants to merge 1 commit into
Open
fix(ocp-admin): remove oc CLI dependency from coreos-cve-validator (MGMT-24450)#147p-rog wants to merge 1 commit into
p-rog wants to merge 1 commit into
Conversation
Replace `oc adm release info` with direct podman-based extraction of the release image's image-references manifest. This eliminates the oc CLI requirement while keeping podman as the only external dependency. Resolves: MGMT-24450 Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Removes the
ocCLI dependency from thecoreos-cve-validatorskill by replacingoc adm release infowith directpodman-based extraction of the release image'simage-referencesmanifest.Before: The
fetch_coreos_metadata.pyscript required bothocandpodmanCLI tools.It used
oc adm release info <version> --pullspecsto query OCP release metadata (creationdate, CoreOS pullspec, component versions) and then
podmanto extract RPM packages.After: The script uses only
podman— it reads/release-manifests/image-referencesdirectly from the release image (
quay.io/openshift-release-dev/ocp-release:<version>-x86_64)via
podman run --rm --entrypoint cat. This JSON file contains all the same metadata(creation timestamp, CoreOS pullspec, machine-os version, component versions) that
oc adm release infowas extracting.Why: The
ocCLI is typically not available in agent execution environments (Cloud Agents,CI runners). Skills should use MCP tools or bundled scripts with minimal CLI dependencies.
Since
podmanwas already a hard requirement for RPM extraction, reusing it for releasemetadata eliminates the extra dependency entirely.
Changes
ocp-admin/scripts/security-validation/fetch_coreos_metadata.pyoc adm release infowithpodman run ... cat /release-manifests/image-references; newparse_image_references()function parses the JSON manifest instead of text output; removedocprerequisite checkocp-admin/skills/coreos-cve-validator/SKILL.mdoc) and Step 3 descriptionocp-admin/skills/cluster-creator/SKILL.mdocCLI" → "use MCP tools or CLI" in two placesFunctional verification
Tested against OCP 4.21.5 — all fields populated correctly:
Pack(s) affected
ocp-adminChange type
Contribution method
make validate+make validate-skill-design-changed)AGENTS.md compliance
${VAR}referencesValidation
make validatepasses locally (0 failures, 72 pre-existing warnings)skill-scanner scan coreos-cve-validator— SAFE, 0 findingsskill-scanner scan cluster-creator— SAFE, 0 findingsskill-scanner scan-all ocp-admin/skills— 5 SAFE, 2 pre-existing CRITICAL (false-positive path traversal in cluster-inventory/cluster-report from symlinked docs/INDEX.md)Resolves: MGMT-24450
Made with Cursor