-
Notifications
You must be signed in to change notification settings - Fork 19
Description
Describe the Feature
When processing k8s yaml files, it's very common that these have multi-document yaml files.
At the moment there are not many general and well supported ways of getting these files into HCL-land.
Since the deep_merge method is also one of the only ways to do a common yaml operation in HCL, I would like to kindly suggest that a method to parse multi-document YAMLs into a list of individual YAMLs (ie, into list(str)).
Expected Behavior
parsing a YAML file (str) into a list of YAMLs (list(str))
if file is already single document, a list with only 1 string will be returned.
Use Case
Processing of k8s manifest files (and flux2 files, and ...)
Describe Ideal Solution
parsing a YAML file (str) into a list of YAMLs (list(str))
if file is already single document, a list with only 1 string will be returned.
Alternatives Considered
There is currently something similar in alekc/kubectl (from gavinbunney/kubectl) in the form of kubectl_file_documents and kubectl_path_documents, but this is not generic YAML.
A discussion on adding similar capabilities to terraform here hashicorp/terraform#29729
Additional Context
No response