fix(docker/swarm): suppress no such container logs (#10604)

pull/10605/head
Oscar Zhou 2023-11-08 11:43:42 +13:00 committed by GitHub
parent 3fd696d6b5
commit e6ef913bb1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -174,7 +174,12 @@ func snapshotContainers(snapshot *portainer.DockerSnapshot, cli *client.Client)
if !snapshot.Swarm { if !snapshot.Swarm {
return err return err
} else { } else {
log.Info().Str("container", container.ID).Err(err).Msg("unable to inspect container in other Swarm nodes") if !strings.Contains(err.Error(), "No such container") {
return err
}
// It is common to have containers running on different Swarm nodes,
// so we just log the error in the debug level
log.Debug().Str("container", container.ID).Err(err).Msg("unable to inspect container in other Swarm nodes")
} }
} else { } else {
var gpuOptions *_container.DeviceRequest = nil var gpuOptions *_container.DeviceRequest = nil