diff --git a/version.go b/version.go index 50d56b6..ea1aa1e 100644 --- a/version.go +++ b/version.go @@ -387,6 +387,9 @@ func (v Version) IncPreRelease() (Version, error) { if !(v.IsPrerelease()) { return Version{}, errors.New("version is not a prerelease") } + if v.phaseSubOrdinal > 0 || v.customOrdinal > 0 { + return Version{}, errors.New("only unmodified CRDB versions are supported") + } nextVersion := Version{ raw: v.raw, phase: v.phase, diff --git a/version_test.go b/version_test.go index 7baa926..fb1dcba 100644 --- a/version_test.go +++ b/version_test.go @@ -704,10 +704,12 @@ func TestIncPreRelease(t *testing.T) { {"v21.2.0-alpha.1", "v21.2.0-alpha.2", false}, {"v21.1.0-beta.3", "v21.1.0-beta.4", false}, {"v21.1.0-rc.3", "v21.1.0-rc.4", false}, + {"v21.1.0-rc.3-cloudonly.1", "", true}, {"v21.1.0-cloudonly.1", "", true}, {"v21.1.0", "", true}, {"v21.1.8", "", true}, {"v26.4.8", "", true}, + {"v26.4.8-cloudonly.1", "", true}, {"v21.1.0-customLabel", "", true}, {"v21.1.0-1-g9cbe7c5281", "", true}, {"v21.1.0-1-g9cbe7c5281-customLabel", "", true},