1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2024-12-14 11:57:48 +00:00

fix: Open the mutated resources file in append mode to allow additions to it (#11619)

Signed-off-by: ammar <ammar.yasser@vodafone.com>
Co-authored-by: ammar <ammar.yasser@vodafone.com>
This commit is contained in:
Ammar Yasser 2024-11-20 17:51:36 +02:00 committed by GitHub
parent d61f87e0f9
commit 07d758265a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -381,7 +381,7 @@ func (p *PolicyProcessor) printMutatedOutput(yaml string) error {
}
file = f
} else {
f, err := os.OpenFile(filepath.Join(mutateLogPath, filename+".yaml"), os.O_CREATE|os.O_WRONLY, 0o600) // #nosec G304
f, err := os.OpenFile(filepath.Join(mutateLogPath, filename+".yaml"), os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0o600) // #nosec G304
if err != nil {
return err
}