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

chore(code): reduce divergence with EE EE-4344 (#7748)

This commit is contained in:
andres-portainer 2022-09-28 14:56:32 -03:00 committed by GitHub
parent e9384a6987
commit cb79dc18f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
102 changed files with 259 additions and 180 deletions

View file

@ -1,7 +1,8 @@
package edge
import (
"github.com/portainer/portainer/api"
portainer "github.com/portainer/portainer/api"
"github.com/portainer/portainer/api/internal/endpointutils"
"github.com/portainer/portainer/api/internal/tag"
)
@ -13,7 +14,7 @@ func EdgeGroupRelatedEndpoints(edgeGroup *portainer.EdgeGroup, endpoints []porta
endpointIDs := []portainer.EndpointID{}
for _, endpoint := range endpoints {
if endpoint.Type != portainer.EdgeAgentOnDockerEnvironment && endpoint.Type != portainer.EdgeAgentOnKubernetesEnvironment {
if !endpointutils.IsEdgeEndpoint(&endpoint) {
continue
}

View file

@ -2,6 +2,7 @@ package edge
import (
"errors"
"github.com/portainer/portainer/api"
)

View file

@ -23,5 +23,4 @@ func EndpointRelatedEdgeStacks(endpoint *portainer.Endpoint, endpointGroup *port
}
return relatedEdgeStacks
}

View file

@ -3,6 +3,7 @@ package registryutils
import (
"encoding/base64"
"encoding/json"
portainer "github.com/portainer/portainer/api"
)

View file

@ -213,6 +213,10 @@ func (service *Service) snapshotEndpoints() error {
continue
}
if endpoint.URL == "" {
continue
}
snapshotError := service.SnapshotEndpoint(&endpoint)
latestEndpointReference, err := service.dataStore.Endpoint().Endpoint(endpoint.ID)

View file

@ -11,7 +11,6 @@ import (
// to prevent an error when url has port but no protocol prefix
// we add `//` prefix if needed
func ParseURL(endpointURL string) (*url.URL, error) {
if !strings.HasPrefix(endpointURL, "http") &&
!strings.HasPrefix(endpointURL, "tcp") &&
!strings.HasPrefix(endpointURL, "//") &&