File tree 1 file changed +6
-11
lines changed
pkg/bootstrap/docker/openshift 1 file changed +6
-11
lines changed Original file line number Diff line number Diff line change 7
7
"net/http"
8
8
"os"
9
9
"path/filepath"
10
+ "regexp"
10
11
"strconv"
11
12
"strings"
12
13
"time"
@@ -669,19 +670,13 @@ func (h *Helper) ServerPrereleaseVersion() (semver.Version, error) {
669
670
return semver.Version {}, fmt .Errorf ("did not find version in command output" )
670
671
}
671
672
672
- // The OSE version may have > 4 parts to the version string
673
- // We'll only take the first 3
674
- parts := strings .Split (versionStr , "." )
675
- if len (parts ) > 3 {
676
- versionStr = strings .Join (parts [:3 ], "." )
677
- }
673
+ // The OCP version may have > 4 parts to the version string,
674
+ // e.g. 3.5.1.1-prerelease, whereas Origin will be 3.5.1-prerelease,
675
+ // drop the 4th digit for OCP.
676
+ re := regexp .MustCompile ("([0-9]+).([0-9]+).([0-9]+).([0-9]+)(.*)" )
677
+ versionStr = re .ReplaceAllString (versionStr , "${1}.${2}.${3}${5}" )
678
678
679
679
version , err := semver .Parse (versionStr )
680
- if err == nil {
681
- // ignore pre-release portion
682
- version .Pre = []semver.PRVersion {}
683
- h .version = & version
684
- }
685
680
return version , err
686
681
}
687
682
You can’t perform that action at this time.
0 commit comments