Skip to content

Commit

Permalink
don't print unnecessary log message (istio#3255)
Browse files Browse the repository at this point in the history
When a probe keeps unavailable for a while, the target file
is already removed, and os.Remove returns a not-exist error.
We don't want to flood the log with not-exist errors.
  • Loading branch information
jmuk authored Feb 8, 2018
1 parent 7cf792b commit bbe0f1e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/probe/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ func (fc *fileController) onUpdate(newStatus error) {
}
_ = f.Close()
} else {
if err := os.Remove(fc.path); err != nil {
if err := os.Remove(fc.path); err != nil && !os.IsNotExist(err) {
log.Errorf("Failed to remove the path %s: %v", fc.path, err)
}
}
Expand Down

0 comments on commit bbe0f1e

Please sign in to comment.