From 66e4939ca505d2f4abbd413b86e74ec7811de809 Mon Sep 17 00:00:00 2001 From: shreddedbacon Date: Tue, 6 Aug 2024 20:50:14 +1000 Subject: [PATCH] fix: delete backup in backup-handler --- services/backup-handler/go.mod | 2 +- services/backup-handler/go.sum | 6 ++---- services/backup-handler/internal/handler/main.go | 5 +++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/services/backup-handler/go.mod b/services/backup-handler/go.mod index a6ac3d9416..79828a5087 100644 --- a/services/backup-handler/go.mod +++ b/services/backup-handler/go.mod @@ -6,7 +6,7 @@ require ( github.com/google/uuid v1.3.0 github.com/isayme/go-amqp-reconnect v0.0.0-20210303120416-fc811b0bcda2 github.com/streadway/amqp v1.0.0 - github.com/uselagoon/machinery v0.0.25 + github.com/uselagoon/machinery v0.0.28 ) require ( diff --git a/services/backup-handler/go.sum b/services/backup-handler/go.sum index b52e2f0a85..3d215b87f8 100644 --- a/services/backup-handler/go.sum +++ b/services/backup-handler/go.sum @@ -16,7 +16,5 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/streadway/amqp v1.0.0 h1:kuuDrUJFZL1QYL9hUNuCxNObNzB0bV/ZG5jV3RWAQgo= github.com/streadway/amqp v1.0.0/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= -github.com/uselagoon/machinery v0.0.25-0.20240731103619-a4140d3a8941 h1:clRmB6HIdP9KQtviEQjRTJJYNEWqudBZE3diNFAadnU= -github.com/uselagoon/machinery v0.0.25-0.20240731103619-a4140d3a8941/go.mod h1:NbgtEofjK2XY0iUpk9aMYazIo+W/NI56+UF72jv8zVY= -github.com/uselagoon/machinery v0.0.25 h1:Xaf7f8c+U16HYQBqoChCv37dCBdH+aUgOkuHG5YXLCo= -github.com/uselagoon/machinery v0.0.25/go.mod h1:NbgtEofjK2XY0iUpk9aMYazIo+W/NI56+UF72jv8zVY= +github.com/uselagoon/machinery v0.0.28 h1:6eChYCr6b4kaiBBaUsD0skTC/y6RNodLblJOIiwKyZg= +github.com/uselagoon/machinery v0.0.28/go.mod h1:+cKZerqQzyvPf4lM0ec1jFgDmeM5jYd9W/0EjHmIY8I= diff --git a/services/backup-handler/internal/handler/main.go b/services/backup-handler/internal/handler/main.go index 07970b8669..dcf31d5019 100644 --- a/services/backup-handler/internal/handler/main.go +++ b/services/backup-handler/internal/handler/main.go @@ -181,10 +181,11 @@ func (b *BackupHandler) WebhookHandler(w http.ResponseWriter, r *http.Request) { // now delete it from the api as it no longer exists _, err := lagoon.DeleteBackup(ctx, backup.BackupID, l) if err != nil { + // log, but don't break the loop log.Printf("unable to delete backup %v from api, error is %s:", backup.BackupID, err.Error()) - return + } else { + log.Printf("deleted backup %s for %s", backup.BackupID, backupsEnv.OpenshiftProjectName) } - log.Printf("deleted backup %s for %s", backup.BackupID, backupsEnv.OpenshiftProjectName) } }