mirror of
https://github.com/fluxcd/flux2.git
synced 2026-02-23 16:11:48 +00:00
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>
This commit is contained in:
parent
ab00e348a4
commit
b9fbdfc9a4
1 changed files with 1 additions and 7 deletions
|
|
@ -26,7 +26,6 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/fluxcd/pkg/kustomize/filesys"
|
|
||||||
"github.com/fluxcd/pkg/untar"
|
"github.com/fluxcd/pkg/untar"
|
||||||
|
|
||||||
"github.com/fluxcd/flux2/pkg/manifestgen/kustomization"
|
"github.com/fluxcd/flux2/pkg/manifestgen/kustomization"
|
||||||
|
|
@ -126,12 +125,7 @@ func build(base, output string) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
outputBase := filepath.Dir(strings.TrimSuffix(output, string(filepath.Separator)))
|
if err = os.WriteFile(output, resources, 0o640); err != nil {
|
||||||
fs, err := filesys.MakeFsOnDiskSecure(outputBase)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if err = fs.WriteFile(output, resources); err != nil {
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue