Skip to content

Commit

Permalink
duffle import should no longer load images from tar files
Browse files Browse the repository at this point in the history
Support for loading invocation images from the OCI image layout is deferred to
https://github.com/deislabs/duffle/issues/758.

Ref cnabio#767
  • Loading branch information
glyn committed Jun 13, 2019
1 parent b76a500 commit 45382f7
Showing 1 changed file with 1 addition and 31 deletions.
32 changes: 1 addition & 31 deletions pkg/packager/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"errors"
"fmt"
"io"
"os"
"path/filepath"
"strings"
Expand Down Expand Up @@ -90,36 +89,7 @@ func (im *Importer) Import() error {
return fmt.Errorf("failed to load and validate bundle.%s: %s", ext, err)
}

artifactsDir := filepath.Join(dest, "artifacts")
_, err = os.Stat(artifactsDir)
if err == nil {
filepath.Walk(artifactsDir, func(path string, info os.FileInfo, err error) error {
if err != nil {
return err
}

if info.IsDir() {
return nil
}

file, err := os.Open(path)
if err != nil {
return err
}
defer file.Close()
out, err := im.Client.ImageLoad(context.Background(), file, false)
if err != nil {
return err
}
defer out.Body.Close()

if im.Verbose {
io.Copy(os.Stdout, out.Body)
}

return nil
})
}
// TODO: https://github.com/deislabs/duffle/issues/758

return nil
}

0 comments on commit 45382f7

Please sign in to comment.