Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds experimental flagging #576

Merged
merged 5 commits into from
Apr 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion cmd/pack/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ func main() {
logger.Error(err.Error())
os.Exit(1)
}

rootCmd := &cobra.Command{
Use: "pack",
PersistentPreRun: func(cmd *cobra.Command, args []string) {
Expand Down
6 changes: 5 additions & 1 deletion internal/commands/report_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ func testReportCommand(t *testing.T, when spec.G, it spec.S) {
packHome, err = ioutil.TempDir("", "")
h.AssertNil(t, err)
packConfigPath = filepath.Join(packHome, "config.toml")
h.AssertNil(t, ioutil.WriteFile(packConfigPath, []byte(`default-builder-image = "some/image"`), 0666))
h.AssertNil(t, ioutil.WriteFile(packConfigPath, []byte(`
default-builder-image = "some/image"
experimental = true
`), 0666))
packMissingHome, err = ioutil.TempDir("", "")
h.AssertNil(t, err)
})
Expand All @@ -63,6 +66,7 @@ func testReportCommand(t *testing.T, when spec.G, it spec.S) {
it("presents output", func() {
h.AssertNil(t, command.Execute())
h.AssertContains(t, outBuf.String(), `default-builder-image = "some/image"`)
h.AssertContains(t, outBuf.String(), `experimental = true`)
})
})
when("config.toml is not present", func() {
Expand Down
1 change: 1 addition & 0 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
type Config struct {
RunImages []RunImage `toml:"run-images"`
DefaultBuilder string `toml:"default-builder-image,omitempty"`
Experimental bool `toml:"experimental,omitempty"`
zmackie marked this conversation as resolved.
Show resolved Hide resolved
}

type RunImage struct {
Expand Down
1 change: 1 addition & 0 deletions internal/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ func testConfig(t *testing.T, when spec.G, it spec.S) {
h.AssertNil(t, err)
h.AssertEq(t, subject.DefaultBuilder, "")
h.AssertEq(t, len(subject.RunImages), 0)
h.AssertEq(t, subject.Experimental, false)
})
})
})
Expand Down