<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Generators on Component Operator Runtime</title><link>https://sap.github.io/component-operator-runtime/docs/concepts/controller-runtime/generators/</link><description>Recent content in Generators on Component Operator Runtime</description><generator>Hugo</generator><language>en-us</language><atom:link href="https://sap.github.io/component-operator-runtime/docs/concepts/controller-runtime/generators/index.xml" rel="self" type="application/rss+xml"/><item><title>Transforming Existing Generators</title><link>https://sap.github.io/component-operator-runtime/docs/concepts/controller-runtime/generators/transformers/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://sap.github.io/component-operator-runtime/docs/concepts/controller-runtime/generators/transformers/</guid><description>&lt;p&gt;Sometimes it is desirable to reuse an existing &lt;a href="../"&gt;generator&lt;/a&gt;, but adjust its &lt;em&gt;input&lt;/em&gt;
(the parameters passed to the generation step) or its &lt;em&gt;output&lt;/em&gt; (the object manifests it
returns) — for example to inject computed values, or to patch rendered objects. This is
done by wrapping any &lt;code&gt;Generator&lt;/code&gt; into a &lt;code&gt;TransformableGenerator&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-go" data-lang="go"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#00f"&gt;package&lt;/span&gt; manifests
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#008000"&gt;// Interface for generators that can be enhanced with parameter/object transformers.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#00f"&gt;type&lt;/span&gt; TransformableGenerator &lt;span style="color:#00f"&gt;interface&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;	Generator
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;	WithParameterTransformer(transformer ParameterTransformer) TransformableGenerator
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;	WithObjectTransformer(transformer ObjectTransformer) TransformableGenerator
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#008000"&gt;// Wrap an existing generator into a TransformableGenerator.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#00f"&gt;func&lt;/span&gt; NewGenerator(generator Generator) TransformableGenerator
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Transformers are attached through the fluent &lt;code&gt;WithParameterTransformer()&lt;/code&gt; and
&lt;code&gt;WithObjectTransformer()&lt;/code&gt; methods (which return the generator again, so calls can be
chained). Multiple transformers of each kind can be attached and are applied in order.
The transformation logic itself is provided by implementing:&lt;/p&gt;</description></item><item><title>Helm Generator</title><link>https://sap.github.io/component-operator-runtime/docs/concepts/controller-runtime/generators/helm/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://sap.github.io/component-operator-runtime/docs/concepts/controller-runtime/generators/helm/</guid><description>&lt;p&gt;If a component already has a productive Helm chart, the &lt;code&gt;HelmGenerator&lt;/code&gt; implementation
(package &lt;code&gt;pkg/manifests/helm&lt;/code&gt;) can render it:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-go" data-lang="go"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#00f"&gt;package&lt;/span&gt; helm
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#00f"&gt;func&lt;/span&gt; NewHelmGenerator(fsys fs.FS, chartPath &lt;span style="color:#2b91af"&gt;string&lt;/span&gt;, clnt client.Client) (*HelmGenerator, &lt;span style="color:#2b91af"&gt;error&lt;/span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;fsys&lt;/code&gt; must be an &lt;code&gt;fs.FS&lt;/code&gt; implementation (such as an &lt;code&gt;embed.FS&lt;/code&gt;), or &lt;code&gt;nil&lt;/code&gt;. If &lt;code&gt;nil&lt;/code&gt;,
all file operations are performed on the OS filesystem, and &lt;code&gt;chartPath&lt;/code&gt; may be an
absolute path or a path relative to the controller&amp;rsquo;s working directory. If &lt;code&gt;fsys&lt;/code&gt; is
non-nil, &lt;code&gt;chartPath&lt;/code&gt; should be relative (an absolute path is turned into a relative one
by stripping the leading slash). When using a real filesystem, &lt;code&gt;os.Root.FS()&lt;/code&gt; is
recommended over &lt;code&gt;os.DirFS()&lt;/code&gt; in order to fence symbolic links. An empty &lt;code&gt;chartPath&lt;/code&gt; is
treated like &lt;code&gt;.&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;clnt&lt;/code&gt; is &lt;strong&gt;deprecated and ignored&lt;/strong&gt;; it will be removed in a future release. The
clients used at generation time are taken from the context instead.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Transformable variants are available as &lt;code&gt;NewTransformableHelmGenerator()&lt;/code&gt;,
&lt;code&gt;NewHelmGeneratorWithParameterTransformer()&lt;/code&gt;, and
&lt;code&gt;NewHelmGeneratorWithObjectTransformer()&lt;/code&gt; (see
&lt;a href="../transformers/"&gt;Transforming Existing Generators&lt;/a&gt;).&lt;/p&gt;</description></item><item><title>Kustomize Generator</title><link>https://sap.github.io/component-operator-runtime/docs/concepts/controller-runtime/generators/kustomize/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://sap.github.io/component-operator-runtime/docs/concepts/controller-runtime/generators/kustomize/</guid><description>&lt;p&gt;The &lt;code&gt;KustomizeGenerator&lt;/code&gt; (package &lt;code&gt;pkg/manifests/kustomize&lt;/code&gt;) renders the component&amp;rsquo;s
resources from a given kustomization. As a special case, one or more plain Kubernetes
manifests (without a &lt;code&gt;kustomization.yaml&lt;/code&gt;) are supported as well. In addition, all (or
selected) files in the kustomization directory can be templatized in a Helm-ish way:
they are treated as a common template group, and the well-known template function set
available in Helm can be used — that is, all &lt;a href="http://masterminds.github.io/sprig"&gt;sprig&lt;/a&gt;
functions, plus functions like &lt;code&gt;include&lt;/code&gt;, &lt;code&gt;tpl&lt;/code&gt;, &lt;code&gt;lookup&lt;/code&gt;, and the following:&lt;/p&gt;</description></item></channel></rss>