fix(snapshots): avoid a last-write-wins situation EE-5701 (#9156)

This commit is contained in:
andres-portainer
2023-07-05 17:27:05 -03:00
committed by GitHub
parent 91088a5e0f
commit 31d68f8091

View File

@@ -271,14 +271,7 @@ func (service *Service) snapshotEnvironment(endpointID portainer.EndpointID, tun
return err
}
endpointURL := endpoint.URL
endpoint.URL = fmt.Sprintf("tcp://127.0.0.1:%d", tunnelPort)
err = service.snapshotService.SnapshotEndpoint(endpoint)
if err != nil {
return err
}
endpoint.URL = endpointURL
return service.dataStore.Endpoint().UpdateEndpoint(endpoint.ID, endpoint)
return service.snapshotService.SnapshotEndpoint(endpoint)
}