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

pull/12050/head
andres-portainer 4 months ago committed by GitHub
parent cc60836bb8
commit ef8e611e0a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -14,9 +14,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