Skip to content

feat: add --lookup-resources flag for offline lookup in render/lint commands#657

Open
dmmordvi wants to merge 10 commits into
mainfrom
feat/lookup-resources-offline
Open

feat: add --lookup-resources flag for offline lookup in render/lint commands#657
dmmordvi wants to merge 10 commits into
mainfrom
feat/lookup-resources-offline

Conversation

@dmmordvi

@dmmordvi dmmordvi commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Review in cubic

dmmordvi added 10 commits July 13, 2026 19:36
An offline lookup <apiVersion> <Kind> <ns> "" (list form) for a kind
absent from --lookup-resources panicked inside the fake dynamic client
with "you must register resource to list kind", failing the render. This
contradicted the offline stub promise that an absent kind yields an empty
result.

Wrap the fake resource interface so a LIST that hits the unregistered
list-kind panic recovers and returns an empty UnstructuredList instead.
GET-of-missing and LIST-of-provided-kind behavior are unchanged.
A --lookup-resources file containing a kind: List / *List document (e.g.
kubectl get -o yaml output) crashed the process: the list wrapper reached
the fake dynamic tracker's addList path and panicked, with no recover in
the action stack.

Detect list wrappers in parseLocalLookupResources and expand them into
their items before building the fake client. Each item flows through the
same apiVersion validation and dedup as top-level documents, with
file/document/item context in parse errors.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant