1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-25 00:09:40 +02:00

fix(axios): correctly encode urls [BE-11648] (#517)

fix(edgegroup): nil pointer defer
This commit is contained in:
Devon Steenberg 2025-04-02 08:51:58 +13:00 committed by GitHub
parent 7e5db1f55e
commit 4c1e80ff58
4 changed files with 154 additions and 8 deletions

View file

@ -1,6 +1,8 @@
package edge
import (
"slices"
portainer "github.com/portainer/portainer/api"
"github.com/portainer/portainer/api/dataservices"
"github.com/portainer/portainer/api/internal/endpointutils"
@ -70,17 +72,11 @@ func GetEndpointsFromEdgeGroups(edgeGroupIDs []portainer.EdgeGroupID, datastore
// edgeGroupRelatedToEndpoint returns true if edgeGroup is associated with environment(endpoint)
func edgeGroupRelatedToEndpoint(edgeGroup *portainer.EdgeGroup, endpoint *portainer.Endpoint, endpointGroup *portainer.EndpointGroup) bool {
if !edgeGroup.Dynamic {
for _, endpointID := range edgeGroup.Endpoints {
if endpoint.ID == endpointID {
return true
}
}
return false
return slices.Contains(edgeGroup.Endpoints, endpoint.ID)
}
endpointTags := tag.Set(endpoint.TagIDs)
if endpointGroup.TagIDs != nil {
if endpointGroup != nil && endpointGroup.TagIDs != nil {
endpointTags = tag.Union(endpointTags, tag.Set(endpointGroup.TagIDs))
}