From 69f9ebd1e7f233a26600932ff7ddc930757de391 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20B=C3=A4hler?= Date: Wed, 7 Jul 2021 14:24:39 +0200 Subject: [PATCH] Var substitution opt-in MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Oliver Bähler --- docs/spec/v1beta1/kustomization.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/spec/v1beta1/kustomization.md b/docs/spec/v1beta1/kustomization.md index e16fa86..f48866f 100644 --- a/docs/spec/v1beta1/kustomization.md +++ b/docs/spec/v1beta1/kustomization.md @@ -803,6 +803,20 @@ labeling or annotating them with: kustomize.toolkit.fluxcd.io/substitute: disabled ``` +Substitution needs to be defined opt-in. If not at least a single variable or resource to substitute from is defined, no var substitution is performed. So even expressions which should evaluate to a default value won't be evaluated. To enable var substitution, just set at least one variable which will enable var substitution for the Kustomization, if you don't have any other variables on the Kustomization. For example: + +``` +apiVersion: kustomize.toolkit.fluxcd.io/v1beta1 +kind: Kustomization +metadata: + name: apps +spec: + ... + postBuild: + substitute: + enabled: "true" +``` + You can replicate the controller post-build substitutions locally using [kustomize](https://github.com/kubernetes-sigs/kustomize) and Drone's [envsubst](https://github.com/drone/envsubst):