An opinionated way to build and maintain complex YAML documents

lucasepe

Luca Sepe

Posted on March 21, 2022

An opinionated way to build and maintain complex YAML documents

dirty - Directory to YAML

Create YAML documents from a directory tree.

Build a YAML document from a directory tree containing YAML fragments.

It is useful everywhere complex YAML configuration is employed:

  • CI pipelines
  • Crossplane Compositions
  • Kubernetes manifests, etc.

For instance, Kubernetes resources can be complex, and in turn make the YAML very verbose.

The aim is to make the document easier to reason about and maintain.

How to use

dirty parses a directory tree:

  • a directory is a yaml key
  • a file (a yaml fragment) has content that is rendered at the current indentation level

Check this Crossplane Composition as example: https://github.com/lucasepe/dirty/tree/main/testdata/platform-ref-aws/cluster/eks

Here the repo link: https://github.com/lucasepe/dirty

Regards,
Luca

💖 💪 🙅 🚩
lucasepe
Luca Sepe

Posted on March 21, 2022

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related