From b9fbdfc9a447d9f9543b967433adedcf28ff14db Mon Sep 17 00:00:00 2001
From: Stefan Prodan <stefan.prodan@gmail.com>
Date: Wed, 4 May 2022 09:41:26 +0300
Subject: [PATCH] Fix bootstrap manifest generation Use the OS package to write
 the generated files on disk instead of Flux  secure FS package which is meant
 for read operations.

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
---
 pkg/manifestgen/install/manifests.go | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/pkg/manifestgen/install/manifests.go b/pkg/manifestgen/install/manifests.go
index 17fc33f1..6ab91eae 100644
--- a/pkg/manifestgen/install/manifests.go
+++ b/pkg/manifestgen/install/manifests.go
@@ -26,7 +26,6 @@ import (
 	"path/filepath"
 	"strings"
 
-	"github.com/fluxcd/pkg/kustomize/filesys"
 	"github.com/fluxcd/pkg/untar"
 
 	"github.com/fluxcd/flux2/pkg/manifestgen/kustomization"
@@ -126,12 +125,7 @@ func build(base, output string) error {
 		return err
 	}
 
-	outputBase := filepath.Dir(strings.TrimSuffix(output, string(filepath.Separator)))
-	fs, err := filesys.MakeFsOnDiskSecure(outputBase)
-	if err != nil {
-		return err
-	}
-	if err = fs.WriteFile(output, resources); err != nil {
+	if err = os.WriteFile(output, resources, 0o640); err != nil {
 		return err
 	}
 
-- 
GitLab