Skip to content

Commit

Permalink
[ws-daemon] Remove stray "cannot write limit" errors
Browse files Browse the repository at this point in the history
  • Loading branch information
csweichel authored and roboquat committed May 13, 2022
1 parent 9dfc038 commit 40491e6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion components/ws-daemon/pkg/cgroup/plugin_iolimit_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ func (c *IOLimiterV1) produceLimits(kind string, value int64, useCache bool) []s
return val.([]string)
}

lines := make([]string, len(c.devices))
lines := make([]string, 0, len(c.devices))
for _, dev := range c.devices {
lines = append(lines, fmt.Sprintf("%s %d", dev, value))
}
Expand All @@ -196,6 +196,9 @@ func writeLimit(limitPath string, content []string) error {
}

for _, l := range content {
if l == "" {
continue
}
err = os.WriteFile(limitPath, []byte(l), 0644)
if err != nil {
log.WithError(err).WithField("limitPath", limitPath).WithField("line", l).Warn("cannot write limit")
Expand Down

0 comments on commit 40491e6

Please sign in to comment.