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

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

View File

@ -13,7 +13,6 @@ import (
"github.com/cloudnative-pg/machinery/pkg/fileutils" "github.com/cloudnative-pg/machinery/pkg/fileutils"
"github.com/cloudnative-pg/machinery/pkg/log" "github.com/cloudnative-pg/machinery/pkg/log"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/tools/record"
"sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client"
) )
@ -21,7 +20,6 @@ import (
// of the Backup CNPG capability // of the Backup CNPG capability
type BackupServiceImplementation struct { type BackupServiceImplementation struct {
Client client.Client Client client.Client
Recorder record.EventRecorder
InstanceName string InstanceName string
backup.UnimplementedBackupServer backup.UnimplementedBackupServer
} }
@ -93,12 +91,6 @@ func (b BackupServiceImplementation) Backup(
return nil, err 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( executedBackupInfo, err := backupCmd.GetExecutedBackupInfo(
ctx, backupObj.Status.BackupName, backupObj.Status.ServerName, cluster, env) ctx, backupObj.Status.BackupName, backupObj.Status.ServerName, cluster, env)
if err != nil { 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/backup"
"github.com/cloudnative-pg/cnpg-i/pkg/wal" "github.com/cloudnative-pg/cnpg-i/pkg/wal"
"google.golang.org/grpc" "google.golang.org/grpc"
"k8s.io/client-go/tools/record"
"sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client"
) )
// CNPGI is the implementation of the PostgreSQL sidecar // CNPGI is the implementation of the PostgreSQL sidecar
type CNPGI struct { type CNPGI struct {
Client client.Client Client client.Client
Recorder record.EventRecorder
WALConfigurationKey client.ObjectKey WALConfigurationKey client.ObjectKey
ClusterObjectKey client.ObjectKey ClusterObjectKey client.ObjectKey
PGDataPath string PGDataPath string
@ -44,7 +42,6 @@ func (c *CNPGI) Start(ctx context.Context) error {
}) })
backup.RegisterBackupServer(server, BackupServiceImplementation{ backup.RegisterBackupServer(server, BackupServiceImplementation{
Client: c.Client, Client: c.Client,
Recorder: c.Recorder,
InstanceName: c.InstanceName, InstanceName: c.InstanceName,
}) })
return nil return nil