chore: more cleanup

Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
This commit is contained in:
Armando Ruocco 2024-10-02 12:15:05 +02:00
parent ccefe09773
commit 21abee8529
3 changed files with 1 additions and 13 deletions

View File

@ -62,8 +62,7 @@ func main() {
}
if err := mgr.Add(&instance.CNPGI{
Client: mgr.GetClient(),
Recorder: mgr.GetEventRecorderFor("cnpg-i"),
Client: mgr.GetClient(),
ClusterObjectKey: client.ObjectKey{
Namespace: namespace,
Name: clusterName,

View File

@ -13,7 +13,6 @@ import (
"github.com/cloudnative-pg/machinery/pkg/fileutils"
"github.com/cloudnative-pg/machinery/pkg/log"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/tools/record"
"sigs.k8s.io/controller-runtime/pkg/client"
)
@ -21,7 +20,6 @@ import (
// of the Backup CNPG capability
type BackupServiceImplementation struct {
Client client.Client
Recorder record.EventRecorder
InstanceName string
backup.UnimplementedBackupServer
}
@ -93,12 +91,6 @@ func (b BackupServiceImplementation) Backup(
return nil, err
}
contextLogger.Info("Backup completed")
b.Recorder.Event(backupObj, "Normal", "Completed", "Backup completed")
// Set the status to completed
backupObj.Status.SetAsCompleted()
executedBackupInfo, err := backupCmd.GetExecutedBackupInfo(
ctx, backupObj.Status.BackupName, backupObj.Status.ServerName, cluster, env)
if err != nil {

View File

@ -7,14 +7,12 @@ import (
"github.com/cloudnative-pg/cnpg-i/pkg/backup"
"github.com/cloudnative-pg/cnpg-i/pkg/wal"
"google.golang.org/grpc"
"k8s.io/client-go/tools/record"
"sigs.k8s.io/controller-runtime/pkg/client"
)
// CNPGI is the implementation of the PostgreSQL sidecar
type CNPGI struct {
Client client.Client
Recorder record.EventRecorder
WALConfigurationKey client.ObjectKey
ClusterObjectKey client.ObjectKey
PGDataPath string
@ -44,7 +42,6 @@ func (c *CNPGI) Start(ctx context.Context) error {
})
backup.RegisterBackupServer(server, BackupServiceImplementation{
Client: c.Client,
Recorder: c.Recorder,
InstanceName: c.InstanceName,
})
return nil