Skip to content

Commit

Permalink
Merge pull request #3791 from uselagoon/backup-handler-fix-v2
Browse files Browse the repository at this point in the history
fix: delete backup in backup-handler
  • Loading branch information
tobybellwood authored Aug 7, 2024
2 parents 4d99bd2 + 66e4939 commit 88af552
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion services/backup-handler/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
6 changes: 2 additions & 4 deletions services/backup-handler/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
5 changes: 3 additions & 2 deletions services/backup-handler/internal/handler/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down

0 comments on commit 88af552

Please sign in to comment.