Skip to content

Commit

Permalink
Make crane blob just print "boop"
Browse files Browse the repository at this point in the history
Signed-off-by: Josh Dolitsky <[email protected]>
  • Loading branch information
jdolitsky committed Jun 24, 2024
1 parent 1b4e407 commit ba86ac9
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions cmd/crane/cmd/blob.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ package cmd

import (
"fmt"
"io"

"github.com/google/go-containerregistry/pkg/crane"
"github.com/spf13/cobra"
Expand All @@ -28,20 +27,8 @@ func NewCmdBlob(options *[]crane.Option) *cobra.Command {
Use: "blob BLOB",
Short: "Read a blob from the registry",
Example: "crane blob ubuntu@sha256:4c1d20cdee96111c8acf1858b62655a37ce81ae48648993542b7ac363ac5c0e5 > blob.tar.gz",
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
src := args[0]
layer, err := crane.PullLayer(src, *options...)
if err != nil {
return fmt.Errorf("pulling layer %s: %w", src, err)
}
blob, err := layer.Compressed()
if err != nil {
return fmt.Errorf("fetching blob %s: %w", src, err)
}
if _, err := io.Copy(cmd.OutOrStdout(), blob); err != nil {
return fmt.Errorf("copying blob %s: %w", src, err)
}
fmt.Println("boop")
return nil
},
}
Expand Down

0 comments on commit ba86ac9

Please sign in to comment.