From 0574da741535aefd980d26ee5411b393965ab05a Mon Sep 17 00:00:00 2001 From: Jan Braje <12571346+janluak@users.noreply.github.com> Date: Mon, 20 Jul 2026 13:13:47 +0200 Subject: [PATCH] allow default bump type Signed-off-by: Jan Braje <12571346+janluak@users.noreply.github.com> --- pkg/action/bump.go | 3 +++ pkg/cmd/bump_test.go | 4 ++++ pkg/cmd/testdata/output/bump-default.txt | 1 + pkg/cmd/testdata/output/bump-patch.txt | 2 +- 4 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 pkg/cmd/testdata/output/bump-default.txt diff --git a/pkg/action/bump.go b/pkg/action/bump.go index 25a592f22..9085e14da 100644 --- a/pkg/action/bump.go +++ b/pkg/action/bump.go @@ -61,6 +61,9 @@ func (b *Bump) Run(bumpType string, chartpath string) (string, error) { if err != nil { return "", err } + if bumpType == "" { + bumpType = "patch" + } b.bump = bumpType currentVersion := strings.TrimSpace(string(cv)) diff --git a/pkg/cmd/bump_test.go b/pkg/cmd/bump_test.go index 4b2aae213..e95cc5f1c 100644 --- a/pkg/cmd/bump_test.go +++ b/pkg/cmd/bump_test.go @@ -54,6 +54,10 @@ func TestBump(t *testing.T) { wantError: true, }, { name: "default", + cmd: "bump " + tempChartDir, + golden: "output/bump-default.txt", + }, { + name: "patch", cmd: "bump patch " + tempChartDir, golden: "output/bump-patch.txt", }, { diff --git a/pkg/cmd/testdata/output/bump-default.txt b/pkg/cmd/testdata/output/bump-default.txt new file mode 100644 index 000000000..f642a03e6 --- /dev/null +++ b/pkg/cmd/testdata/output/bump-default.txt @@ -0,0 +1 @@ +changed chart version to "0.1.1" diff --git a/pkg/cmd/testdata/output/bump-patch.txt b/pkg/cmd/testdata/output/bump-patch.txt index f642a03e6..70cc90c57 100644 --- a/pkg/cmd/testdata/output/bump-patch.txt +++ b/pkg/cmd/testdata/output/bump-patch.txt @@ -1 +1 @@ -changed chart version to "0.1.1" +changed chart version to "0.1.2"