mirror of
https://github.com/cloudnative-pg/plugin-barman-cloud.git
synced 2026-01-12 05:33:11 +01:00
fix: exit code 0 on clean shutdown
Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
This commit is contained in:
parent
afd4603023
commit
39be04c4e6
@ -2,6 +2,7 @@ package instance
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"os"
|
||||
"path"
|
||||
|
||||
@ -94,6 +95,10 @@ func Start(ctx context.Context) error {
|
||||
}
|
||||
|
||||
if err := mgr.Start(ctrl.SetupSignalHandler()); err != nil {
|
||||
if errors.Is(err, context.Canceled) {
|
||||
return nil
|
||||
}
|
||||
|
||||
setupLog.Error(err, "problem running manager")
|
||||
return err
|
||||
}
|
||||
|
||||
@ -19,6 +19,7 @@ package operator
|
||||
import (
|
||||
"context"
|
||||
"crypto/tls"
|
||||
"errors"
|
||||
|
||||
// +kubebuilder:scaffold:imports
|
||||
cnpgv1 "github.com/cloudnative-pg/cloudnative-pg/api/v1"
|
||||
@ -155,6 +156,10 @@ func Start(ctx context.Context) error {
|
||||
|
||||
setupLog.Info("starting manager")
|
||||
if err := mgr.Start(ctx); err != nil {
|
||||
if errors.Is(err, context.Canceled) {
|
||||
return nil
|
||||
}
|
||||
|
||||
setupLog.Error(err, "problem running manager")
|
||||
return err
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@ package restore
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"os"
|
||||
|
||||
cnpgv1 "github.com/cloudnative-pg/cloudnative-pg/api/v1"
|
||||
@ -93,6 +94,9 @@ func Start(ctx context.Context) error {
|
||||
}
|
||||
|
||||
if err := mgr.Start(ctrl.SetupSignalHandler()); err != nil {
|
||||
if errors.Is(err, context.Canceled) {
|
||||
return nil
|
||||
}
|
||||
setupLog.Error(err, "problem running manager")
|
||||
return err
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user