Skip to content

Commit

Permalink
Fri 08 Nov 2024 08:36:17 AM PST
Browse files Browse the repository at this point in the history
  • Loading branch information
ingydotnet committed Nov 8, 2024
1 parent d21191d commit 023ecb1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion feed.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3692,7 +3692,8 @@ system.</p>
<pre class="language-yaml"><code class="language-yaml"> <span class="token key atrule">spec</span><span class="token punctuation">:</span><br> <span class="token punctuation">{</span><span class="token punctuation">{</span><span class="token punctuation">-</span> with .Values.volumes <span class="token punctuation">}</span><span class="token punctuation">}</span><br> <span class="token key atrule">volumes</span><span class="token punctuation">:</span><br> <span class="token punctuation">{</span><span class="token punctuation">{</span><span class="token punctuation">-</span> toYaml . <span class="token punctuation">|</span> nindent 8 <span class="token punctuation">}</span><span class="token punctuation">}</span><br> <span class="token punctuation">{</span><span class="token punctuation">{</span><span class="token punctuation">-</span> end <span class="token punctuation">}</span><span class="token punctuation">}</span><br> <span class="token punctuation">{</span><span class="token punctuation">{</span><span class="token punctuation">-</span> with .Values.nodeSelector <span class="token punctuation">}</span><span class="token punctuation">}</span><br> <span class="token key atrule">nodeSelector</span><span class="token punctuation">:</span><br> <span class="token punctuation">{</span><span class="token punctuation">{</span><span class="token punctuation">-</span> toYaml . <span class="token punctuation">|</span> nindent 8 <span class="token punctuation">}</span><span class="token punctuation">}</span><br> <span class="token punctuation">{</span><span class="token punctuation">{</span><span class="token punctuation">-</span> end <span class="token punctuation">}</span><span class="token punctuation">}</span></code></pre>
<p>With YAMLScript, you can write this as:</p>
<pre class="language-yaml"><code class="language-yaml"> <span class="token key atrule">spec</span><span class="token punctuation">:</span><br> <span class="token punctuation">:</span>when+ Values.volumes.<span class="token punctuation">?</span><span class="token punctuation">:</span><span class="token punctuation">:</span> <span class="token punctuation">{</span>volumes<span class="token punctuation">:</span><span class="token punctuation">:</span> _<span class="token punctuation">}</span><br> <span class="token punctuation">:</span>when+ Values.nodeSelector.<span class="token punctuation">?</span><span class="token punctuation">:</span><span class="token punctuation">:</span><br> nodeSelector<span class="token punctuation">:</span><span class="token punctuation">:</span> _</code></pre>
<p>Not only is the YAMLScript version much shorter and easier to read, its also
<p>X
Not only is the YAMLScript version much shorter and easier to read, its also
valid YAML.
That means it can be maintained using other YAML tools, like <code>yamllint</code>.
It also gets rid of the need for the <code>nindent</code> explicit indenting function,
Expand Down
Loading

0 comments on commit 023ecb1

Please sign in to comment.