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

pull/9157/head
andres-portainer 1 year ago committed by GitHub
parent 91088a5e0f
commit 31d68f8091
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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)
}

Loading…
Cancel
Save