Truncate events log after read
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
parent
399eca2b90
commit
4ae5413ed7
1 changed files with 1 additions and 1 deletions
|
@ -64,7 +64,7 @@ func setupEventLog(s *Supervisor) error {
|
||||||
}
|
}
|
||||||
logrus.WithField("count", len(s.eventLog)).Debug("containerd: read past events")
|
logrus.WithField("count", len(s.eventLog)).Debug("containerd: read past events")
|
||||||
events := s.Events(time.Time{})
|
events := s.Events(time.Time{})
|
||||||
f, err := os.OpenFile(filepath.Join(s.stateDir, "events.log"), os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0755)
|
f, err := os.OpenFile(filepath.Join(s.stateDir, "events.log"), os.O_WRONLY|os.O_CREATE|os.O_APPEND|os.O_TRUNC, 0755)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue