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

unpack local file bundle #318

Merged
merged 2 commits into from
Feb 2, 2023
Merged

Conversation

santhoshdaivajna
Copy link
Contributor

issue : 317

take image file path as an input and extract the content to destination path.
ex: luet util unpack file://home/us/alpine.tar /tmp --local

if err != nil {
return nil, err
var err error
if strings.HasPrefix(local, filePrefix) {
Copy link
Owner

Choose a reason for hiding this comment

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

This is looking good! I think it's safe to just check the input for the file suffix. No need to specify --local at that point

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated.

DownloadAndExtractDockerImage will be called only if it's !local && !strings.HasPrefix(image, filePrefix)
rest of the cases - ExtractDockerImage will be called.

Copy link
Owner

@mudler mudler left a comment

Choose a reason for hiding this comment

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

Can we just make it available nevertheless if we are specifying --local or not? Local makes sense only to redirect requests to the local daemon

Copy link
Owner

@mudler mudler left a comment

Choose a reason for hiding this comment

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

looking good! thanks!

@mudler
Copy link
Owner

mudler commented Feb 2, 2023

care to add a small unit test? I'm trying to fix the CI in #319 meanwhile

@mudler mudler enabled auto-merge (squash) February 2, 2023 11:00
@mudler mudler merged commit d48006a into mudler:master Feb 2, 2023
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

Successfully merging this pull request may close these issues.

2 participants