mirror of
https://github.com/cloudnative-pg/plugin-barman-cloud.git
synced 2026-01-11 21:23:12 +01:00
chore: move errs to the errors file
Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
This commit is contained in:
parent
e5a0aeed34
commit
37439ea175
@ -1,10 +1,22 @@
|
|||||||
package common
|
package common
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
"google.golang.org/grpc/codes"
|
"google.golang.org/grpc/codes"
|
||||||
"google.golang.org/grpc/status"
|
"google.golang.org/grpc/status"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// ErrEndOfWALStreamReached is returned when end of WAL is detected in the cloud archive.
|
||||||
|
var ErrEndOfWALStreamReached = status.Errorf(codes.NotFound, "end of WAL reached")
|
||||||
|
|
||||||
|
// ErrMissingPermissions is raised when the sidecar has no
|
||||||
|
// permission to download the credentials needed to reach
|
||||||
|
// the object storage.
|
||||||
|
// This will be fixed by the reconciliation loop in the
|
||||||
|
// operator plugin.
|
||||||
|
var ErrMissingPermissions = fmt.Errorf("no permission to download the backup credentials, retrying")
|
||||||
|
|
||||||
// newWALNotFoundError returns a error that states that a
|
// newWALNotFoundError returns a error that states that a
|
||||||
// certain WAL file has not been found. This error is
|
// certain WAL file has not been found. This error is
|
||||||
// compatible with GRPC status codes, resulting in a 404
|
// compatible with GRPC status codes, resulting in a 404
|
||||||
|
|||||||
@ -18,8 +18,6 @@ import (
|
|||||||
"github.com/cloudnative-pg/machinery/pkg/fileutils"
|
"github.com/cloudnative-pg/machinery/pkg/fileutils"
|
||||||
walUtils "github.com/cloudnative-pg/machinery/pkg/fileutils/wals"
|
walUtils "github.com/cloudnative-pg/machinery/pkg/fileutils/wals"
|
||||||
"github.com/cloudnative-pg/machinery/pkg/log"
|
"github.com/cloudnative-pg/machinery/pkg/log"
|
||||||
"google.golang.org/grpc/codes"
|
|
||||||
"google.golang.org/grpc/status"
|
|
||||||
apierrors "k8s.io/apimachinery/pkg/api/errors"
|
apierrors "k8s.io/apimachinery/pkg/api/errors"
|
||||||
"k8s.io/apimachinery/pkg/types"
|
"k8s.io/apimachinery/pkg/types"
|
||||||
"sigs.k8s.io/controller-runtime/pkg/client"
|
"sigs.k8s.io/controller-runtime/pkg/client"
|
||||||
@ -29,13 +27,6 @@ import (
|
|||||||
"github.com/cloudnative-pg/plugin-barman-cloud/internal/cnpgi/operator/config"
|
"github.com/cloudnative-pg/plugin-barman-cloud/internal/cnpgi/operator/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ErrMissingPermissions is raised when the sidecar has no
|
|
||||||
// permission to download the credentials needed to reach
|
|
||||||
// the object storage.
|
|
||||||
// This will be fixed by the reconciliation loop in the
|
|
||||||
// operator plugin.
|
|
||||||
var ErrMissingPermissions = fmt.Errorf("no permission to download the backup credentials, retrying")
|
|
||||||
|
|
||||||
// SpoolManagementError is raised when a spool management
|
// SpoolManagementError is raised when a spool management
|
||||||
// error has been detected
|
// error has been detected
|
||||||
type SpoolManagementError struct {
|
type SpoolManagementError struct {
|
||||||
@ -459,9 +450,6 @@ func gatherWALFilesToRestore(walName string, parallel int) (walList []string, er
|
|||||||
return walList, err
|
return walList, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// ErrEndOfWALStreamReached is returned when end of WAL is detected in the cloud archive.
|
|
||||||
var ErrEndOfWALStreamReached = status.Errorf(codes.NotFound, "end of WAL reached")
|
|
||||||
|
|
||||||
// checkEndOfWALStreamFlag returns ErrEndOfWALStreamReached if the flag is set in the restorer.
|
// checkEndOfWALStreamFlag returns ErrEndOfWALStreamReached if the flag is set in the restorer.
|
||||||
func checkEndOfWALStreamFlag(walRestorer *barmanRestorer.WALRestorer) error {
|
func checkEndOfWALStreamFlag(walRestorer *barmanRestorer.WALRestorer) error {
|
||||||
contain, err := walRestorer.IsEndOfWALStream()
|
contain, err := walRestorer.IsEndOfWALStream()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user