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

switch schema for kubernetes #73

Open
manlme opened this issue Dec 5, 2022 · 3 comments
Open

switch schema for kubernetes #73

manlme opened this issue Dec 5, 2022 · 3 comments

Comments

@manlme
Copy link

manlme commented Dec 5, 2022

I tried to switch the version of kubernetes schema with both url and local file as below in yaml.schemas. it's always report the error and the completion is not working well. when using keyword kubernete. but the schema version for kubernete from dist/languageserver.js is too old. where did this file generated and how?

{
  "yaml.enable":true,
  "yaml.schemas":{
    "file:///Users/xxx/workspace/kubernetes-json-schema/v1.22.5-standalone-strict/all.json":"abc.yaml"
  }
}

the error

  Matches multiple schemas when only one must validate. (yaml-schema: file:///
  Users/xxx/workspace/kubernetes-json-schema/v1.22.5-standalone-strict/all.
  json)

CocInfo

## versions

vim version: NVIM v0.8.0
node version: v19.0.1
coc.nvim version: 0.0.82-55f0f9e 2022-12-04 04:50:13 +0800
coc.nvim directory: /Users/manfred/.cache/vimfiles/repos/github.com/neoclide/coc.nvim
term: iTerm.app
platform: darwin

@manlme manlme changed the title switch schema for kubernetes is not easy switch schema for kubernetes Dec 5, 2022
@adamors
Copy link

adamors commented Feb 24, 2023

Seems this issue is coming from the YAML language server see someone else trying to fix it there: redhat-developer/yaml-language-server#841

See also redhat-developer/yaml-language-server#312 etc.

One workaround would be to edit .config/coc/extensions/node_modules/coc-yaml/dist/languageserver.jsand find KUBERNETES_SCHEMA_URL and change the URL. It's hardcoded to https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.20.5-standalone-strict/all.json

@Jeansen
Copy link

Jeansen commented Jun 18, 2023

Why is it hard-coded? It would be fare more flexible to set this e.g. by configuration or environment variables. 1.20.5 is mildly spoken: old.

@chemzqm
Copy link
Member

chemzqm commented Sep 5, 2023

Need upgrade for the language server.

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

No branches or pull requests

4 participants