<p>I am trying to generate yaml output with kubectl --dry-run.</p>
<p>When I run this</p>
<pre><code>$ kubectl create configmap my-config-map  -o yaml --dry-run=client | kubectl annotate -f- --dry-run=client -o yaml --local this-is-my-target-directory='{{ template &quot;This.is.long.path.for.some.value&quot; . }}'
</code></pre>
<p>I get the following output where annotations are splitting into 2 lines.</p>
<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
  annotations:
    this-is-my-target-directory: '{{ template &quot;This.is.long.path.for.some.value&quot; .
      }}'
  creationTimestamp: null
  name: my-config-map
</code></pre>
<p>my desired output is that annotations should be in one line. like below</p>
<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
  annotations:
    this-is-my-target-directory: '{{ template &quot;This.is.long.path.for.some.value&quot; . }}'
  creationTimestamp: null
  name: my-config-map
</code></pre>
<p>If I reduce the size of the string then it becomes 1 line. I could not find anywhere in the documentation anything about line length. Can anyone guide me on how to fix this?</p>

<p>I think you can't find anything because this is a totally valid yaml. So I guess you can use it as it's without the need to put the curly brackets at the same line.</p>
