Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,15 @@ func startConfigWatch(cancel context.CancelFunc, watcher *inotify.Watcher, erase
continue
}

// Write the updated configuration back to the mounted file so that
// containers (e.g. trivy scanner) reading the config file see the
// updated values instead of the stale file on disk.
if updatedBytes, err := yaml.Marshal(newConfig); err != nil {
setupLog.Error(err, "failed to marshal updated configuration")
} else if err = os.WriteFile(filename, updatedBytes, 0644); err != nil {
setupLog.Error(err, "failed to write updated configuration to file")
}

// read back the new configuration
*newConfig, err = eraserOpts.Read()
if err != nil {
Expand Down