From 158c857c27e031967b4b1fc6673b11dac063ad8c Mon Sep 17 00:00:00 2001 From: Patrick Hermann Date: Tue, 22 Sep 2026 12:07:51 +0000 Subject: [PATCH] feat(crossplane): derived CR names as an opt-in (derivedNames), p&t twin v0.10.9 stuttgart-things/flux#506. The flux machinery profile and xplane-crossplane-catalog name every Provider and Configuration after the path Crossplane derives from its package. These helmfiles still used short names for four of them, so the two install paths put the same source on a cluster under two CR names -- a duplicate Lock node. - `derivedNames` state value, default false. With `--state-values-set derivedNames=true` an entry that carries `derivedName` switches to it: provider-opentofu -> upbound-provider-opentofu provider-kubeconfig -> stuttgart-things-provider-kubeconfig-xpkg namespace -> stuttgart-things-crossplane-configurations-namespace volume-claim -> stuttgart-things-crossplane-configurations-volume-claim The providers template computes the name once, so the CR, its DeploymentRuntimeConfig, the serviceAccountTemplate and the ClusterRoleBinding move together. - Opt-in, not the new default, because a rename on a live cluster is destructive either way: helm replaces the CR (deleting the old Provider/Configuration takes its CRDs/XRDs and everything on them), or both names coexist (duplicate Lock node, every package Healthy=False). kind_machinery pins this repo and checks for old names before setting the flag; plays/kind-machinery-test.yaml, the platform-engineering-showcase Taskfile/bundle and dev3-kind apply these helmfiles from main with no such check, and keep their names. - crossplane-contrib-function-patch-and-transform v0.10.8 -> v0.10.9, the version of its short-named sibling (catalog 0.7.0). Same CR name, so an in-place upgrade on existing clusters; the digest is identical on both mirrors, the pattern function-kcl runs healthy on kind5. Rendered with `helmfile template`: without the flag the output is byte-identical to main apart from the p&t tag; with it only the names above change. Co-Authored-By: Claude Opus 5 (1M context) --- cicd/crossplane-config.yaml.gotmpl | 28 ++++++++++++++++++- cicd/crossplane-providers.yaml.gotmpl | 22 +++++++++++++++ ...ossplane-configurations.values.yaml.gotmpl | 6 +++- .../crossplane-providers.values.yaml.gotmpl | 21 ++++++++++---- 4 files changed, 69 insertions(+), 8 deletions(-) diff --git a/cicd/crossplane-config.yaml.gotmpl b/cicd/crossplane-config.yaml.gotmpl index 15e6e227..21690182 100644 --- a/cicd/crossplane-config.yaml.gotmpl +++ b/cicd/crossplane-config.yaml.gotmpl @@ -3,6 +3,25 @@ environments: default: values: - namespace: crossplane-system + # derivedNames: false (default) keeps every CR name as it has always + # been. true switches each entry that carries a `derivedName` to it -- + # the name Crossplane itself derives from the package path, and the one + # the flux machinery profile and the xplane-crossplane-catalog use + # (stuttgart-things/flux#506). Set it with + # helmfile apply ... --state-values-set derivedNames=true + # + # FRESH CLUSTERS ONLY. A rename on a live cluster is not a rename: the + # release creates the new CR and helm deletes the old one, and deleting + # a Configuration takes its XRDs -- and every XR on them -- with it. Leaving the old CR in place instead + # gives two CRs for one source, a duplicate Lock node, and every package + # on the cluster goes Healthy=False. The kind_machinery play checks for + # CRs under the old names before it sets this, and stops. + # + # Opt-in rather than the default because not every consumer pins this + # repo: plays/kind-machinery-test.yaml (ansible), the + # platform-engineering-showcase Taskfile/bundle and dev3-kind apply + # these helmfiles from main, with no preflight in front of them. + - derivedNames: false - functions: autoReady: name: function-auto-ready @@ -57,7 +76,12 @@ environments: name: crossplane-contrib-function-patch-and-transform apiVersion: pkg.crossplane.io/v1 image: xpkg.crossplane.io/crossplane-contrib/function-patch-and-transform - tag: v0.10.8 + # v0.10.9, the version of the short-named entry above: two versions + # of one function add nothing. Every dependsOn allows it + # (>=v0.10.6,