Skip to content
This repository has been archived by the owner on Jun 13, 2023. It is now read-only.

dcermak/vscode-rke-cluster-config

Repository files navigation

VSCode extension for RKE Cluster Configuration files

Visual Studio Marketplace Open VSX Marketplace extension build schema check go tests License styled with prettier

VSCode extension for RKE cluster configuration

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!

Features

The extension builds upon the YAML plugin for VSCode and adds the following capabilities:

  • Autocompletion of Configuration keys and values:

autocomplete

  • The configuration file is automatically checked against the schema and errors are highlighted:

linting_error

  • Hovering over a a key in the configuration file will show the documentation of that option (if available):

doc_on_hover

  • You can use Breadcrumbs to quickly jump through the configuration file (these are provided by the YAML extension):

breadcrumbs

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.

Development

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.