fix(snapshots): remove the attempt to snapshot untrusted environments EE-7407 (#12044)
parent
6eb9e906af
commit
66119a8b57
|
@ -15,9 +15,10 @@ import (
|
||||||
|
|
||||||
func TestPingAgentPanic(t *testing.T) {
|
func TestPingAgentPanic(t *testing.T) {
|
||||||
endpoint := &portainer.Endpoint{
|
endpoint := &portainer.Endpoint{
|
||||||
ID: 1,
|
ID: 1,
|
||||||
EdgeID: "test-edge-id",
|
EdgeID: "test-edge-id",
|
||||||
Type: portainer.EdgeAgentOnDockerEnvironment,
|
Type: portainer.EdgeAgentOnDockerEnvironment,
|
||||||
|
UserTrusted: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
_, store := datastore.MustNewTestStore(t, true, true)
|
_, store := datastore.MustNewTestStore(t, true, true)
|
||||||
|
|
|
@ -40,7 +40,7 @@ func (s *Service) Open(endpoint *portainer.Endpoint) error {
|
||||||
return ErrAsyncEnv
|
return ErrAsyncEnv
|
||||||
}
|
}
|
||||||
|
|
||||||
if endpoint.ID == 0 || endpoint.EdgeID == "" {
|
if endpoint.ID == 0 || endpoint.EdgeID == "" || !endpoint.UserTrusted {
|
||||||
return ErrInvalidEnv
|
return ErrInvalidEnv
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,7 @@ func NewBackgroundSnapshotter(dataStore dataservices.DataStore, tunnelService po
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, e := range endpoints {
|
for _, e := range endpoints {
|
||||||
if !endpointutils.IsEdgeEndpoint(&e) || e.Edge.AsyncMode {
|
if !endpointutils.IsEdgeEndpoint(&e) || e.Edge.AsyncMode || !e.UserTrusted {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue