Skip to content

Commit 0c40ec8

Browse files
authored
feat(crane): add option to allow pushing non-distributable layers (#1348)
Signed-off-by: jwiegratz <[email protected]> Signed-off-by: jwhb <[email protected]>
1 parent 2a21d4f commit 0c40ec8

24 files changed

+102
-67
lines changed

cmd/crane/cmd/root.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ var Root = New(use, short, []crane.Option{})
3838
func New(use, short string, options []crane.Option) *cobra.Command {
3939
verbose := false
4040
insecure := false
41+
ndlayers := false
4142
platform := &platformValue{}
4243

4344
root := &cobra.Command{
@@ -55,6 +56,9 @@ func New(use, short string, options []crane.Option) *cobra.Command {
5556
if insecure {
5657
options = append(options, crane.Insecure)
5758
}
59+
if ndlayers {
60+
options = append(options, crane.WithNondistributable())
61+
}
5862
if Version != "" {
5963
binary := "crane"
6064
if len(os.Args[0]) != 0 {
@@ -113,6 +117,7 @@ func New(use, short string, options []crane.Option) *cobra.Command {
113117

114118
root.PersistentFlags().BoolVarP(&verbose, "verbose", "v", false, "Enable debug logs")
115119
root.PersistentFlags().BoolVar(&insecure, "insecure", false, "Allow image references to be fetched without TLS")
120+
root.PersistentFlags().BoolVar(&ndlayers, "allow-nondistributable-artifacts", false, "Allow pushing non-distributable (foreign) layers")
116121
root.PersistentFlags().Var(platform, "platform", "Specifies the platform in the form os/arch[/variant][:osversion] (e.g. linux/amd64).")
117122

118123
return root

cmd/crane/doc/crane.md

Lines changed: 5 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/crane/doc/crane_append.md

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/crane/doc/crane_auth.md

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/crane/doc/crane_auth_get.md

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/crane/doc/crane_auth_login.md

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/crane/doc/crane_blob.md

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/crane/doc/crane_catalog.md

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/crane/doc/crane_config.md

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/crane/doc/crane_copy.md

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)