fix(docker/volume): failed to list volume before snapshot is created [BE-11544] (#286)

pull/12480/head
Oscar Zhou 2025-01-08 09:45:13 +13:00 committed by GitHub
parent e2b812a611
commit 4010174f66
1 changed files with 1 additions and 1 deletions

View File

@ -224,7 +224,7 @@ func (transport *Transport) getDockerID() (string, error) {
if transport.snapshotService != nil {
endpoint := portainer.Endpoint{ID: transport.endpoint.ID}
if err := transport.snapshotService.FillSnapshotData(&endpoint); err == nil {
if err := transport.snapshotService.FillSnapshotData(&endpoint); err == nil && len(endpoint.Snapshots) > 0 {
if dockerID, err := snapshot.FetchDockerID(endpoint.Snapshots[0]); err == nil {
transport.dockerID = dockerID
return dockerID, nil