fix(snapshots): remove the attempt to snapshot untrusted environments EE-7407 (#12044)

pull/12051/head
andres-portainer 4 months ago committed by GitHub
parent 6eb9e906af
commit 66119a8b57
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -15,9 +15,10 @@ import (
func TestPingAgentPanic(t *testing.T) {
endpoint := &portainer.Endpoint{
ID: 1,
EdgeID: "test-edge-id",
Type: portainer.EdgeAgentOnDockerEnvironment,
ID: 1,
EdgeID: "test-edge-id",
Type: portainer.EdgeAgentOnDockerEnvironment,
UserTrusted: true,
}
_, store := datastore.MustNewTestStore(t, true, true)

@ -40,7 +40,7 @@ func (s *Service) Open(endpoint *portainer.Endpoint) error {
return ErrAsyncEnv
}
if endpoint.ID == 0 || endpoint.EdgeID == "" {
if endpoint.ID == 0 || endpoint.EdgeID == "" || !endpoint.UserTrusted {
return ErrInvalidEnv
}

@ -64,7 +64,7 @@ func NewBackgroundSnapshotter(dataStore dataservices.DataStore, tunnelService po
}
for _, e := range endpoints {
if !endpointutils.IsEdgeEndpoint(&e) || e.Edge.AsyncMode {
if !endpointutils.IsEdgeEndpoint(&e) || e.Edge.AsyncMode || !e.UserTrusted {
continue
}

Loading…
Cancel
Save