Skip to content

Can't read to EOF on BufReader returned from get_descriptor() #71

@allisonkarlitskaya

Description

@allisonkarlitskaya

If you call ImageProxy::get_descriptor() and try to call .read_to_end() on the returned impl AsyncBufRead then you'll stall forever.

    let (mut blob_reader, driver) = self.proxy.get_descriptor(&self.img, &descriptor).await?;
    blob_reader.read_to_end(&mut raw_config).await?;  // <- gets stuck here
    driver.await?;

Looking at the example code in the repository, you can see that something like this works, however:

    let (mut blob_reader, driver) = self.proxy.get_descriptor(&self.img, &descriptor).await?;
    let mut raw_config = vec![];
    let (a, b) = tokio::join!(blob_reader.read_to_end(&mut raw_config), driver);
    a?;
    b?;

It would be cool if either:

  • the 'naive' approach worked; or
  • what you need to do with the return values got documented as part of the function docs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions