Skip to content

Commit

Permalink
Implement crane edit (#1403)
Browse files Browse the repository at this point in the history
* Implement crane edit

This works at least on linux with neovim. If stdin appears to be
interactive, crane edit will open an editor with the contents of the
target manifest/config/file. Otherwise, crane edit will read the desired
contents from stdin and just overwrite them for the target.

* Use name.Repository.Digest intead of sprintf
  • Loading branch information
jonjohnsonjr committed Jul 13, 2022
1 parent e7a9f2b commit d187a71
Show file tree
Hide file tree
Showing 4 changed files with 660 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cmd/crane/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"path/filepath"

"github.com/docker/cli/cli/config"
"github.com/google/go-containerregistry/internal/cmd"
"github.com/google/go-containerregistry/pkg/crane"
"github.com/google/go-containerregistry/pkg/logs"
"github.com/google/go-containerregistry/pkg/v1/remote"
Expand Down Expand Up @@ -92,25 +93,26 @@ func New(use, short string, options []crane.Option) *cobra.Command {

commands := []*cobra.Command{
NewCmdAppend(&options),
NewCmdBlob(&options),
NewCmdAuth("crane", "auth"),
NewCmdBlob(&options),
NewCmdCatalog(&options),
NewCmdConfig(&options),
NewCmdCopy(&options),
NewCmdDelete(&options),
NewCmdDigest(&options),
cmd.NewCmdEdit(&options),
NewCmdExport(&options),
NewCmdFlatten(&options),
NewCmdList(&options),
NewCmdManifest(&options),
NewCmdMutate(&options),
NewCmdOptimize(&options),
NewCmdPull(&options),
NewCmdPush(&options),
NewCmdRebase(&options),
NewCmdTag(&options),
NewCmdValidate(&options),
NewCmdVersion(),
NewCmdMutate(&options),
}

root.AddCommand(commands...)
Expand Down

0 comments on commit d187a71

Please sign in to comment.