From f69825d859380de87d31c67e2a81db0a0c729a69 Mon Sep 17 00:00:00 2001 From: LP B Date: Tue, 20 Aug 2024 10:20:07 +0200 Subject: [PATCH] fix(api/edge_stacks): ensure edge stacks related endpoints list generation returns unique elements (#12102) --- api/internal/edge/edgestack.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/internal/edge/edgestack.go b/api/internal/edge/edgestack.go index 1a03f1c23..4fce33041 100644 --- a/api/internal/edge/edgestack.go +++ b/api/internal/edge/edgestack.go @@ -6,6 +6,7 @@ import ( portainer "github.com/portainer/portainer/api" "github.com/portainer/portainer/api/dataservices" + "github.com/portainer/portainer/api/internal/unique" ) var ErrEdgeGroupNotFound = errors.New("edge group was not found") @@ -32,7 +33,7 @@ func EdgeStackRelatedEndpoints(edgeGroupIDs []portainer.EdgeGroupID, endpoints [ edgeStackEndpoints = append(edgeStackEndpoints, EdgeGroupRelatedEndpoints(edgeGroup, endpoints, endpointGroups)...) } - return edgeStackEndpoints, nil + return unique.Unique(edgeStackEndpoints), nil } type EndpointRelationsConfig struct {