deckhand.engine.layering module

class deckhand.engine.layering.DocumentLayering(documents, validate=True, fail_on_missing_sub_src=True, encryption_sources=None, cleartext_secrets=False)[source]

Bases: object

Class responsible for handling document layering.

Layering is controlled in two places:

  1. The LayeringPolicy control document, which defines the valid layers and their order of precedence.
  2. In the metadata.layeringDefinition section of normal (metadata.schema=metadata/Document/v1.0) documents.

Note

Only documents with the same schema are allowed to be layered together into a fully rendered document.

documents
render()[source]

Perform layering on the list of documents passed to __init__.

Each concrete document will undergo layering according to the actions defined by its metadata.layeringDefinition. Documents are layered with their parents. A parent document’s schema must match that of the child, and its metadata.labels must much the child’s metadata.layeringDefinition.parentSelector.

Returns:

The list of concrete rendered documents.

Return type:

List[dict]

Raises:
  • UnsupportedActionMethod – If the layering action isn’t found among self.SUPPORTED_METHODS.
  • MissingDocumentKey – If a layering action path isn’t found in both the parent and child documents being layered together.
secrets_substitution