From a867c209c354a55486942d2d9cca723f1c3f273e Mon Sep 17 00:00:00 2001 From: eding Date: Sun, 13 Sep 2026 14:07:47 +0200 Subject: [PATCH] fix: preserve generated Tekton apps --- internal/bootstrap/bootstrap.go | 10 +++++++++- internal/bootstrap/bootstrap_test.go | 6 ++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/internal/bootstrap/bootstrap.go b/internal/bootstrap/bootstrap.go index a828208..6adf9c2 100644 --- a/internal/bootstrap/bootstrap.go +++ b/internal/bootstrap/bootstrap.go @@ -1161,7 +1161,15 @@ func ensureClusterKustomizations(clusterDir string, includeDelivery bool) error func copyTemplateBaseComponents(templateDir, repoDir string, includeDelivery bool) error { for _, component := range templateBaseComponents { - if err := copyDirExcept(filepath.Join(templateDir, "base", component), filepath.Join(repoDir, "base", component), true, generatedTemplateFiles[component]); err != nil { + excluded := generatedTemplateFiles[component] + if component == "tekton" { + excluded = make(map[string]bool, len(excluded)+1) + for path, skip := range generatedTemplateFiles[component] { + excluded[path] = skip + } + excluded["apps"] = true + } + if err := copyDirExcept(filepath.Join(templateDir, "base", component), filepath.Join(repoDir, "base", component), true, excluded); err != nil { return err } } diff --git a/internal/bootstrap/bootstrap_test.go b/internal/bootstrap/bootstrap_test.go index 99c552c..c6b1691 100644 --- a/internal/bootstrap/bootstrap_test.go +++ b/internal/bootstrap/bootstrap_test.go @@ -236,6 +236,12 @@ func TestCopyAndRenderPlatformDeliveryBasesOverwritesExistingMigrationOutput(t * if err := os.WriteFile(filepath.Join(templateDir, "base", "tekton", "kustomization.yaml"), []byte("resources:\n"), 0644); err != nil { t.Fatal(err) } + if err := os.MkdirAll(filepath.Join(templateDir, "base", "tekton", "apps"), 0755); err != nil { + t.Fatal(err) + } + if err := os.WriteFile(filepath.Join(templateDir, "base", "tekton", "apps", "kustomization.yaml"), []byte("resources: []\n"), 0644); err != nil { + t.Fatal(err) + } customGatewayFile := filepath.Join(repoDir, "base", "gateway", "custom.yaml") if err := os.WriteFile(customGatewayFile, []byte("custom: route\n"), 0644); err != nil { t.Fatal(err)