OpenShift API Discovery
Use read-only discovery against the intended cluster. Establish the expected cluster and context first, then pass the same explicit, single-context kubeconfig to every command as oc --kubeconfig <path> .... Never switch context or rely on the ambient oc configuration. The command forms below omit that common prefix only for readability. Treat live cluster output as authoritative for what that cluster serves.
Follow the fixed discovery order
- Find the canonical resource name, group, kind, scope, and verbs:
oc api-resources -o wide - Verify that the selected group/version is served:
oc api-versions - Read the resource schema with an explicit version:
oc explain <resource> --api-version=<group/version> - Inspect the requested field recursively with the same version:
oc explain <resource>.<field> --api-version=<group/version> --recursiveWhen the question concerns the complete resource rather than a field, use<resource>as the recursive target. - If
explainis absent or incomplete, inspect the OpenAPI v3 index:oc get --raw /openapi/v3Fetch the exactserverRelativeURLadvertised for the selected group/version; do not construct or guess it. - For a CRD, inspect its matching version schema last:
oc get crd <plural>.<group> -o jsonUse.spec.versions[]with the selected version and read.schema.openAPIV3Schema.
Do not reorder or skip earlier discovery based on memory. Later sources refine an incomplete result; they do not justify silently changing the resource or API version.
For repeatable evidence collection, run:
bash <resolved-skill-directory>/scripts/collect-discovery.sh \
--kubeconfig <explicit-kubeconfig> \
--resource <resource> \
--api-version <group/version> \
[--field <field-path>] \
[--crd <plural>.<group>]
Resolve <resolved-skill-directory> from this loaded SKILL.md; never assume the process working directory or installation location.
Evidence rules
- Never invent a resource, version, field, enum, default, or validation rule.
- Stop and report the item as unverified when the target cluster does not provide schema evidence.
- Do not substitute documentation for another OpenShift release or a similar API version without labeling it as non-authoritative context.
- Cite the exact successful command and selected API version for every schema conclusion. For CRDs, also cite the CRD name and
.spec.versions[]entry. - Report conflicting sources explicitly. Do not merge incompatible field definitions.
- Keep discovery read-only. Field existence does not imply authorization; verify permission separately with
oc auth can-ibefore proposing an operation. - Never expose Secret values, bearer tokens, client keys, or complete kubeconfigs.
References
- Read references/discovery-workflow.md when resolving ambiguous resource names, OpenAPI paths, or CRD versions.
- Read references/evidence-reporting.md when presenting verified fields, unsupported versions, or source conflicts.