Skip to content

fix: recognize Kubernetes CRD schema as builtin - #1311

Open
Pybsama wants to merge 1 commit into
redhat-developer:mainfrom
Pybsama:codex/recognize-native-crd-schema
Open

fix: recognize Kubernetes CRD schema as builtin#1311
Pybsama wants to merge 1 commit into
redhat-developer:mainfrom
Pybsama:codex/recognize-native-crd-schema

Conversation

@Pybsama

@Pybsama Pybsama commented Jul 31, 2026

Copy link
Copy Markdown

What does this PR do?

Kubernetes publishes CustomResourceDefinition under the
io.k8s.apiextensions-apiserver.pkg.apis definition prefix rather than the
usual io.k8s.api prefix. The current exact matcher therefore misses this
builtin resource and falls back to a nonexistent entry in the external CRD
catalog.

This change:

  • maps the exact apiextensions.k8s.io API group to its generated Kubernetes
    definition prefix;
  • keeps the existing exact io.k8s.api matching behavior for every other
    group;
  • falls back to all.json when an apiextensions kind or version is absent from
    the selected Kubernetes schema instead of treating it as a custom resource;
  • preserves CRD catalog lookup for similarly named custom groups.

What issues does this PR fix or reference?

Fixes #1310

Is it tested? How?

  • npm run build
  • Node.js 22: ESLint, main/UMD/ESM TypeScript compilation
  • 9 focused Kubernetes schema-selection scenarios
  • 1,305 passing full-suite tests and 5 existing pending tests

The full suite currently has one unrelated live SchemaStore assertion for the
Drone schema. It reproduces unchanged on the exact main base commit because
the externally served diagnostic ordering no longer matches the fixture; the
1,305 remaining tests pass under Node.js 22.

AI assistance was used during implementation and review; I verified the
changes and all reported test results.

@datho7561

Copy link
Copy Markdown
Contributor

This seems to be the right direction. @shin19991207 may have also started something, I don't know for sure though.

@shin19991207

Copy link
Copy Markdown
Member

@datho7561 Yes, this seems to be the right direction. And I haven't started anything on this so please feel free to start reviewing on this PR!

@datho7561 datho7561 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and works well! Thanks for the contribution! Is there anything else that needs to be done on here?

@Pybsama
Pybsama marked this pull request as ready for review August 3, 2026 04:53
Use the Kubernetes schema generator's apiextensions-apiserver prefix for the official apiextensions.k8s.io group. Keep unsupported native versions on all.json instead of falling back to the external CRD catalog.

Fixes redhat-developer#1310

Signed-off-by: sama Pyb <peiyibopybsama@gmail.com>
@datho7561
datho7561 force-pushed the codex/recognize-native-crd-schema branch from c40b51e to 14f99a5 Compare August 6, 2026 18:42
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.

Server incorrectly treats kubernetes CRD as a CRD

3 participants