Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stream does not close when pulling an image #19

Closed
exdx opened this issue Jul 13, 2022 · 2 comments
Closed

Stream does not close when pulling an image #19

exdx opened this issue Jul 13, 2022 · 2 comments

Comments

@exdx
Copy link

exdx commented Jul 13, 2022

  • Crate version: 0.9.1
  • OS: MacOS 12.3.1
  • Output of running docker version on the command line:
Client: Docker Engine - Community
 Cloud integration: 1.0.12
 Version:           20.10.5
 API version:       1.41
 Go version:        go1.13.15
 Git commit:        55c4c88
 Built:             Tue Mar  2 20:13:00 2021
 OS/Arch:           darwin/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.5
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.13.15
  Git commit:       363e9a8
  Built:            Tue Mar  2 20:15:47 2021
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.4
  GitCommit:        05f951a3781f4f2c1911b05e61c160e9c30eaa8e
 runc:
  Version:          1.0.0-rc93
  GitCommit:        12644e614e25b05da6fd08a38ffa0cfe1903fdec
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

When pulling an image, per the example in the repository, the image is able to be pulled successfully per the logs, but then the program just hangs, without moving out of the loop, at the end. Is there a way to close the stream or send None when the pull has finished?

    let pull_opts = PullOpts::builder().image(config.image.clone()).build();
    let images = docker.images();
    let mut stream = images.pull(&pull_opts);

    while let Some(pull_result) = stream.next().await {
        match pull_result {
            Ok(output) => {
                println!("{:?}", output);
            },
            Err(e) => eprintln!("{}", e),
        }
    }
@vv9k
Copy link
Owner

vv9k commented Jul 13, 2022

The issue should be resolved as of vv9k/containers-api-conn@b172a97 That I just commited. The fix was in a separate crate so you might need to cargo update before running your project again to see the results.

I've tested using the example of this crate:

$ cargo r --example image pull centos:latest

Before this commit it would hang at the end and after it correctly ends the process.

@exdx
Copy link
Author

exdx commented Jul 13, 2022

Thanks for the quick reply! Really appreciate it. I will go ahead and update the project, that seems like it will resolve the issue.

@exdx exdx closed this as completed Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants