From 91b3ac3a5591b07fc494880296f80bcfa760d5d5 Mon Sep 17 00:00:00 2001 From: George Kalashnikov Date: Mon, 14 Aug 2023 17:40:40 +0100 Subject: [PATCH] Test case for https://github.com/kubernetes-sigs/kustomize/issues/5250 --- api/krusty/component_test.go | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/api/krusty/component_test.go b/api/krusty/component_test.go index 24d591915a..859fc37ae0 100644 --- a/api/krusty/component_test.go +++ b/api/krusty/component_test.go @@ -753,6 +753,42 @@ spec: value: kustomize-namespace image: busybox name: myapp-container +`}, + "components_are_applied_before_overlay_applied": { + input: []FileGen{ + writeK("", ` +resources: +- base +components: +- components +configMapGenerator: + - name: literals-configmap + behavior: merge + literals: + - literal_variable_one=overlay-value`), + writeK("/base", ` +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +configMapGenerator: + - name: literals-configmap + literals: + - literal_variable_one=base-value`), + writeC("/components", ` +apiVersion: kustomize.config.k8s.io/v1alpha1 +kind: Component +configMapGenerator: + - name: literals-configmap + behavior: merge + literals: + - literal_variable_one=component-value`), + }, + expectedOutput: ` +apiVersion: v1 +data: + literal_variable_one: overlay-value +kind: ConfigMap +metadata: + name: literals-configmap-h9bhhg655t `}, }