Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit 3a6e368

Browse files
authored
Merge pull request #136 from mnottale/pack-push-out-of-experimental
Move out of experimental: pack, unpack, save, load, push, pull.
2 parents 88d3d83 + 5662361 commit 3a6e368

File tree

7 files changed

+17
-38
lines changed

7 files changed

+17
-38
lines changed

cmd/load.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,19 @@ package cmd
22

33
import (
44
"github.com/docker/cli/cli"
5-
"github.com/docker/lunchbox/internal"
65
"github.com/docker/lunchbox/packager"
76
"github.com/spf13/cobra"
87
)
98

109
var loadCmd = &cobra.Command{
1110
Use: "load <repotag>",
12-
Short: "Load an app from docker",
11+
Short: "Load an application from a docker image",
1312
Args: cli.RequiresMaxArgs(1),
1413
RunE: func(cmd *cobra.Command, args []string) error {
1514
return packager.Load(firstOrEmpty(args))
1615
},
1716
}
1817

1918
func init() {
20-
if internal.Experimental == "on" {
21-
rootCmd.AddCommand(loadCmd)
22-
}
19+
rootCmd.AddCommand(loadCmd)
2320
}

cmd/pack.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@ package cmd
22

33
import (
44
"github.com/docker/cli/cli"
5-
"github.com/docker/lunchbox/internal"
65
"github.com/docker/lunchbox/packager"
76
"github.com/spf13/cobra"
87
)
98

109
var packCmd = &cobra.Command{
1110
Use: "pack [<app-name>] [-o output_file]",
12-
Short: "Pack this app as a single file",
11+
Short: "Pack the application as a single file",
1312
Args: cli.RequiresMaxArgs(1),
1413
RunE: func(cmd *cobra.Command, args []string) error {
1514
return packager.Pack(firstOrEmpty(args), packOutputFile)
@@ -19,8 +18,6 @@ var packCmd = &cobra.Command{
1918
var packOutputFile string
2019

2120
func init() {
22-
if internal.Experimental == "on" {
23-
rootCmd.AddCommand(packCmd)
24-
packCmd.Flags().StringVarP(&packOutputFile, "output", "o", "-", "Output file (- for stdout)")
25-
}
21+
rootCmd.AddCommand(packCmd)
22+
packCmd.Flags().StringVarP(&packOutputFile, "output", "o", "-", "Output file (- for stdout)")
2623
}

cmd/pull.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,19 @@ package cmd
22

33
import (
44
"github.com/docker/cli/cli"
5-
"github.com/docker/lunchbox/internal"
65
"github.com/docker/lunchbox/packager"
76
"github.com/spf13/cobra"
87
)
98

109
var pullCmd = &cobra.Command{
1110
Use: "pull <repotag>",
12-
Short: "Pull an app from a registry",
11+
Short: "Pull an application from a registry",
1312
Args: cli.ExactArgs(1),
1413
RunE: func(cmd *cobra.Command, args []string) error {
1514
return packager.Pull(args[0])
1615
},
1716
}
1817

1918
func init() {
20-
if internal.Experimental == "on" {
21-
rootCmd.AddCommand(pullCmd)
22-
}
19+
rootCmd.AddCommand(pullCmd)
2320
}

cmd/push.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package cmd
22

33
import (
44
"github.com/docker/cli/cli"
5-
"github.com/docker/lunchbox/internal"
65
"github.com/docker/lunchbox/packager"
76
"github.com/spf13/cobra"
87
)
@@ -25,9 +24,7 @@ var (
2524
)
2625

2726
func init() {
28-
if internal.Experimental == "on" {
29-
rootCmd.AddCommand(pushCmd)
30-
pushCmd.Flags().StringVarP(&pushPrefix, "prefix", "p", "", "prefix to use")
31-
pushCmd.Flags().StringVarP(&pushTag, "tag", "t", "latest", "tag to use")
32-
}
27+
rootCmd.AddCommand(pushCmd)
28+
pushCmd.Flags().StringVarP(&pushPrefix, "prefix", "p", "", "prefix to use")
29+
pushCmd.Flags().StringVarP(&pushTag, "tag", "t", "latest", "tag to use")
3330
}

cmd/save.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package cmd
22

33
import (
44
"github.com/docker/cli/cli"
5-
"github.com/docker/lunchbox/internal"
65
"github.com/docker/lunchbox/packager"
76
"github.com/spf13/cobra"
87
)
@@ -25,9 +24,7 @@ var (
2524
)
2625

2726
func init() {
28-
if internal.Experimental == "on" {
29-
rootCmd.AddCommand(saveCmd)
30-
saveCmd.Flags().StringVarP(&savePrefix, "prefix", "p", "", "prefix to use")
31-
saveCmd.Flags().StringVarP(&saveTag, "tag", "t", "latest", "tag to use")
32-
}
27+
rootCmd.AddCommand(saveCmd)
28+
saveCmd.Flags().StringVarP(&savePrefix, "prefix", "p", "", "prefix to use")
29+
saveCmd.Flags().StringVarP(&saveTag, "tag", "t", "latest", "tag to use")
3330
}

cmd/unpack.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@ package cmd
22

33
import (
44
"github.com/docker/cli/cli"
5-
"github.com/docker/lunchbox/internal"
65
"github.com/docker/lunchbox/packager"
76
"github.com/spf13/cobra"
87
)
98

109
var unpackCmd = &cobra.Command{
1110
Use: "unpack <app-name> [-o output_dir]",
12-
Short: "Unpack the app to expose the content",
11+
Short: "Unpack the application to expose the content",
1312
Args: cli.RequiresMaxArgs(1),
1413
RunE: func(cmd *cobra.Command, args []string) error {
1514
return packager.Unpack(firstOrEmpty(args), unpackOutputDir)
@@ -19,8 +18,6 @@ var unpackCmd = &cobra.Command{
1918
var unpackOutputDir string
2019

2120
func init() {
22-
if internal.Experimental == "on" {
23-
rootCmd.AddCommand(unpackCmd)
24-
unpackCmd.Flags().StringVarP(&unpackOutputDir, "output", "o", ".", "Output directory (.)")
25-
}
21+
rootCmd.AddCommand(unpackCmd)
22+
unpackCmd.Flags().StringVarP(&unpackOutputDir, "output", "o", ".", "Output directory (.)")
2623
}

e2e/binary_test.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,7 @@ func TestInspectBinary(t *testing.T) {
199199
}
200200

201201
func TestPackBinary(t *testing.T) {
202-
dockerApp, hasExperimental := getBinary(t)
203-
if !hasExperimental {
204-
t.Skip("experimental mode needed for this test")
205-
}
202+
dockerApp, _ := getBinary(t)
206203
tempDir, err := ioutil.TempDir("", "dockerapp")
207204
assert.NilError(t, err)
208205
defer os.RemoveAll(tempDir)

0 commit comments

Comments
 (0)