Skip to content

Commit 0104e28

Browse files
authored
Merge branch 'mackerelio:master' into master
2 parents 4940635 + e59230a commit 0104e28

File tree

9 files changed

+43
-17
lines changed

9 files changed

+43
-17
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## 0.46.2 (2024-02-27)
4+
5+
* Reduce check-log errors when a file in the log directory has been removed at the moment of running check-log #823 (ne-sachirou)
6+
* Bump the golang-x group with 3 updates #820 (dependabot[bot])
7+
* Fix path #814 (yohfee)
8+
9+
310
## 0.46.1 (2023-11-15)
411

512
* CGO_ENABLED=0 when build for packaging #800 (Arthur1)

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION = 0.46.1
1+
VERSION = 0.46.2
22
CURRENT_REVISION = $(shell git rev-parse --short HEAD)
33
ifeq ($(OS),Windows_NT)
44
GOPATH_ROOT:=$(shell cygpath ${GOPATH})

check-log/lib/check-log.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"context"
77
"crypto/md5"
88
"encoding/json"
9+
"errors"
910
"fmt"
1011
"io"
1112
"log"
@@ -564,20 +565,21 @@ func saveState(f string, state *state) error {
564565
var errFileNotFoundByInode = fmt.Errorf("old file not found")
565566

566567
func findFileByInode(inode uint, dir string) (string, error) {
567-
entries, err := os.ReadDir(dir)
568-
if err != nil {
569-
return "", err
570-
}
568+
entries, readDirErr := os.ReadDir(dir)
571569
for _, entry := range entries {
572570
fi, err := entry.Info()
573-
if err != nil {
571+
if err != nil && !errors.Is(err, os.ErrNotExist) {
574572
return "", err
575573
}
576574
if detectInode(fi) == inode {
577575
return filepath.Join(dir, fi.Name()), nil
578576
}
579577
}
580-
return "", errFileNotFoundByInode
578+
err := errFileNotFoundByInode
579+
if readDirErr != nil {
580+
err = errors.Join(err, readDirErr)
581+
}
582+
return "", err
581583
}
582584

583585
func openOldFile(f string, state *state) (*os.File, error) {

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ require (
2727
github.com/shirou/gopsutil/v3 v3.23.10
2828
github.com/stretchr/testify v1.8.4
2929
github.com/tatsushid/go-fastping v0.0.0-20160109021039-d7bb493dee3e
30-
golang.org/x/crypto v0.14.0
31-
golang.org/x/sys v0.13.0
32-
golang.org/x/text v0.13.0
30+
golang.org/x/crypto v0.19.0
31+
golang.org/x/sys v0.17.0
32+
golang.org/x/text v0.14.0
3333
)
3434

3535
require (

go.sum

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk
171171
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
172172
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
173173
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
174-
golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc=
175-
golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4=
174+
golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo=
175+
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
176176
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
177177
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
178178
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
@@ -216,15 +216,16 @@ golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBc
216216
golang.org/x/sys v0.0.0-20211116061358-0a5406a5449c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
217217
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
218218
golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
219-
golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
220219
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
220+
golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=
221+
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
221222
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
222-
golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek=
223+
golang.org/x/term v0.17.0 h1:mkTF7LCd6WGJNL3K1Ad7kwxNfYAW6a8a8QqtMblp/4U=
223224
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
224225
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
225226
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
226-
golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
227-
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
227+
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
228+
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
228229
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
229230
golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
230231
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=

mackerel-check.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func run(args []string) int {
6060
return exitOK
6161
}
6262

63-
const version = "0.46.1"
63+
const version = "0.46.2"
6464

6565
var gitcommit string
6666

packaging/deb-v2/debian/changelog

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
mackerel-check-plugins (0.46.2-1.v2) stable; urgency=low
2+
3+
* Reduce check-log errors when a file in the log directory has been removed at the moment of running check-log (by ne-sachirou)
4+
<https://github.com/mackerelio/go-check-plugins/pull/823>
5+
* Bump the golang-x group with 3 updates (by dependabot[bot])
6+
<https://github.com/mackerelio/go-check-plugins/pull/820>
7+
* Fix path (by yohfee)
8+
<https://github.com/mackerelio/go-check-plugins/pull/814>
9+
10+
-- mackerel <[email protected]> Tue, 27 Feb 2024 06:04:11 +0000
11+
112
mackerel-check-plugins (0.46.1-1.v2) stable; urgency=low
213

314
* CGO_ENABLED=0 when build for packaging (by Arthur1)
File renamed without changes.

packaging/rpm/mackerel-check-plugins-v2.spec

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ done
3636
%{__targetdir}/*
3737

3838
%changelog
39+
* Tue Feb 27 2024 <[email protected]> - 0.46.2
40+
- Reduce check-log errors when a file in the log directory has been removed at the moment of running check-log (by ne-sachirou)
41+
- Bump the golang-x group with 3 updates (by dependabot[bot])
42+
- Fix path (by yohfee)
43+
3944
* Wed Nov 15 2023 <[email protected]> - 0.46.1
4045
- CGO_ENABLED=0 when build for packaging (by Arthur1)
4146

0 commit comments

Comments
 (0)