Ever needed to make quick edit in RKE's cluster.yaml
configuration file, but
didn't rember the exact name of a key? Or what that other parameter five lines
below meant? And preferably check beforehands whether the configuration file is
valid instead of testing it in production?
Now you can get all of that from within Visual Studio Code using this extension!
The extension builds upon the YAML plugin for VSCode and adds the following capabilities:
- Autocompletion of Configuration keys and values:
- The configuration file is automatically checked against the schema and errors are highlighted:
- Hovering over a a key in the configuration file will show the documentation of that option (if available):
- You can use Breadcrumbs to quickly jump through the configuration file (these are provided by the YAML extension):
And the best part? If you are already using the
YAML
plugin, then you don't have to anything to get these features! VSCode will
provide you with all of the above as long as your configuration file is called
cluster.yml
or cluster.yaml
.
Requirements:
- go
- nodejs and yarn
The schema is generated using the
alecthomas/jsonschema module from
the structs in
rancher/rke/blob/master/types/rke_types.go.
This is performed by dump_cluster_config_schema.go
with some additional post
processing steps performed in process-schema
(the $schema
key is removed,
because the validator fails to handle it and the extracted documentation is
added as the description field) via yarn run schema
.