A very common pattern with this approach is to have an entry in the template that resolves to the value at the same YAML path in the document being compared. This is repetitive and therefore a potential source of error, particularly with longer paths or more complex documents.
Example:
For the document:
spec:
template:
metadata:
name: ThisNameCanBeAnything
the current template would have to look like:
spec:
template:
metadata:
name: {{ .spec.template.metadata.name }}
If there were to be a shorthand for this operation it could look like:
spec:
template:
metadata:
name: {{ anything() }}
Consider this a discussion of:
- is it possible and worthwhile to include a shorthand for "replace this with the value from the same yaml path"?
- is this worth implementing only for trivial cases (i.e. only when the full path already exists in the template)?
A very common pattern with this approach is to have an entry in the template that resolves to the value at the same YAML path in the document being compared. This is repetitive and therefore a potential source of error, particularly with longer paths or more complex documents.
Example:
For the document:
the current template would have to look like:
If there were to be a shorthand for this operation it could look like:
Consider this a discussion of: