feat: auto-detect Kubernetes schema#962
Open
msvechla wants to merge 4 commits intoredhat-developer:mainfrom
Open
feat: auto-detect Kubernetes schema#962msvechla wants to merge 4 commits intoredhat-developer:mainfrom
msvechla wants to merge 4 commits intoredhat-developer:mainfrom
Conversation
automatically detect the Kubernetes schema based on the document's GroupVersionKind (GVK) and retrieve the matching schema from the CRD catalog.
Contributor
|
Really nice, even works great with helm-ls (with some small tweaks to helm-ls). I just noticed that it gives an error for normal kubernetes resources, if those are not associated with the correct schema (caused by some config issues). |
msivasubramaniaan
requested changes
Dec 19, 2024
Contributor
msivasubramaniaan
left a comment
There was a problem hiding this comment.
Please handle the negative test scenarios as well
2 tasks
Contributor
|
Hi @tricktron, @msvechla @msivasubramaniaan I looked into handling the other cases in the tests and encountered some more challenges that I tried to solve in #1050. |
ricoberger
added a commit
to ricoberger/yaml-language-server
that referenced
this pull request
Sep 9, 2025
Add an option to overwrite the default Kubernetes schema URL with a custom one, by setting a `YAMLLS_KUBERNETES_SCHEMA_URL` environment variable. See - redhat-developer#998 - redhat-developer#824 - redhat-developer#841 - redhat-developer#962 - redhat-developer#1050 Main use case is to use https://github.com/ricoberger/kubernetes-json-schema, which contains the schema for Kubernetes and the CRDs I'm using.
ricoberger
added a commit
to ricoberger/yaml-language-server
that referenced
this pull request
Jan 7, 2026
Add an option to overwrite the default Kubernetes schema URL with a custom one, by setting a `YAMLLS_KUBERNETES_SCHEMA_URL` environment variable. See - redhat-developer#998 - redhat-developer#824 - redhat-developer#841 - redhat-developer#962 - redhat-developer#1050 Main use case is to use https://github.com/ricoberger/kubernetes-json-schema, which contains the schema for Kubernetes and the CRDs I'm using.
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.

What does this PR do?
This PR adds an option to automatically detect the Kubernetes schema by parsing the contents of the document. In case a Kubernetes GroupVersionKind (GVK) is detected, the matching schema is retrieved from the CRD catalog.
What issues does this PR fix or reference?
#605
Is it tested? How?
Tests for parsing the Kubernetes Group Version Kind have been added
Please let me know if this can get merged. I think it improves the usability of the langugage server in Kubernetes environments significantly. If there is anything I can change to get this merged, please let me know!