Skip to content

Conversation

@dmcgowan
Copy link
Member

@dmcgowan dmcgowan commented Mar 1, 2023

Carry of #7916


Ref #7592

Summary

Implement exporting image using the new Transfer API.

Implementation Details

Invoke the Transfer API with a dummy image.Store as source and archive.ImageExportStream as destination.

The reason why a dummy image.Store is chosen as source here is I learnt that the images to export are actually read on the containerd side, not ctr and we need to distinguish the export scenario from the others, so I choose to send a dummy image.Store to tell the local transfer service about that.

In addition, I have added some options to the archive.ImageExportStream to gain the same ability as "non-local" export. These options are hold in a config struct, does not follow the functional options pattern, b/c I think this would save me some typings. This might be opinionated, I could switch to functional options if that's necessary.

@k8s-ci-robot
Copy link

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@dmcgowan
Copy link
Member Author

dmcgowan commented Mar 2, 2023

/test all

@dmcgowan dmcgowan marked this pull request as ready for review March 2, 2023 01:17
@dmcgowan dmcgowan added this to the 1.7 milestone Mar 2, 2023
@estesp
Copy link
Member

estesp commented Mar 2, 2023

needs rebase

@dmcgowan dmcgowan force-pushed the transfer-export-image branch from eee7692 to 3f33fcb Compare March 2, 2023 17:11
Copy link
Member

@mikebrow mikebrow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.. just had one comment

return err
}

return nil
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit ... without the progress update here.. return err would be the same as !=nil return.. then return nil here

@dmcgowan dmcgowan force-pushed the transfer-export-image branch from 3f33fcb to 13bf556 Compare March 2, 2023 19:15
Copy link
Member

@mikebrow mikebrow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

6 participants