From 1e85edd30fc68daa074967c3ffc142d05cd7be60 Mon Sep 17 00:00:00 2001 From: Artem Gavrilov Date: Fri, 25 Aug 2023 11:39:07 +0200 Subject: [PATCH] PMM-12448 Fix bug --- dev/mongo-rs-backups/docker-compose.yml | 1 + managed/services/preconditions.go | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/dev/mongo-rs-backups/docker-compose.yml b/dev/mongo-rs-backups/docker-compose.yml index 458674b664..001be6355c 100644 --- a/dev/mongo-rs-backups/docker-compose.yml +++ b/dev/mongo-rs-backups/docker-compose.yml @@ -1,6 +1,7 @@ networks: pmm_default: name: pmm_default + external: true services: mongo1: diff --git a/managed/services/preconditions.go b/managed/services/preconditions.go index 41e06cf179..d6b09579d4 100644 --- a/managed/services/preconditions.go +++ b/managed/services/preconditions.go @@ -117,7 +117,9 @@ func CheckArtifactOverlapping(q *reform.Querier, serviceID, locationID, folder s } for _, artifact := range artifacts { - if artifact.ServiceID != serviceID { + // We skip artifacts made on services that are no longer exists in PMM. However, in future we can improve this function + // by storing required information right in artifact model. + if artifact.ServiceID != "" && artifact.ServiceID != serviceID { svc, err := models.FindServiceByID(q, artifact.ServiceID) if err != nil { return err