Skip to content

Commit e031382

Browse files
praveenkumaranjannath
authored andcommitted
Make GetBundleVersion OKD-aware
The OKD version comes from the Makefile, and is currently set to 4.10.0-0.okd-2022-06-24-212905, since this is the bundle version we built and tested on linux.
1 parent 3eb6875 commit e031382

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ SHELL := /bin/bash
22

33
OPENSHIFT_VERSION ?= 4.10.22
44
PODMAN_VERSION ?= 4.1.1
5+
OKD_VERSION ?= 4.10.0-0.okd-2022-06-24-212905
56
BUNDLE_EXTENSION = crcbundle
67
CRC_VERSION = 2.6.0.999
78
COMMIT_SHA=$(shell git rev-parse --short HEAD)
@@ -58,6 +59,7 @@ __check_defined = \
5859
# Linker flags
5960
VERSION_VARIABLES := -X $(REPOPATH)/pkg/crc/version.crcVersion=$(CRC_VERSION) \
6061
-X $(REPOPATH)/pkg/crc/version.bundleVersion=$(OPENSHIFT_VERSION) \
62+
-X $(REPOPATH)/pkg/crc/version.okdVersion=$(OKD_VERSION) \
6163
-X $(REPOPATH)/pkg/crc/version.podmanVersion=$(PODMAN_VERSION) \
6264
-X $(REPOPATH)/pkg/crc/version.commitSha=$(COMMIT_SHA)
6365
RELEASE_VERSION_VARIABLES := -X $(REPOPATH)/pkg/crc/segment.WriteKey=cvpHsNcmGCJqVzf6YxrSnVlwFSAZaYtp

pkg/crc/version/version.go

+6-2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ var (
3030

3131
okdBuild = "false"
3232

33+
okdVersion = "0.0.0-unset"
3334
// will always be false on linux
3435
// will be true for releases on macos and windows
3536
// will be false for git builds on macos and windows
@@ -67,8 +68,11 @@ func GetCommitSha() string {
6768
return commitSha
6869
}
6970

70-
func GetBundleVersion(_ crcPreset.Preset) string {
71-
return bundleVersion
71+
func GetBundleVersion(preset crcPreset.Preset) string {
72+
if preset == crcPreset.OpenShift {
73+
return bundleVersion
74+
}
75+
return okdVersion
7276
}
7377

7478
func GetPodmanVersion() string {

0 commit comments

Comments
 (0)