Orchestra Manifests for Visual Studio Code
Editor support for orchestra
manifests: the YAML files under manifests/ that describe Proxmox virtual
machines, cloud-init snippets, images, secrets, clusters and templates.
What it does
- Highlighting on top of YAML:
kind and inherit values, apiVersion,
patch operations (set, replace, append, merge), *Ref keys,
minijinja expressions [[ ... ]], statements {% ... %} and comments
{# ... #}, and ${VAR} / $VAR environment references inside
cloud-init content and Cluster params.
- Validation and completion through the
YAML extension:
a JSON schema for every kind, with the same field set and defaults that
orchestra accepts (
deny_unknown_fields included), hover documentation
and completion for enums such as CPU models or disk interfaces.
- Snippets:
orchestra-vm, orchestra-template, orchestra-patch,
orchestra-cluster, orchestra-cloudinit, orchestra-image,
orchestra-secret.
Which files
The schema is attached to **/manifests/**/*.yaml, **/manifests/**/*.yml
and *.orchestra.yaml. For a manifest anywhere else, add a modeline to the
first line:
# yaml-language-server: $schema=https://raw.githubusercontent.com/GlobalArtInc/orchestra/main/editors/vscode/schemas/manifest.schema.json
Highlighting applies to every YAML file; it only reacts to orchestra
constructs, so ordinary YAML is left as it was.
Install
From a release .vsix:
code --install-extension orchestra-manifests-0.1.0.vsix
From source:
cd editors/vscode
npm install
npm run package
code --install-extension orchestra-manifests-*.vsix
Notes
A VirtualMachine that inherits a Template (template.ref) is allowed to
omit node, memory and cpu; the schema cannot see the template, so
whatever the template does not provide is reported by orchestra validate,
not by the editor.