<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Genop</title><link>https://genop-0d6168.gitlab.io/</link><description>Recent content on Genop</description><generator>Hugo</generator><language>en-us</language><atom:link href="https://genop-0d6168.gitlab.io/index.xml" rel="self" type="application/rss+xml"/><item><title>Adding a Resource</title><link>https://genop-0d6168.gitlab.io/guides/adding-a-resource/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://genop-0d6168.gitlab.io/guides/adding-a-resource/</guid><description>&lt;h1 id="adding-a-resource"&gt;Adding a resource&lt;a class="anchor" href="#adding-a-resource"&gt;#&lt;/a&gt;&lt;/h1&gt;&#10;&lt;h2 id="add-a-project"&gt;Add a project&lt;a class="anchor" href="#add-a-project"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;genop create project postgresql --api-group postgresql.acme.io&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Registers a new project in the topology, then applies: scaffolds its Helm&#10;chart, &lt;code&gt;README.md&lt;/code&gt;, &lt;code&gt;DEVELOPMENT.md&lt;/code&gt;, e2e suite and Makefile targets. The&#10;project starts with no controller and no resource.&lt;/p&gt;&#10;&lt;table&gt;&#10;&#9;&lt;thead&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Flag&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Short&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Required&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Description&lt;/th&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/thead&gt;&#10;&#9;&lt;tbody&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;code&gt;--api-group&lt;/code&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;code&gt;-g&lt;/code&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;✓&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;The API group, e.g. &lt;code&gt;{project}.acme.io&lt;/code&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;code&gt;--path&lt;/code&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Filesystem path relative to the repo root (defaults to the project name)&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;code&gt;--kustomize&lt;/code&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Enable kustomize packaging (default &lt;code&gt;true&lt;/code&gt;)&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;code&gt;--helm&lt;/code&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Enable helm packaging (default &lt;code&gt;false&lt;/code&gt;)&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/tbody&gt;&#10;&lt;/table&gt;&#10;&lt;p&gt;At least one of &lt;code&gt;--kustomize&lt;/code&gt; / &lt;code&gt;--helm&lt;/code&gt; must stay enabled.&lt;/p&gt;</description></item><item><title>CLI Reference</title><link>https://genop-0d6168.gitlab.io/reference/cli/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://genop-0d6168.gitlab.io/reference/cli/</guid><description>&lt;h1 id="cli-reference"&gt;CLI Reference&lt;a class="anchor" href="#cli-reference"&gt;#&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;All commands read &lt;code&gt;.genop.yaml&lt;/code&gt; from the current directory (or the nearest parent that contains one). &lt;code&gt;genop apply&lt;/code&gt; is the sole generator: every &lt;code&gt;genop create&lt;/code&gt; command validates its arguments, updates &lt;code&gt;.genop.yaml&lt;/code&gt;, and finishes by running &lt;code&gt;apply&lt;/code&gt; itself — there is no separate step where you write the topology and remember to apply it, so the file and the generated code never drift apart because a step was skipped.&lt;/p&gt;&#10;&lt;h3 id="genop-apply--regenerate-scaffolding-from-genopyaml"&gt;&lt;code&gt;genop apply&lt;/code&gt; — Regenerate scaffolding from &lt;code&gt;.genop.yaml&lt;/code&gt;&lt;a class="anchor" href="#genop-apply--regenerate-scaffolding-from-genopyaml"&gt;#&lt;/a&gt;&lt;/h3&gt;&#10;&lt;p&gt;Reads the topology and brings the repository back in line with it. This is the command every &lt;code&gt;genop create&lt;/code&gt; subcommand runs internally, and the one to reach for directly when you have hand-edited &lt;code&gt;.genop.yaml&lt;/code&gt; or lost a generated file.&lt;/p&gt;</description></item><item><title>Codebase Architecture</title><link>https://genop-0d6168.gitlab.io/contributing/architecture/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://genop-0d6168.gitlab.io/contributing/architecture/</guid><description>&lt;h1 id="codebase-architecture"&gt;Codebase architecture&lt;a class="anchor" href="#codebase-architecture"&gt;#&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;genop is a pure code-generation CLI: it never talks to a Kubernetes&#10;cluster itself. Every command&amp;rsquo;s job is to compute a set of file operations&#10;and apply them to disk.&lt;/p&gt;&#10;&lt;h2 id="builders-and-fileoperation"&gt;Builders and &lt;code&gt;FileOperation&lt;/code&gt;&lt;a class="anchor" href="#builders-and-fileoperation"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;Multi-file code generation is organized around &lt;strong&gt;builders&lt;/strong&gt;&#10;(&lt;code&gt;ProjectBuilder&lt;/code&gt;, &lt;code&gt;ApiBuilder&lt;/code&gt;, &lt;code&gt;StepBuilder&lt;/code&gt; in &lt;code&gt;cmd/cli/&lt;/code&gt;): each accumulates&#10;a slice of &lt;code&gt;FileOperation&lt;/code&gt; values — create a file, insert at a marker,&#10;rewrite between two markers — and only writes them to disk at the end, after&#10;every builder in the chain has had a chance to contribute. &lt;code&gt;genop apply&lt;/code&gt;&#10;runs &lt;code&gt;ProjectBuilder&lt;/code&gt; → &lt;code&gt;ApiBuilder&lt;/code&gt; → &lt;code&gt;StepBuilder&lt;/code&gt; for each operator, then&#10;a shared packaging pass that regenerates Kustomize/Helm manifests from the&#10;topology.&lt;/p&gt;</description></item><item><title>Reconciler Lifecycle</title><link>https://genop-0d6168.gitlab.io/concepts/lifecycle-and-phases/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://genop-0d6168.gitlab.io/concepts/lifecycle-and-phases/</guid><description>&lt;h1 id="reconciler-lifecycle"&gt;Reconciler lifecycle&lt;a class="anchor" href="#reconciler-lifecycle"&gt;#&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;When a custom resource is created, updated, or deleted, genop runs your&#10;reconcilers in order. You never write a &lt;code&gt;Reconcile(ctx, req)&lt;/code&gt; function —&#10;instead, you implement focused interfaces.&lt;/p&gt;&#10;&lt;h2 id="create--update"&gt;Create / Update&lt;a class="anchor" href="#create--update"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;Implement &lt;code&gt;ApplyStep[S, T]&lt;/code&gt;:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-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:#66d9ef"&gt;func&lt;/span&gt; (&lt;span style="color:#a6e22e"&gt;r&lt;/span&gt; &lt;span style="color:#f92672"&gt;*&lt;/span&gt;&lt;span style="color:#a6e22e"&gt;ProvisionDatabase&lt;/span&gt;) &lt;span style="color:#a6e22e"&gt;GetConditionType&lt;/span&gt;() &lt;span style="color:#66d9ef"&gt;string&lt;/span&gt; {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;return&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#34;DatabaseProvisioned&amp;#34;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;}&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;func&lt;/span&gt; (&lt;span style="color:#a6e22e"&gt;r&lt;/span&gt; &lt;span style="color:#f92672"&gt;*&lt;/span&gt;&lt;span style="color:#a6e22e"&gt;ProvisionDatabase&lt;/span&gt;) &lt;span style="color:#a6e22e"&gt;Apply&lt;/span&gt;(&lt;span style="color:#a6e22e"&gt;ctx&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;context&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;Context&lt;/span&gt;, &lt;span style="color:#a6e22e"&gt;logger&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;logr&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;Logger&lt;/span&gt;, &lt;span style="color:#a6e22e"&gt;resource&lt;/span&gt; &lt;span style="color:#f92672"&gt;*&lt;/span&gt;&lt;span style="color:#a6e22e"&gt;v1alpha1&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;Database&lt;/span&gt;) (&lt;span style="color:#a6e22e"&gt;ctrl&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;Result&lt;/span&gt;, &lt;span style="color:#66d9ef"&gt;string&lt;/span&gt;, &lt;span style="color:#66d9ef"&gt;error&lt;/span&gt;) {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#75715e"&gt;// Your logic here: call an external API, create a child resource, etc.&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;return&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;operators&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;Succeed&lt;/span&gt;()&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="delete"&gt;Delete&lt;a class="anchor" href="#delete"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;Implement &lt;code&gt;DeletionStep[S, T]&lt;/code&gt;:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-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:#66d9ef"&gt;func&lt;/span&gt; (&lt;span style="color:#a6e22e"&gt;r&lt;/span&gt; &lt;span style="color:#f92672"&gt;*&lt;/span&gt;&lt;span style="color:#a6e22e"&gt;DeprovisionDatabase&lt;/span&gt;) &lt;span style="color:#a6e22e"&gt;GetConditionType&lt;/span&gt;() &lt;span style="color:#66d9ef"&gt;string&lt;/span&gt; {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;return&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#34;DatabaseProvisioned&amp;#34;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;}&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;func&lt;/span&gt; (&lt;span style="color:#a6e22e"&gt;r&lt;/span&gt; &lt;span style="color:#f92672"&gt;*&lt;/span&gt;&lt;span style="color:#a6e22e"&gt;DeprovisionDatabase&lt;/span&gt;) &lt;span style="color:#a6e22e"&gt;Delete&lt;/span&gt;(&lt;span style="color:#a6e22e"&gt;ctx&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;context&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;Context&lt;/span&gt;, &lt;span style="color:#a6e22e"&gt;logger&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;logr&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;Logger&lt;/span&gt;, &lt;span style="color:#a6e22e"&gt;resource&lt;/span&gt; &lt;span style="color:#f92672"&gt;*&lt;/span&gt;&lt;span style="color:#a6e22e"&gt;v1alpha1&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;Database&lt;/span&gt;) (&lt;span style="color:#a6e22e"&gt;ctrl&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;Result&lt;/span&gt;, &lt;span style="color:#66d9ef"&gt;string&lt;/span&gt;, &lt;span style="color:#66d9ef"&gt;error&lt;/span&gt;) {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#75715e"&gt;// Cleanup logic: delete external resources, revoke credentials, etc.&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;return&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;operators&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;Succeed&lt;/span&gt;()&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You don&amp;rsquo;t need to implement both. If your resource has no cleanup logic,&#10;omit the delete step and remove it from &lt;code&gt;WithDeletionSteps&lt;/code&gt; in &lt;code&gt;main.go&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>.genop.yaml Reference</title><link>https://genop-0d6168.gitlab.io/reference/topology/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://genop-0d6168.gitlab.io/reference/topology/</guid><description>&lt;!-- Code generated by hack/gen-topology-docs. DO NOT EDIT. --&gt;&#10;&lt;h1 id="genopyaml-reference"&gt;&lt;code&gt;.genop.yaml&lt;/code&gt; reference&lt;a class="anchor" href="#genopyaml-reference"&gt;#&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;This file is generated from the &lt;code&gt;Topology*&lt;/code&gt; structs in &lt;code&gt;cmd/cli/topology.go&lt;/code&gt;. It lists every field of &lt;code&gt;.genop.yaml&lt;/code&gt;, its type, whether it is required, its default and its meaning. Run &lt;code&gt;make docs&lt;/code&gt; to regenerate it, and &lt;code&gt;docs/genop.schema.json&lt;/code&gt; alongside it, after changing a topology struct.&lt;/p&gt;&#10;&lt;h2 id="projecttopology"&gt;&lt;code&gt;ProjectTopology&lt;/code&gt;&lt;a class="anchor" href="#projecttopology"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;ProjectTopology is the root type representing a genop project topology configuration.&lt;/p&gt;&#10;&lt;table&gt;&#10;&#9;&lt;thead&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Field&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Type&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Required&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Default&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Description&lt;/th&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/thead&gt;&#10;&#9;&lt;tbody&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;code&gt;apiVersion&lt;/code&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;code&gt;string&lt;/code&gt; (const &lt;code&gt;genop.kornercloud.dev/v1&lt;/code&gt;)&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;yes&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;APIVersion is the topology schema version. It must be &amp;ldquo;genop.kornercloud.dev/v1&amp;rdquo;; genop rejects any other value.&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;code&gt;kind&lt;/code&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;code&gt;string&lt;/code&gt; (const &lt;code&gt;ProjectTopology&lt;/code&gt;)&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;yes&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Kind identifies the document type. It must be &amp;ldquo;ProjectTopology&amp;rdquo;.&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;code&gt;spec&lt;/code&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;a href="#topologyspec"&gt;&lt;code&gt;TopologySpec&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;yes&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Spec holds the project topology: the Go module path, optional license configuration and the list of operators.&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/tbody&gt;&#10;&lt;/table&gt;&#10;&lt;h2 id="topologyspec"&gt;&lt;code&gt;TopologySpec&lt;/code&gt;&lt;a class="anchor" href="#topologyspec"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;TopologySpec contains the specification for a project topology.&lt;/p&gt;</description></item><item><title>Adding a Reconciler</title><link>https://genop-0d6168.gitlab.io/guides/adding-a-step/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://genop-0d6168.gitlab.io/guides/adding-a-step/</guid><description>&lt;h1 id="adding-a-reconciler"&gt;Adding a reconciler&lt;a class="anchor" href="#adding-a-reconciler"&gt;#&lt;/a&gt;&lt;/h1&gt;&#10;&lt;h2 id="steps"&gt;Steps&lt;a class="anchor" href="#steps"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;genop create step ProvisionDatabase &lt;span style="color:#ae81ff"&gt;\&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; --project postgresql &lt;span style="color:#ae81ff"&gt;\&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; --controller database &lt;span style="color:#ae81ff"&gt;\&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; --api-version v1alpha1 &lt;span style="color:#ae81ff"&gt;\&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; --kind Database&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Pass &lt;code&gt;--delete&lt;/code&gt; to add the step to the delete list instead of the apply&#10;list. &lt;code&gt;--condition-type&lt;/code&gt; is derived from the step name when omitted —&#10;&lt;code&gt;ProvisionDatabase&lt;/code&gt; becomes &lt;code&gt;DatabaseProvisioned&lt;/code&gt;. A step name whose verb&#10;genop does not recognise is rejected: pass &lt;code&gt;--condition-type&lt;/code&gt; explicitly.&lt;/p&gt;&#10;&lt;p&gt;This generates the reconciler file in the &lt;code&gt;apply/&lt;/code&gt; or &lt;code&gt;delete/&lt;/code&gt;&#10;subdirectory and wires it into &lt;code&gt;main.go&lt;/code&gt;. Steps live in phase&#10;subdirectories under the kind directory, each forming its own Go package:&lt;/p&gt;</description></item><item><title>Releasing</title><link>https://genop-0d6168.gitlab.io/contributing/releasing/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://genop-0d6168.gitlab.io/contributing/releasing/</guid><description>&lt;h1 id="releasing"&gt;Releasing&lt;a class="anchor" href="#releasing"&gt;#&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;genop and genop-runtime are released in &lt;strong&gt;lockstep&lt;/strong&gt; on matching&#10;version tags (&lt;code&gt;v0.1.0&lt;/code&gt;, &lt;code&gt;v0.2.0&lt;/code&gt;, &amp;hellip;): a cross-repo change lands as a&#10;genop-runtime branch, merged and tagged first, then a genop branch&#10;bumps &lt;code&gt;go.mod&lt;/code&gt; to that tag and does its own side of the change.&lt;/p&gt;&#10;&lt;p&gt;genop-testing is a &lt;strong&gt;third, independent&lt;/strong&gt; module (root package and&#10;&lt;code&gt;matchers&lt;/code&gt;) — it releases on its own cadence and is not part of&#10;the lockstep. Its &lt;code&gt;go.mod&lt;/code&gt; is deliberately pinned to the ecosystem floor&#10;(rather than the newest Kubernetes/controller-runtime versions) so it never&#10;force-upgrades consumers; that floor is a deliberate choice, not&#10;staleness — don&amp;rsquo;t &amp;ldquo;fix&amp;rdquo; it by bumping without checking why it&amp;rsquo;s pinned.&lt;/p&gt;</description></item><item><title>Status and Conditions</title><link>https://genop-0d6168.gitlab.io/concepts/status-and-conditions/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://genop-0d6168.gitlab.io/concepts/status-and-conditions/</guid><description>&lt;h1 id="resource-status"&gt;Resource status&lt;a class="anchor" href="#resource-status"&gt;#&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;Every resource embeds &lt;code&gt;BaseStatus&lt;/code&gt; which genop manages automatically. You&#10;generally don&amp;rsquo;t need to set these fields yourself — genop updates them&#10;based on your reconciler responses.&lt;/p&gt;&#10;&lt;h2 id="phases"&gt;Phases&lt;a class="anchor" href="#phases"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;table&gt;&#10;&#9;&lt;thead&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Phase&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Meaning&lt;/th&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/thead&gt;&#10;&#9;&lt;tbody&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;code&gt;Pending&lt;/code&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Resource was just created, waiting for first reconciliation&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;code&gt;Running&lt;/code&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Reconciliation is in progress or succeeded (check the &lt;code&gt;Ready&lt;/code&gt; condition to distinguish)&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;code&gt;Succeeded&lt;/code&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;All reconcilers completed, resource is fully reconciled&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;code&gt;Failed&lt;/code&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;A reconciler failed, backoff is in progress&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;code&gt;Deleting&lt;/code&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Resource is being deleted, delete reconcilers are running&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;code&gt;Unknown&lt;/code&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Resource state could not be determined (avoid this)&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/tbody&gt;&#10;&lt;/table&gt;&#10;&lt;h2 id="key-status-fields"&gt;Key status fields&lt;a class="anchor" href="#key-status-fields"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;table&gt;&#10;&#9;&lt;thead&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Field&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Description&lt;/th&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/thead&gt;&#10;&#9;&lt;tbody&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;code&gt;phase&lt;/code&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Current lifecycle phase (see above)&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;code&gt;message&lt;/code&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Human-readable message (set by &lt;code&gt;Fail&lt;/code&gt; / &lt;code&gt;Requeue&lt;/code&gt;)&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;code&gt;lastTransitionTime&lt;/code&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;When the last reconciliation occurred&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;code&gt;nextTransitionTime&lt;/code&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;When the next reconciliation is scheduled&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;code&gt;retryIndex&lt;/code&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Number of consecutive retries (reset on success)&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;code&gt;conditions&lt;/code&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Standard Kubernetes conditions list, including the &lt;code&gt;Ready&lt;/code&gt; condition (see below)&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/tbody&gt;&#10;&lt;/table&gt;&#10;&lt;h2 id="the-ready-condition"&gt;The Ready condition&lt;a class="anchor" href="#the-ready-condition"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;&lt;code&gt;BaseStatus&lt;/code&gt; exposes readiness as a standard &lt;code&gt;Ready&lt;/code&gt; condition (&lt;code&gt;Type: &amp;quot;Ready&amp;quot;&lt;/code&gt;)&#10;rather than a bare boolean field, so &lt;code&gt;kubectl wait --for=condition=Ready&lt;/code&gt; works&#10;against any resource built on genop:&lt;/p&gt;</description></item><item><title>Framework Packages</title><link>https://genop-0d6168.gitlab.io/reference/framework-packages/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://genop-0d6168.gitlab.io/reference/framework-packages/</guid><description>&lt;h1 id="framework-packages"&gt;Framework packages&lt;a class="anchor" href="#framework-packages"&gt;#&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;Utility packages from &lt;code&gt;genop-runtime&lt;/code&gt; and &lt;code&gt;genop-testing&lt;/code&gt;, useful in your own step/hook code&#10;and tests, beyond the &lt;code&gt;operators&lt;/code&gt;/&lt;code&gt;operators/model&lt;/code&gt; API covered elsewhere&#10;in these docs.&lt;/p&gt;&#10;&lt;h2 id="k8s--kubernetes-utilities"&gt;&lt;code&gt;k8s&lt;/code&gt; — Kubernetes utilities&lt;a class="anchor" href="#k8s--kubernetes-utilities"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;h3 id="createorupdate"&gt;&lt;code&gt;CreateOrUpdate&lt;/code&gt;&lt;a class="anchor" href="#createorupdate"&gt;#&lt;/a&gt;&lt;/h3&gt;&#10;&lt;p&gt;Creates a resource if it doesn&amp;rsquo;t exist, or fetches the live object and&#10;applies a set of &lt;code&gt;DiffFunction&lt;/code&gt;s to it — writing it back only if one of&#10;them actually changed something. Nothing is copied by default: pass a&#10;&lt;code&gt;DiffFunction&lt;/code&gt; for every field you want reconciled, including the spec if&#10;you want it kept in sync.&lt;/p&gt;</description></item><item><title>Deletion Policy</title><link>https://genop-0d6168.gitlab.io/concepts/deletion-policy/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://genop-0d6168.gitlab.io/concepts/deletion-policy/</guid><description>&lt;h1 id="deletion-policy"&gt;Deletion policy&lt;a class="anchor" href="#deletion-policy"&gt;#&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;Every resource has a &lt;code&gt;spec.lifecycle.deletionPolicy&lt;/code&gt; field:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;&lt;code&gt;Delete&lt;/code&gt;&lt;/strong&gt; (default): When the Kubernetes resource is deleted, genop&#10;runs your delete reconcilers to clean up external resources, then removes&#10;the finalizer.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;&lt;code&gt;Retain&lt;/code&gt;&lt;/strong&gt;: When the Kubernetes resource is deleted, genop removes the&#10;finalizer immediately without running delete reconcilers. External&#10;resources are left intact.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;A third option, &lt;code&gt;fromAncestor&lt;/code&gt;, delegates the decision to the top parent&#10;being deleted (via &lt;code&gt;ownerReferences&lt;/code&gt;) instead of a fixed policy on the&#10;resource itself — see&#10;&lt;a href="https://genop-0d6168.gitlab.io/reference/cli/#operator-configuration"&gt;Operator configuration&lt;/a&gt;&#10;for how to set it and the RBAC it requires.&lt;/p&gt;</description></item><item><title>Escape Hatches</title><link>https://genop-0d6168.gitlab.io/guides/escape-hatches/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://genop-0d6168.gitlab.io/guides/escape-hatches/</guid><description>&lt;h1 id="escape-hatches-keeping-hand-edits-safe-across-genop-apply"&gt;Escape hatches: keeping hand-edits safe across &lt;code&gt;genop apply&lt;/code&gt;&lt;a class="anchor" href="#escape-hatches-keeping-hand-edits-safe-across-genop-apply"&gt;#&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;Everything genop generates is one of two things:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;Regenerated on every &lt;code&gt;genop apply&lt;/code&gt;&lt;/strong&gt; — topology-driven, rewritten in&#10;full each time. Never hand-edit these regions; your edit is gone on the&#10;next apply. The &lt;code&gt;WithApplySteps&lt;/code&gt;/&lt;code&gt;WithDeletionSteps&lt;/code&gt; lists and the rest&#10;of the &lt;code&gt;// +genop:scaffold:cmd:controllers:begin/end&lt;/code&gt; block in &lt;code&gt;main.go&lt;/code&gt;&#10;are the main example.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Written once, yours forever&lt;/strong&gt; — created the first time (&lt;code&gt;genop create api&lt;/code&gt;/&lt;code&gt;genop create step&lt;/code&gt;), never touched again by any later &lt;code&gt;genop&lt;/code&gt;&#10;command. Step files, &lt;code&gt;operator_config.go&lt;/code&gt;, and the code between marked&#10;regions in &lt;code&gt;main.go&lt;/code&gt; are all like this.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;blockquote class='book-hint tip'&gt;&#10;&lt;p&gt;&lt;strong&gt;Before reaching for a hatch, check the topology.&lt;/strong&gt; Anything expressible in&#10;&lt;code&gt;.genop.yaml&lt;/code&gt; — adding a step or hook, the &lt;code&gt;operator:&lt;/code&gt; block (retry policy,&#10;backoff, deletion policy, &amp;hellip;), webhooks, metrics — is done by editing&#10;the file and running &lt;code&gt;genop apply&lt;/code&gt;, which regenerates the wiring for you.&#10;The hatches below are for what the topology can&amp;rsquo;t express.&lt;/p&gt;</description></item><item><title>Version Compatibility</title><link>https://genop-0d6168.gitlab.io/reference/compatibility/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://genop-0d6168.gitlab.io/reference/compatibility/</guid><description>&lt;h1 id="version-compatibility"&gt;Version compatibility&lt;a class="anchor" href="#version-compatibility"&gt;#&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;genop, genop-runtime, and genop-testing are three separate modules.&#10;genop and genop-runtime are released in lockstep on matching version&#10;tags; genop-testing releases independently, pinned to a floor rather than&#10;the newest ecosystem versions so it never force-upgrades consumers.&lt;/p&gt;&#10;&lt;p&gt;This table is hand-maintained, one row added per genop release — it is&#10;the human-readable form of the same fact &lt;code&gt;go.mod&lt;/code&gt; encodes and&#10;&lt;code&gt;test/e2e/utils_test.go&lt;/code&gt; reads at test time.&lt;/p&gt;&#10;&lt;table&gt;&#10;&#9;&lt;thead&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;genop&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;genop-runtime&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;genop-testing&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Notes&lt;/th&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/thead&gt;&#10;&#9;&lt;tbody&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;v0.1.0&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;v0.1.0&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;v0.1.0&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;First public release.&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/tbody&gt;&#10;&lt;/table&gt;&#10;&lt;p&gt;To add a row for a new release, check what this repo&amp;rsquo;s &lt;code&gt;go.mod&lt;/code&gt; required at&#10;that tag:&lt;/p&gt;</description></item><item><title>Backoff and Retry</title><link>https://genop-0d6168.gitlab.io/guides/backoff-and-retry/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://genop-0d6168.gitlab.io/guides/backoff-and-retry/</guid><description>&lt;h1 id="backoff-and-retry"&gt;Backoff and retry&lt;a class="anchor" href="#backoff-and-retry"&gt;#&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;When a reconciler fails (&lt;code&gt;Fail&lt;/code&gt;/&lt;code&gt;FailWithError&lt;/code&gt;, or returns an error), genop applies&#10;&lt;strong&gt;exponential backoff with jitter&lt;/strong&gt;:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Base delay: 5 seconds&lt;/li&gt;&#10;&lt;li&gt;Max delay: 1 hour&lt;/li&gt;&#10;&lt;li&gt;Factor: 2x per retry&lt;/li&gt;&#10;&lt;li&gt;Jitter: 25%&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;The &lt;code&gt;retryIndex&lt;/code&gt; in status tracks consecutive failures and resets to 0 on&#10;success.&lt;/p&gt;&#10;&lt;h2 id="per-resource-configuration"&gt;Per-resource configuration&lt;a class="anchor" href="#per-resource-configuration"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;Set it from &lt;code&gt;.genop.yaml&lt;/code&gt;&amp;rsquo;s &lt;code&gt;operator:&lt;/code&gt; block at creation time, or later&#10;with &lt;code&gt;genop set operator&lt;/code&gt;:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-yaml" data-lang="yaml"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;resources&lt;/span&gt;:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - &lt;span style="color:#f92672"&gt;version&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;v1alpha1&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;kind&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;Database&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;operator&lt;/span&gt;:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;backoff&lt;/span&gt;:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;baseDelay&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;10s &lt;/span&gt; &lt;span style="color:#75715e"&gt;# default 5s&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;maxDelay&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;30m &lt;/span&gt; &lt;span style="color:#75715e"&gt;# default 1h&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;factor&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;1.5&lt;/span&gt; &lt;span style="color:#75715e"&gt;# default 2.0&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;jitterRatio&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;25&lt;/span&gt; &lt;span style="color:#75715e"&gt;# 1-100; default 25 (percent). 0 keeps the default&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;After hand-editing the file, run &lt;code&gt;genop apply&lt;/code&gt; to regenerate the wiring.&#10;&lt;code&gt;genop set operator&lt;/code&gt; does the same in one command — it updates the&#10;topology and applies:&lt;/p&gt;</description></item><item><title>Topology and Drift</title><link>https://genop-0d6168.gitlab.io/concepts/topology-and-drift/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://genop-0d6168.gitlab.io/concepts/topology-and-drift/</guid><description>&lt;h1 id="project-topology-genopyaml"&gt;Project topology (&lt;code&gt;.genop.yaml&lt;/code&gt;)&lt;a class="anchor" href="#project-topology-genopyaml"&gt;#&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;Every repository managed by genop keeps a &lt;code&gt;.genop.yaml&lt;/code&gt; at the root that&#10;describes the full structure of the project: which operators exist, where&#10;they live on disk, which controllers they expose, and which resources and&#10;reconcilers each controller manages.&lt;/p&gt;&#10;&lt;h2 id="why-it-exists"&gt;Why it exists&lt;a class="anchor" href="#why-it-exists"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;Kubernetes operator projects tend to grow in the same predictable pattern —&#10;API types, webhooks, metrics, a controller entry point, a Helm chart.&#10;&lt;code&gt;genop apply&lt;/code&gt; and &lt;code&gt;genop create&lt;/code&gt; scaffold all of that for you, and&#10;&lt;code&gt;.genop.yaml&lt;/code&gt; is the machine-readable record of what was generated and how&#10;it was configured. It serves three purposes:&lt;/p&gt;</description></item><item><title>Reconciliation Controls</title><link>https://genop-0d6168.gitlab.io/guides/reconciliation-controls/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://genop-0d6168.gitlab.io/guides/reconciliation-controls/</guid><description>&lt;h1 id="reconciliation-controls"&gt;Reconciliation controls&lt;a class="anchor" href="#reconciliation-controls"&gt;#&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;Three annotation-driven controls change how a &lt;em&gt;specific, already-deployed&lt;/em&gt;&#10;resource reconciles, without touching &lt;code&gt;.genop.yaml&lt;/code&gt; or redeploying. For the&#10;build-time equivalents — retry policy, success status, backoff, deletion&#10;policy — see&#10;&lt;a href="https://genop-0d6168.gitlab.io/reference/cli/#operator-configuration"&gt;Operator configuration&lt;/a&gt;.&lt;/p&gt;&#10;&lt;h2 id="pausing-reconciliation"&gt;Pausing reconciliation&lt;a class="anchor" href="#pausing-reconciliation"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;Set this annotation on a resource to suspend it entirely:&lt;/p&gt;&#10;&lt;pre tabindex="0"&gt;&lt;code&gt;reconcile.&amp;lt;apiGroup&amp;gt;/pause=true&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;code&gt;&amp;lt;apiGroup&amp;gt;&lt;/code&gt; is the resource&amp;rsquo;s own API group — e.g.&#10;&lt;code&gt;reconcile.infrastructure.acme.io/pause=true&lt;/code&gt; for a &lt;code&gt;VPC&lt;/code&gt; in the &lt;code&gt;infrastructure&lt;/code&gt;&#10;group.&lt;/p&gt;&#10;&lt;p&gt;While present with the value &lt;code&gt;true&lt;/code&gt;, the operator skips every step, hook,&#10;and finalizer check. The resource is set to &lt;code&gt;Pending&lt;/code&gt; with the message&#10;&lt;code&gt;reconciliation paused&lt;/code&gt;, and re-checked every&#10;&lt;a href="https://genop-0d6168.gitlab.io/reference/cli/#operator-configuration"&gt;&lt;code&gt;pendingCheckInterval&lt;/code&gt;&lt;/a&gt;&#10;(status is only re-written the first time, not on every re-check). Any&#10;other value, or removing the annotation, resumes reconciliation from where&#10;it left off.&lt;/p&gt;</description></item><item><title>Metrics</title><link>https://genop-0d6168.gitlab.io/guides/metrics/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://genop-0d6168.gitlab.io/guides/metrics/</guid><description>&lt;h1 id="metrics"&gt;Metrics&lt;a class="anchor" href="#metrics"&gt;#&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;Every controller serves a Prometheus metrics endpoint. The generated&#10;Deployment, Service, and ServiceMonitor all assume it&amp;rsquo;s listening in plain&#10;HTTP on &lt;code&gt;:8080&lt;/code&gt; — driven by two env vars in the generated&#10;&lt;code&gt;controller-default-env&lt;/code&gt; ConfigMap:&lt;/p&gt;&#10;&lt;table&gt;&#10;&#9;&lt;thead&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Env var&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Default&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Flag&lt;/th&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/thead&gt;&#10;&#9;&lt;tbody&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;code&gt;METRICS_BIND_ADDRESS&lt;/code&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;code&gt;:8080&lt;/code&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;code&gt;--metrics-bind-address&lt;/code&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;code&gt;METRICS_SECURE&lt;/code&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;code&gt;--metrics-secure&lt;/code&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/tbody&gt;&#10;&lt;/table&gt;&#10;&lt;p&gt;Set &lt;code&gt;METRICS_SECURE: &amp;quot;true&amp;quot;&lt;/code&gt; (Helm: &lt;code&gt;global.metricsSecure&lt;/code&gt;) to serve over&#10;HTTPS with authn/authz instead — the generated ServiceMonitor still scrapes&#10;plain HTTP by default, so switching this on also means configuring&#10;&lt;code&gt;scheme: https&lt;/code&gt; and the matching TLS/bearer-token settings on the&#10;ServiceMonitor yourself.&lt;/p&gt;</description></item><item><title>E2E Metrics Test</title><link>https://genop-0d6168.gitlab.io/guides/e2e-metrics/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://genop-0d6168.gitlab.io/guides/e2e-metrics/</guid><description>&lt;h1 id="e2e-metrics-test"&gt;E2E metrics test&lt;a class="anchor" href="#e2e-metrics-test"&gt;#&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;Every resource gets a second e2e test next to its reconcile test:&#10;&lt;code&gt;test/e2e/e2e_metrics_&amp;lt;version&amp;gt;_&amp;lt;kind&amp;gt;_test.go&lt;/code&gt;. It checks that the resource&amp;rsquo;s&#10;metrics are actually reachable &lt;strong&gt;through the metrics Service&lt;/strong&gt;, which is what&#10;Prometheus scrapes — not through the Pod.&lt;/p&gt;&#10;&lt;h2 id="what-it-checks"&gt;What it checks&lt;a class="anchor" href="#what-it-checks"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;Creates the resource and waits for &lt;code&gt;Status.IsReady()&lt;/code&gt;.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;Scrapes &lt;code&gt;/metrics&lt;/code&gt; through the API server&amp;rsquo;s service proxy:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;kubectl get --raw /api/v1/namespaces/&amp;lt;operator-namespace&amp;gt;/services/&amp;lt;project&amp;gt;-&amp;lt;controller&amp;gt;-metrics:metrics/proxy/metrics&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The proxy resolves the Service to its endpoints, so the test fails if the&#10;Service selector, the &lt;code&gt;metrics&lt;/code&gt; port name or the endpoints are wrong.&lt;/p&gt;</description></item><item><title>Custom Events</title><link>https://genop-0d6168.gitlab.io/guides/events/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://genop-0d6168.gitlab.io/guides/events/</guid><description>&lt;h1 id="events"&gt;Events&lt;a class="anchor" href="#events"&gt;#&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;genop sends Kubernetes events (&lt;code&gt;events.k8s.io/v1&lt;/code&gt;) automatically on state&#10;transitions — step success, step failure, and deletion policy evaluation —&#10;via the &lt;code&gt;EventBroadcaster&lt;/code&gt; wired up in &lt;code&gt;main.go&lt;/code&gt;. Step/reconciler code can&#10;send its own custom events too, using the same&#10;&lt;a href="https://genop-0d6168.gitlab.io/guides/escape-hatches/"&gt;shared-dependency escape hatch&lt;/a&gt; as any&#10;other dependency:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-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:#75715e"&gt;// apply/deps.go&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;var&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;Recorder&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;events&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;EventRecorderLogger&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-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:#75715e"&gt;// main.go, already-safe area, before the operator is built&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;applyv1alpha1database&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;Recorder&lt;/span&gt; = &lt;span style="color:#a6e22e"&gt;eventBroadcaster&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;NewRecorder&lt;/span&gt;(&lt;span style="color:#a6e22e"&gt;mgr&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;GetScheme&lt;/span&gt;(), &lt;span style="color:#a6e22e"&gt;controllerName&lt;/span&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-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:#75715e"&gt;// apply/provisiondatabase.go — write-once, genop-generated; you add the field + wiring&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;func&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;NewProvisionDatabase&lt;/span&gt;(&lt;span style="color:#a6e22e"&gt;k8sClient&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;client&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;Client&lt;/span&gt;, &lt;span style="color:#a6e22e"&gt;dynamicClient&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;dynamic&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;Interface&lt;/span&gt;) &lt;span style="color:#f92672"&gt;*&lt;/span&gt;&lt;span style="color:#a6e22e"&gt;ProvisionDatabase&lt;/span&gt; {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;return&lt;/span&gt; &lt;span style="color:#f92672"&gt;&amp;amp;&lt;/span&gt;&lt;span style="color:#a6e22e"&gt;ProvisionDatabase&lt;/span&gt;{&lt;span style="color:#a6e22e"&gt;K8sClient&lt;/span&gt;: &lt;span style="color:#a6e22e"&gt;k8sClient&lt;/span&gt;, &lt;span style="color:#a6e22e"&gt;Recorder&lt;/span&gt;: &lt;span style="color:#a6e22e"&gt;Recorder&lt;/span&gt;}&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;}&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;func&lt;/span&gt; (&lt;span style="color:#a6e22e"&gt;r&lt;/span&gt; &lt;span style="color:#f92672"&gt;*&lt;/span&gt;&lt;span style="color:#a6e22e"&gt;ProvisionDatabase&lt;/span&gt;) &lt;span style="color:#a6e22e"&gt;Apply&lt;/span&gt;(&lt;span style="color:#a6e22e"&gt;ctx&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;context&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;Context&lt;/span&gt;, &lt;span style="color:#a6e22e"&gt;logger&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;logr&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;Logger&lt;/span&gt;, &lt;span style="color:#a6e22e"&gt;resource&lt;/span&gt; &lt;span style="color:#f92672"&gt;*&lt;/span&gt;&lt;span style="color:#a6e22e"&gt;Database&lt;/span&gt;) (&lt;span style="color:#a6e22e"&gt;ctrl&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;Result&lt;/span&gt;, &lt;span style="color:#66d9ef"&gt;string&lt;/span&gt;, &lt;span style="color:#66d9ef"&gt;error&lt;/span&gt;) {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#75715e"&gt;// ...&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a6e22e"&gt;operators&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;SendEvent&lt;/span&gt;(&lt;span style="color:#a6e22e"&gt;r&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;Recorder&lt;/span&gt;, &lt;span style="color:#a6e22e"&gt;ctx&lt;/span&gt;, &lt;span style="color:#a6e22e"&gt;logger&lt;/span&gt;, &lt;span style="color:#a6e22e"&gt;resource&lt;/span&gt;,&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a6e22e"&gt;model&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;EventTypeNormal&lt;/span&gt;, &lt;span style="color:#e6db74"&gt;&amp;#34;Provisioning&amp;#34;&lt;/span&gt;, &lt;span style="color:#e6db74"&gt;&amp;#34;DatabaseProvisioned&amp;#34;&lt;/span&gt;, &lt;span style="color:#e6db74"&gt;&amp;#34;Database %s provisioned&amp;#34;&lt;/span&gt;, &lt;span style="color:#a6e22e"&gt;resource&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;Name&lt;/span&gt;)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#75715e"&gt;// ...&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;code&gt;eventBroadcaster&lt;/code&gt; itself is already declared in that same hand-editable&#10;area of &lt;code&gt;main.go&lt;/code&gt;, so nothing about the generated wiring needs to change —&#10;each resource&amp;rsquo;s step package gets its own recorder the same way a&#10;different resource gets its own copy of a shared cloud-provider client.&lt;/p&gt;</description></item><item><title>Webhooks</title><link>https://genop-0d6168.gitlab.io/guides/webhooks/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://genop-0d6168.gitlab.io/guides/webhooks/</guid><description>&lt;h1 id="webhooks"&gt;Webhooks&lt;a class="anchor" href="#webhooks"&gt;#&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;Each resource has a generated &lt;code&gt;webhook.go&lt;/code&gt; alongside its controller, in&#10;&lt;code&gt;internal/controllers/v1alpha1/&amp;lt;kind&amp;gt;/&lt;/code&gt;, with stubs for:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;Defaulting&lt;/strong&gt;: Set default values on create/update&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Validation&lt;/strong&gt;: Validate create, update, and delete operations&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Whether a resource actually serves them is a per-resource switch in&#10;&lt;code&gt;.genop.yaml&lt;/code&gt;:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-yaml" data-lang="yaml"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;resources&lt;/span&gt;:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - &lt;span style="color:#f92672"&gt;version&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;v1alpha1&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;kind&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;Database&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;webhook&lt;/span&gt;:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;validating&lt;/span&gt;: &lt;span style="color:#66d9ef"&gt;false&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;mutating&lt;/span&gt;: &lt;span style="color:#66d9ef"&gt;false&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Edit the file, then run &lt;code&gt;genop apply&lt;/code&gt; to update the packaging. A switch that stays enabled is absent from the file — only disabling is&#10;ever written. &lt;code&gt;genop apply&lt;/code&gt; turns those switches into packaging: a&#10;disabled webhook is dropped from the &lt;code&gt;ValidatingWebhookConfiguration&lt;/code&gt; /&#10;&lt;code&gt;MutatingWebhookConfiguration&lt;/code&gt;, and when no resource in the operator serves&#10;a webhook at all, the webhook service, &lt;code&gt;Issuer&lt;/code&gt; and &lt;code&gt;Certificate&lt;/code&gt; are&#10;removed too.&lt;/p&gt;</description></item><item><title>Watching Child Resources</title><link>https://genop-0d6168.gitlab.io/guides/watching-child-resources/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://genop-0d6168.gitlab.io/guides/watching-child-resources/</guid><description>&lt;h1 id="watching-child-resources"&gt;Watching child resources&lt;a class="anchor" href="#watching-child-resources"&gt;#&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;A resource&amp;rsquo;s &lt;code&gt;internal/controllers/&amp;lt;version&amp;gt;/&amp;lt;kind&amp;gt;/controller.go&lt;/code&gt; is&#10;generated once and never rewritten, so it is yours to edit. It watches&#10;only the resource itself: a child resource your steps create is noticed at&#10;the next &lt;code&gt;SUCCESS_CHECK_INTERVAL&lt;/code&gt; at the earliest. To react sooner, add&#10;&lt;code&gt;Owns(&amp;amp;corev1.Secret{})&lt;/code&gt; (or &lt;code&gt;Watches(...)&lt;/code&gt;) in &lt;code&gt;SetupWithManager&lt;/code&gt;; a&#10;commented example is in the file. The generation/annotation predicate is&#10;attached to the primary watch only, so it does not filter your child&#10;watches. See the&#10;&lt;a href="https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/builder#Builder.Owns"&gt;&lt;code&gt;Owns&lt;/code&gt; documentation&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Cluster-Scoped Resources</title><link>https://genop-0d6168.gitlab.io/guides/cluster-scoped-resources/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://genop-0d6168.gitlab.io/guides/cluster-scoped-resources/</guid><description>&lt;h1 id="cluster-scoped-resources"&gt;Cluster-scoped resources&lt;a class="anchor" href="#cluster-scoped-resources"&gt;#&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;Resources are namespaced by default. Create a cluster-scoped kind with&#10;&lt;code&gt;genop create api &amp;lt;Kind&amp;gt; --scope Cluster&lt;/code&gt; (env &lt;code&gt;API_SCOPE&lt;/code&gt;).&lt;/p&gt;&#10;&lt;blockquote class='book-hint tip'&gt;&#10;&lt;p&gt;&lt;strong&gt;Declarative equivalent.&lt;/strong&gt; Set &lt;code&gt;scope: Cluster&lt;/code&gt; on the resource in&#10;&lt;code&gt;.genop.yaml&lt;/code&gt;, then run &lt;code&gt;genop apply&lt;/code&gt;:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-yaml" data-lang="yaml"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;controllers&lt;/span&gt;:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - &lt;span style="color:#f92672"&gt;name&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;network&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;resources&lt;/span&gt;:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - &lt;span style="color:#f92672"&gt;version&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;v1alpha1&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;kind&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;Region&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;scope&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;Cluster&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;p&gt;The &lt;code&gt;scope&lt;/code&gt; key in &lt;code&gt;.genop.yaml&lt;/code&gt; is only read when genop first scaffolds a resource:&#10;the resource type and the generated e2e test are written once and never&#10;rewritten, so editing &lt;code&gt;scope&lt;/code&gt; on an already-scaffolded resource would&#10;leave the CRD and the webhook rules disagreeing. To change a kind&amp;rsquo;s scope,&#10;run &lt;code&gt;genop delete api&lt;/code&gt; and then &lt;code&gt;genop create api&lt;/code&gt; again; changing a CRD&amp;rsquo;s&#10;scope is a breaking API change anyway.&lt;/p&gt;</description></item><item><title>Leader Election</title><link>https://genop-0d6168.gitlab.io/guides/leader-election/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://genop-0d6168.gitlab.io/guides/leader-election/</guid><description>&lt;h1 id="leader-election"&gt;Leader election&lt;a class="anchor" href="#leader-election"&gt;#&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;Leader election guards against two replicas reconciling the same resources&#10;at once. It is on in-cluster and off for local runs:&lt;/p&gt;&#10;&lt;table&gt;&#10;&#9;&lt;thead&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Env var&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Default&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Flag&lt;/th&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/thead&gt;&#10;&#9;&lt;tbody&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;code&gt;LEADER_ELECT&lt;/code&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;code&gt;false&lt;/code&gt; (code) / &lt;code&gt;true&lt;/code&gt; (generated ConfigMap)&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;code&gt;--leader-elect&lt;/code&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/tbody&gt;&#10;&lt;/table&gt;&#10;&lt;p&gt;Helm: &lt;code&gt;global.leaderElect&lt;/code&gt;. During a rolling update the new pod waits for&#10;the old pod&amp;rsquo;s lease to be released or to expire (about 15s) before it&#10;reconciles.&lt;/p&gt;</description></item><item><title>Environment Variables</title><link>https://genop-0d6168.gitlab.io/guides/environment-variables/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://genop-0d6168.gitlab.io/guides/environment-variables/</guid><description>&lt;h1 id="environment-variables"&gt;Environment variables&lt;a class="anchor" href="#environment-variables"&gt;#&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;Controller configuration is passed through the&#10;&lt;code&gt;postgresql-operator-controller-default-env&lt;/code&gt; ConfigMap. Both packagings&#10;generate it — &lt;code&gt;config/helm/templates/controller-default-env.yaml&lt;/code&gt; and&#10;&lt;code&gt;config/kustomize/base/controller-default-env.yaml&lt;/code&gt; — and both are&#10;managed, so neither is the place to put your own variables.&lt;/p&gt;&#10;&lt;p&gt;Read a variable in &lt;code&gt;cmd/controllers/&amp;lt;controller&amp;gt;/main.go&lt;/code&gt; with&#10;&lt;code&gt;utils.DefaultEnv(&amp;quot;MY_VAR&amp;quot;, &amp;quot;default&amp;quot;)&lt;/code&gt;, then supply it from outside the&#10;generated file. &lt;code&gt;envFrom&lt;/code&gt; is last-wins, so anything mounted after the&#10;generated ConfigMap overrides it — including generated keys such as&#10;&lt;code&gt;&amp;lt;PLURAL&amp;gt;_MAX_CONCURRENT_RECONCILES&lt;/code&gt;.&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;Helm&lt;/strong&gt; — override a generated key with your own values file, and add&#10;unknown variables through &lt;code&gt;controllers.&amp;lt;name&amp;gt;.envFrom&lt;/code&gt;:&lt;/p&gt;</description></item></channel></rss>