Skip to content

Commit c27dc1e

Browse files
armrufcanovai
authored andcommitted
chore: review and go.mod tidy
Signed-off-by: Armando Ruocco <[email protected]>
1 parent 765868c commit c27dc1e

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ github.com/cloudnative-pg/cloudnative-pg v1.24.1-0.20241113134512-8608232c2813 h
3232
github.com/cloudnative-pg/cloudnative-pg v1.24.1-0.20241113134512-8608232c2813/go.mod h1:f4hObdRVoQtMmVtWqZ6VDZBrI6ok9Td/UMhojQ+EPmk=
3333
github.com/cloudnative-pg/cnpg-i v0.0.0-20241109002750-8abd359df734 h1:4jq/FUrlAKxu0Kw9PL5lj5Njq8pAnmUpP/kXKOrJAaE=
3434
github.com/cloudnative-pg/cnpg-i v0.0.0-20241109002750-8abd359df734/go.mod h1:3U7miYasKr2rYCQzrn/IvbSQc0OpYF8ieZt2FKG4nv0=
35-
github.com/cloudnative-pg/cnpg-i-machinery v0.0.0-20241129144432-bd94f16685d3 h1:hKTlmgyOq5ZS7t1eVa4SY1hH361gZ7VIb0an+BH9rJs=
36-
github.com/cloudnative-pg/cnpg-i-machinery v0.0.0-20241129144432-bd94f16685d3/go.mod h1:X6r1fRuUEIAv4+5SSBY2RmQ201K6GcptOXgnmaX/8tY=
3735
github.com/cloudnative-pg/cnpg-i-machinery v0.0.0-20241205093641-958e207b8afe h1:gUGqx4eTHreM0QWbszSx6wnbBw9Vavp5uYl4uA9fh1k=
3836
github.com/cloudnative-pg/cnpg-i-machinery v0.0.0-20241205093641-958e207b8afe/go.mod h1:X6r1fRuUEIAv4+5SSBY2RmQ201K6GcptOXgnmaX/8tY=
3937
github.com/cloudnative-pg/machinery v0.0.0-20241105070525-042a028b767c h1:t0RBU2gBiwJQ9XGeXlHPBYpsTscSKHgB5TfcWaiwanc=

internal/cnpgi/common/errors.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
package common
22

3-
// WALNotFoundError is raised when a WAL file has not been found in the object store
4-
type WALNotFoundError struct{}
3+
// walNotFoundError is raised when a WAL file has not been found in the object store
4+
type walNotFoundError struct{}
5+
6+
func newWALNotFoundError() *walNotFoundError { return &walNotFoundError{} }
57

68
// ShouldPrintStackTrace tells whether the sidecar log stream should contain the stack trace
7-
func (e WALNotFoundError) ShouldPrintStackTrace() bool {
9+
func (e walNotFoundError) ShouldPrintStackTrace() bool {
810
return false
911
}
1012

1113
// Error implements the error interface
12-
func (e WALNotFoundError) Error() string {
14+
func (e walNotFoundError) Error() string {
1315
return "WAL file not found"
1416
}

internal/cnpgi/common/wal.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ func (w WALServiceImplementation) restoreFromBarmanObjectStore(
247247
// The failure has already been logged in walRestorer.RestoreList method
248248
if walStatus[0].Err != nil {
249249
if errors.Is(walStatus[0].Err, barmanRestorer.ErrWALNotFound) {
250-
return WALNotFoundError{}
250+
return newWALNotFoundError()
251251
}
252252

253253
return walStatus[0].Err

0 commit comments

Comments
 (0)