View on GitHub

yaml-overlay-tool

Use JSONPath to query & patch YAML files with ease.

Back to Table of contents

YAML Overlay Tool features

Here’s a quick introduction to YAML Overlay Tool’s set of features, and why you might want to consider using the tool.

  1. JSONPath queries
    • Yot uses JSONPath to lookup data from existing YAML documents within YAML files
    • Provides the user a familiar interface and a means to extend existing skills
    • Allows for convenient data manipulation
  2. Ability to delete unneeded data from YAML documents
  3. Ability to inject new data into YAML documents when a JSONPath query returns no results
  4. Ability to merge new data with existing data in YAML documents
  5. Ability to replace existing data with new data in YAML documents
  6. Ability to combine existing values returned from your JSONPath query with new values of the same type
    • Allows for integer addition
    • Allows for string concatenation
    • Allows for boolean addition
  7. Ability to remove existing comments from YAML documents prior to further manipulation of the data
  8. Ability to manipulate the value of data returned from JSONPath queries
    • By the use of your JSONPathquery and format markers an end-user can take the returned original data and manipulate it with or without a sed implementation
  9. Ability to both preserve and inject new comments into a YAML document
    • This is useful for additional tooling that can consume comments
    • Useful when you want to leave end-users of the configuration notes as to why something is setup the way it is
  10. Ability to perform one-off overlays from the CLI
  11. Declarative YAML specification (instructions file) to direct yot on how to manipulate the YAML data
  12. Three levels of specificity in regards to how to manipulate YAML documents within YAML files
    1. commonOverlays affect all YAML documents with all YAML files
    2. overlays affect all YAML documents within a specific YAML file
    3. documents affect a specific YAML document within a specific YAML file
  13. Overlay Qualifiers provide a way to conditionally apply overlays to a YAML document
    • Groups of conditions that must all match
    • Multiple conditions groups act as an implicit or, meaning if all the conditions of one of the groups match, the overlay will be applied
  14. Ability to operate on a single YAML file or entire directories of YAML files from anywhere on the filesystem
  15. Ability to redirect where an overlayed YAML file will be placed within the output directory with the outputPath key
    • When working with directories, a secondary listing of a specific filename can also be made to override where its final output location will be
  16. Ability to use Go templating and Go templating Sprig functions within the instructions file

Back to Table of contents
Next Up: Installation and setup