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

How I can change version kubernetes schema from 1.22.4 to another #61

Open
pilot513 opened this issue Apr 14, 2022 · 9 comments
Open

How I can change version kubernetes schema from 1.22.4 to another #61

pilot513 opened this issue Apr 14, 2022 · 9 comments

Comments

@pilot513
Copy link

In last update I found that in coc-yaml used
KUBERNETES_SCHEMA_URL="https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.22.4-standalone-strict/all.json"

How is it possible to change, for example, to 1.19.7 or 1.23.5 ?

@barn
Copy link

barn commented May 26, 2022

Did adding this JSON to your :CocConfig (~/.vim/coc-settings.json for me) work at all? It's vaguely working for me I think.

{
  "yaml.schemas": {
          "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.23.5-standalone-strict/all.json": [ "/*.yaml" ]
  }
}

@pilot513
Copy link
Author

pilot513 commented May 27, 2022

My coc-settings.json looks like that:
изображение
But when I start typing, the autocomplete doesn't work:
изображение

When I start editing the settings file, autocomplete works. I don't understand what is wrong with the yaml schema:
изображение
Can someone please explain why the above schema doesn't work with yaml???

@pilot513
Copy link
Author

By default settings schema ("kubernetes": "/*.yaml" (1.22.4)
изображение

and autocomplete works

@pilot513
Copy link
Author

Can someone explain why that is?

So, the schema 1.23.5 is accessed:
изображение

@barn
Copy link

barn commented May 27, 2022

what path is it set to? "/*.yaml"

@barn
Copy link

barn commented May 27, 2022

no idea how YAML will handle the bare string, so try quoting it in "?

@pilot513
Copy link
Author

So everything is, in doublequotation marks. It's just that the coc-json plugin does not display them:
изображение

@barn
Copy link

barn commented May 28, 2022

Screenshot 2022-05-27 at 23 24 01

is what I appear to have with:

{

  // https://github.com/dense-analysis/ale#faq-coc-nvim
  "diagnostic.displayByAle": true,

  // no idea if these even arent default.
  "yaml.completion": true,
  "yaml.format": true,
  "yaml.validate": true,
  "yaml.schemaStoreEnabled": true,
  "json.format.enable": true,

  // https://octetz.com/c/vim-k8s-yaml-support/
  "yaml.schemas": {
     // Use https://github.com/yannh/kubernetes-json-schema as they're actually updated.
     "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.23.5-standalone-strict/all.json": [ "/*.yaml" ]

     // Local copy of above, purely so it has a better filename in coc-yaml
     // "//Users/bea/.vim/k8s-v1.22.4-standalone-strict.json": [ "/*.yaml" ]
  }
}

This is my :CocInfo

## versions

vim version: VIM - Vi IMproved 8.2 8025000
node version: v18.2.0
coc.nvim version: 0.0.81-21a8e00b 2022-05-26 03:12:31 +0800
coc.nvim directory: /Users/bea/.vim/plug/coc.nvim
term: iTerm.app
platform: darwin

If that helps at all? Though I am not sure I have been any.

@pilot513
Copy link
Author

Oh, thank you very much! Earned!
изображение

The difference is in the options:
изображение

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

2 participants