Skip to content

Commit

Permalink
Allow Bundle Spec's with version 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
djzager committed Jun 28, 2018
1 parent b505505 commit ee734ce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions bundle/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ func (s *Spec) ValidateVersion() bool {
func (s *Spec) checkVersion() bool {
specSemver, err := semver.NewVersion(s.Version)
if err != nil {
if s.Version == "1.0" {
log.Warningf("Spec version is not semver compatable")
return true
}
log.Errorf("Failed to init semver - %v", err)
return false
}
Expand Down
6 changes: 3 additions & 3 deletions bundle/version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ func TestValidateVersion(t *testing.T) {
testSpec.Runtime = 2
ft.True(t, testSpec.ValidateVersion())

// Test Invalid Spec Versions
testSpec.Version = "1.0" // not valid semver
ft.False(t, testSpec.ValidateVersion())
testSpec.Version = "1.0" // Deprecated Spec Version
ft.True(t, testSpec.ValidateVersion())

// Test Invalid Spec Versions
testSpec.Version = "0.9.0" // less than min
ft.False(t, testSpec.ValidateVersion())

Expand Down

0 comments on commit ee734ce

Please sign in to comment.