Skip to content

Commit

Permalink
Make GetBundleVersion OKD-aware
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
praveenkumar authored and anjannath committed Aug 1, 2022
1 parent 3eb6875 commit e031382
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ SHELL := /bin/bash

OPENSHIFT_VERSION ?= 4.10.22
PODMAN_VERSION ?= 4.1.1
OKD_VERSION ?= 4.10.0-0.okd-2022-06-24-212905
BUNDLE_EXTENSION = crcbundle
CRC_VERSION = 2.6.0.999
COMMIT_SHA=$(shell git rev-parse --short HEAD)
Expand Down Expand Up @@ -58,6 +59,7 @@ __check_defined = \
# Linker flags
VERSION_VARIABLES := -X $(REPOPATH)/pkg/crc/version.crcVersion=$(CRC_VERSION) \
-X $(REPOPATH)/pkg/crc/version.bundleVersion=$(OPENSHIFT_VERSION) \
-X $(REPOPATH)/pkg/crc/version.okdVersion=$(OKD_VERSION) \
-X $(REPOPATH)/pkg/crc/version.podmanVersion=$(PODMAN_VERSION) \
-X $(REPOPATH)/pkg/crc/version.commitSha=$(COMMIT_SHA)
RELEASE_VERSION_VARIABLES := -X $(REPOPATH)/pkg/crc/segment.WriteKey=cvpHsNcmGCJqVzf6YxrSnVlwFSAZaYtp
Expand Down
8 changes: 6 additions & 2 deletions pkg/crc/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ var (

okdBuild = "false"

okdVersion = "0.0.0-unset"
// will always be false on linux
// will be true for releases on macos and windows
// will be false for git builds on macos and windows
Expand Down Expand Up @@ -67,8 +68,11 @@ func GetCommitSha() string {
return commitSha
}

func GetBundleVersion(_ crcPreset.Preset) string {
return bundleVersion
func GetBundleVersion(preset crcPreset.Preset) string {
if preset == crcPreset.OpenShift {
return bundleVersion
}
return okdVersion
}

func GetPodmanVersion() string {
Expand Down

0 comments on commit e031382

Please sign in to comment.