Merge pull request #26343 from giuseppe/random-fixes

some random fixes
This commit is contained in:
openshift-merge-bot[bot] 2025-06-11 13:25:42 +00:00 committed by GitHub
commit 3c74a44eb7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 2 deletions

View File

@ -34,7 +34,7 @@ func newLogFileEventer(options EventerOptions) (*EventLogFile, error) {
}
// We have to make sure the file is created otherwise reading events will hang.
// https://github.com/containers/podman/issues/15688
fd, err := os.OpenFile(options.LogFilePath, os.O_RDONLY|os.O_CREATE, 0700)
fd, err := os.OpenFile(options.LogFilePath, os.O_RDONLY|os.O_CREATE, 0600)
if err != nil {
return nil, fmt.Errorf("failed to create event log file: %w", err)
}
@ -68,6 +68,7 @@ func (e EventLogFile) writeString(s string) error {
if err != nil {
return err
}
defer f.Close()
return writeToFile(s, f)
}
@ -168,7 +169,7 @@ func (e EventLogFile) Read(ctx context.Context, options ReadOptions) error {
event, err := newEventFromJSONString(line.Text)
if err != nil {
err := fmt.Errorf("event type %s is not valid in %s", event.Type.String(), e.options.LogFilePath)
err := fmt.Errorf("event type is not valid in %s", e.options.LogFilePath)
options.EventChannel <- ReadResult{Error: err}
continue
}