Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: auto-detect Kubernetes schema #962

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

msvechla
Copy link

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!

automatically detect the Kubernetes schema based on the document's
GroupVersionKind (GVK) and retrieve the matching schema from the
CRD catalog.
@coveralls
Copy link

coveralls commented May 28, 2024

Coverage Status

coverage: 83.816% (-0.3%) from 84.138%
when pulling b214e05 on msvechla:crd
into 0e17579 on redhat-developer:main.

@qvalentin
Copy link

qvalentin commented Oct 6, 2024

Really nice, even works great with helm-ls (with some small tweaks to helm-ls).

image

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).

Unable to load schema from 'https://raw.githubusercontent.com/datreeio/CRDs-catalog/main/autoscaling/horizontalpodautoscaler_v2.json': 404: Not Found. [768]

@coveralls
Copy link

Coverage Status

coverage: 83.933% (-0.3%) from 84.254%
when pulling 6ca861f on msvechla:crd
into 1e3d5ce on redhat-developer:main.

Copy link
Contributor

@msivasubramaniaan msivasubramaniaan left a comment

Choose a reason for hiding this comment

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

Please handle the negative test scenarios as well

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.

4 participants