1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-24 15:59:41 +02:00

refactor(edge/updates): sync changes from EE [EE-4288] (#7726)

This commit is contained in:
Chaim Lev-Ari 2022-12-01 08:40:52 +02:00 committed by GitHub
parent 4fee359247
commit 82e9e2a895
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
80 changed files with 1099 additions and 1892 deletions

View file

@ -30,32 +30,3 @@ func hasEndpointPredicate(endpointService dataservices.EndpointService, endpoint
return false, nil
}
type endpointRelationsConfig struct {
endpoints []portainer.Endpoint
endpointGroups []portainer.EndpointGroup
edgeGroups []portainer.EdgeGroup
}
func fetchEndpointRelationsConfig(dataStore dataservices.DataStore) (*endpointRelationsConfig, error) {
endpoints, err := dataStore.Endpoint().Endpoints()
if err != nil {
return nil, fmt.Errorf("unable to retrieve environments from database: %w", err)
}
endpointGroups, err := dataStore.EndpointGroup().EndpointGroups()
if err != nil {
return nil, fmt.Errorf("unable to retrieve environment groups from database: %w", err)
}
edgeGroups, err := dataStore.EdgeGroup().EdgeGroups()
if err != nil {
return nil, fmt.Errorf("unable to retrieve edge groups from database: %w", err)
}
return &endpointRelationsConfig{
endpoints: endpoints,
endpointGroups: endpointGroups,
edgeGroups: edgeGroups,
}, nil
}