Repository: code-ready/crc
Pull request #3272 (2022-07-25 12:08:08)

Add OKD as preset
## Solution/Idea

This PR adds okd as preset so now with same crc binary user can choose to run ocp or okd. Default preset still be Openshift.

## Proposed changes

List main as well as consequential changes you introduced or had to introduce.
- Add okd as preset

## Testing
- crc config set preset okd
- crc setup => should download the okd bundle
- crc start => should provision the okd cluster.


openshift-ci[bot]: [APPROVALNOTIFIER] This PR is **NOT APPROVED**

This pull-request has been approved by:
**Once this PR has been reviewed and has the lgtm label**, please ask for approval from praveenkumar by writing `/assign @praveenkumar` in a comment. For more information see:[The Kubernetes Code Review Process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process).

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=code-ready%2Fcrc).

<details open>
Needs approval from an approver in each of these files:

- **[OWNERS](https://github.com/code-ready/crc/blob/main/OWNERS)**

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":["praveenkumar"]} -->
openshift-ci[bot]: @praveenkumar: The following test **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
ci/prow/e2e-crc | fb21346d8c0147ee76da433cea34b533990aa047 | [link](https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/code-ready_crc/3272/pull-ci-code-ready-crc-main-e2e-crc/1551539807421730816) | true | `/test e2e-crc`

[Full PR test history](https://prow.ci.openshift.org/pr-history?org=code-ready&repo=crc&pr=3272). [Your PR dashboard](https://prow.ci.openshift.org/pr?query=is:pr+state:open+author:praveenkumar).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
openshift-ci[bot]: @praveenkumar: The following test **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
ci/prow/integration-crc | d408826ef5ec9f57389cd590469331599e0c63e2 | [link](https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/code-ready_crc/3272/pull-ci-code-ready-crc-main-integration-crc/1552205059180204032) | true | `/test integration-crc`

[Full PR test history](https://prow.ci.openshift.org/pr-history?org=code-ready&repo=crc&pr=3272). [Your PR dashboard](https://prow.ci.openshift.org/pr?query=is:pr+state:open+author:praveenkumar).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
openshift-ci[bot]: @praveenkumar: The following tests **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
ci/prow/integration-crc | d408826ef5ec9f57389cd590469331599e0c63e2 | [link](https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/code-ready_crc/3272/pull-ci-code-ready-crc-main-integration-crc/1552205059180204032) | true | `/test integration-crc`
ci/prow/e2e-crc | d408826ef5ec9f57389cd590469331599e0c63e2 | [link](https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/code-ready_crc/3272/pull-ci-code-ready-crc-main-e2e-crc/1552205059104706560) | true | `/test e2e-crc`

[Full PR test history](https://prow.ci.openshift.org/pr-history?org=code-ready&repo=crc&pr=3272). [Your PR dashboard](https://prow.ci.openshift.org/pr?query=is:pr+state:open+author:praveenkumar).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
cfergeau: I had to add
```
diff --git a/pkg/crc/machine/vsock.go b/pkg/crc/machine/vsock.go
index 9d2e4a9f..d6a60e71 100644
--- a/pkg/crc/machine/vsock.go
+++ b/pkg/crc/machine/vsock.go
@@ -94,6 +94,7 @@ func vsockPorts(preset crcPreset.Preset) []types.ExposeRequest {
        }
        switch preset {
        case crcPreset.OpenShift:
+       case crcPreset.OKD:
                exposeRequest = append(exposeRequest,
                        types.ExposeRequest{
                                Protocol: "tcp",
```
for testing
cfergeau: Fwiw, the stable okd version you picked is now red in https://amd64.origin.releases.ci.openshift.org/#4-stable :( But it's because of upgrade failures apparently, which is not a problem for us.
praveenkumar:  



> I had to add
> 
> ```
> diff --git a/pkg/crc/machine/vsock.go b/pkg/crc/machine/vsock.go
> index 9d2e4a9f..d6a60e71 100644
> --- a/pkg/crc/machine/vsock.go
> +++ b/pkg/crc/machine/vsock.go
> @@ -94,6 +94,7 @@ func vsockPorts(preset crcPreset.Preset) []types.ExposeRequest {
>         }
>         switch preset {
>         case crcPreset.OpenShift:
> +       case crcPreset.OKD:
>                 exposeRequest = append(exposeRequest,
>                         types.ExposeRequest{
>                                 Protocol: "tcp",
> ```
> 
> for testing

@cfergeau ah yes because as of now we are only exposing it for Openshift preset. will add it 👍🏼 
praveenkumar: > Fwiw, the stable okd version you picked is now red in https://amd64.origin.releases.ci.openshift.org/#4-stable :( But it's because of upgrade failures apparently, which is not a problem for us.

Ah it is one from the github releases but yes upgrade failure is not issue for us.
cfergeau: Another missing update: https://github.com/code-ready/crc/blob/b91afcd751135be1d3955f1c714d70b99bd4db93/pkg/crc/constants/constants.go#L186-L209
praveenkumar: All the suggestions are now incorporated.
praveenkumar: /assign @anjannath 
openshift-ci[bot]: [APPROVALNOTIFIER] This PR is **NOT APPROVED**

This pull-request has been approved by:
**Once this PR has been reviewed and has the lgtm label**, please ask for approval from anjannath by writing `/assign @anjannath` in a comment. For more information see:[The Kubernetes Code Review Process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process).

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=code-ready%2Fcrc).

<details open>
Needs approval from an approver in each of these files:

- **[OWNERS](https://github.com/code-ready/crc/blob/main/OWNERS)**

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":["anjannath"]} -->
anjannath: There's another two instance of `OpenShift` on the start logs, that we might want to change to `OKD`

```
INFO Starting OpenShift kubelet service
```

and at the end before the oc login templates..
```
Started the OpenShift cluster.
```
openshift-ci[bot]: @praveenkumar: The following test **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
ci/prow/e2e-crc | 52dd70d3cd9d05394cd78184e76c01c4a0905a2e | [link](https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/code-ready_crc/3272/pull-ci-code-ready-crc-main-e2e-crc/1553987517810741248) | true | `/test e2e-crc`

[Full PR test history](https://prow.ci.openshift.org/pr-history?org=code-ready&repo=crc&pr=3272). [Your PR dashboard](https://prow.ci.openshift.org/pr?query=is:pr+state:open+author:praveenkumar).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
anjannath: cert rotation test is failing, re-running the `e2e` tests:
```
 --- Failed steps:
  Scenario: Start CRC # features/cert_rotation.feature:16
    When starting CRC with default bundle along with stopped network time synchronization succeeds # features/cert_rotation.feature:17
      Error: command 'CRC_DISABLE_UPDATE_CHECK=true CRC_DEBUG_ENABLE_STOP_NTP=true crc start -p '/home/packer/pull-secret' -b /home/packer/crc_libvirt_4.10.22_amd64.crcbundle', expected to succeed, exited with exit code: 1 
```

/test e2e-crc
praveenkumar: > There's another two instance of `OpenShift` on the start logs, that we might want to change to `OKD`
> 
> ```
> INFO Starting OpenShift kubelet service

I think here we should remove `OpenShift` all together. It should be just `INFO Starting kubelet service`

> ```
> 
> and at the end before the oc login templates..
> 
> ```
> Started the OpenShift cluster.
> ```

This is coming from start template and at the end we are already having `Note` section for `okd` preset.

openshift-ci[bot]: @praveenkumar: The following test **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
ci/prow/e2e-crc | 225d76c133f2b1191d29573ec2fd55b008ade517 | [link](https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/code-ready_crc/3272/pull-ci-code-ready-crc-main-e2e-crc/1554026580152422400) | true | `/test e2e-crc`

[Full PR test history](https://prow.ci.openshift.org/pr-history?org=code-ready&repo=crc&pr=3272). [Your PR dashboard](https://prow.ci.openshift.org/pr?query=is:pr+state:open+author:praveenkumar).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
praveenkumar: @anjannath CI failure is not because of this PR.
openshift-ci[bot]: [APPROVALNOTIFIER] This PR is **APPROVED**

This pull-request has been approved by: *<a href="https://github.com/code-ready/crc/pull/3272#pullrequestreview-1057156908" title="Approved">anjannath</a>*

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=code-ready%2Fcrc).

The pull request process is described [here](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process)

<details >
Needs approval from an approver in each of these files:

- ~~[OWNERS](https://github.com/code-ready/crc/blob/main/OWNERS)~~ [anjannath]

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":[]} -->

Patch:
diff --git a/Makefile b/Makefile
index 36326beb8..20f87c20b 100644
--- a/Makefile
+++ b/Makefile
@@ -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)
@@ -11,11 +12,6 @@ CONTAINER_RUNTIME ?= podman
 TOOLS_DIR := tools
 include tools/tools.mk
 
-ifdef OKD_VERSION
-    OPENSHIFT_VERSION = $(OKD_VERSION)
-    CRC_VERSION := $(CRC_VERSION)-OKD
-endif
-
 # Go and compilation related variables
 BUILD_DIR ?= out
 SOURCE_DIRS = cmd pkg test
@@ -58,14 +54,11 @@ __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
 
-ifdef OKD_VERSION
-	VERSION_VARIABLES := $(VERSION_VARIABLES) -X $(REPOPATH)/pkg/crc/version.okdBuild=true
-endif
-
 # https://golang.org/cmd/link/
 LDFLAGS := $(VERSION_VARIABLES) ${GO_EXTRA_LDFLAGS}
 # Same build flags are used in the podman remote to cross build it https://github.com/containers/podman/blob/main/Makefile
diff --git a/cmd/crc/cmd/root.go b/cmd/crc/cmd/root.go
index 020e325a5..95177e4ce 100644
--- a/cmd/crc/cmd/root.go
+++ b/cmd/crc/cmd/root.go
@@ -79,7 +79,7 @@ func runPrerun(cmd *cobra.Command) error {
 	}
 	logging.InitLogrus(logFile)
 
-	for _, str := range defaultVersion().lines() {
+	for _, str := range defaultVersion(crcConfig.GetPreset(config)).lines() {
 		logging.Debugf(str)
 	}
 	return nil
diff --git a/cmd/crc/cmd/start.go b/cmd/crc/cmd/start.go
index 1e5fdc87a..2db253b48 100644
--- a/cmd/crc/cmd/start.go
+++ b/cmd/crc/cmd/start.go
@@ -7,7 +7,6 @@ import (
 	"io"
 	"os"
 	"runtime"
-	"strings"
 	"text/template"
 
 	"github.com/Masterminds/semver/v3"
@@ -156,18 +155,7 @@ func (s *startResult) prettyPrintTo(writer io.Writer) error {
 		return errors.New("either Error or ClusterConfig is needed")
 	}
 
-	if err := writeTemplatedMessage(writer, s); err != nil {
-		return err
-	}
-	if crcversion.IsOkdBuild() {
-		_, err := fmt.Fprintln(writer, strings.Join([]string{
-			"",
-			"NOTE:",
-			"This cluster was built from OKD - The Community Distribution of Kubernetes that powers Red Hat OpenShift.",
-			"If you find an issue, please report it at https://github.com/openshift/okd"}, "\n"))
-		return err
-	}
-	return nil
+	return writeTemplatedMessage(writer, s)
 }
 
 func validateStartFlags() error {
@@ -252,6 +240,10 @@ Use the 'oc' command line interface:
 Use the 'podman' command line interface:
   {{ .CommandLinePrefix }} {{ .EvalCommandLine }}
   {{ .CommandLinePrefix }} {{ .PodmanRemote }} COMMAND
+`
+	startTemplateForOKD = `NOTE:
+This cluster was built from OKD - The Community Distribution of Kubernetes that powers Red Hat OpenShift.
+If you find an issue, please report it at https://github.com/openshift/okd
 `
 )
 
@@ -263,7 +255,7 @@ type templateVariables struct {
 }
 
 func writeTemplatedMessage(writer io.Writer, s *startResult) error {
-	if s.ClusterConfig.ClusterType == preset.OpenShift {
+	if s.ClusterConfig.ClusterType == preset.OpenShift || s.ClusterConfig.ClusterType == preset.OKD {
 		return writeOpenShiftTemplatedMessage(writer, s)
 	}
 
@@ -271,7 +263,11 @@ func writeTemplatedMessage(writer io.Writer, s *startResult) error {
 }
 
 func writeOpenShiftTemplatedMessage(writer io.Writer, s *startResult) error {
-	parsed, err := template.New("template").Parse(startTemplateForOpenshift)
+	tmpl := startTemplateForOpenshift
+	if s.ClusterConfig.ClusterType == preset.OKD {
+		tmpl = fmt.Sprintf("%s\n\n%s", startTemplateForOpenshift, startTemplateForOKD)
+	}
+	parsed, err := template.New("template").Parse(tmpl)
 	if err != nil {
 		return err
 	}
diff --git a/cmd/crc/cmd/version.go b/cmd/crc/cmd/version.go
index fe22e5064..df504e352 100644
--- a/cmd/crc/cmd/version.go
+++ b/cmd/crc/cmd/version.go
@@ -7,6 +7,7 @@ import (
 
 	crcConfig "github.com/code-ready/crc/pkg/crc/config"
 	"github.com/code-ready/crc/pkg/crc/logging"
+	crcPreset "github.com/code-ready/crc/pkg/crc/preset"
 	crcversion "github.com/code-ready/crc/pkg/crc/version"
 	"github.com/spf13/cobra"
 )
@@ -21,7 +22,7 @@ var versionCmd = &cobra.Command{
 	Short: "Print version information",
 	Long:  "Print version information",
 	RunE: func(cmd *cobra.Command, args []string) error {
-		return runPrintVersion(os.Stdout, defaultVersion(), outputFormat)
+		return runPrintVersion(os.Stdout, defaultVersion(crcConfig.GetPreset(config)), outputFormat)
 	},
 }
 
@@ -39,11 +40,11 @@ type version struct {
 	PodmanVersion    string `json:"podmanVersion"`
 }
 
-func defaultVersion() *version {
+func defaultVersion(preset crcPreset.Preset) *version {
 	return &version{
 		Version:          crcversion.GetCRCVersion(),
 		Commit:           crcversion.GetCommitSha(),
-		OpenshiftVersion: crcversion.GetBundleVersion(),
+		OpenshiftVersion: crcversion.GetBundleVersion(preset),
 		PodmanVersion:    crcversion.GetPodmanVersion(),
 	}
 }
diff --git a/pkg/crc/api/handlers.go b/pkg/crc/api/handlers.go
index d356b5afa..c203c1e75 100644
--- a/pkg/crc/api/handlers.go
+++ b/pkg/crc/api/handlers.go
@@ -123,7 +123,7 @@ func (h *Handler) GetVersion(c *context) error {
 	return c.JSON(http.StatusOK, &client.VersionResult{
 		CrcVersion:       version.GetCRCVersion(),
 		CommitSha:        version.GetCommitSha(),
-		OpenshiftVersion: version.GetBundleVersion(),
+		OpenshiftVersion: version.GetBundleVersion(crcConfig.GetPreset(h.Config)),
 		PodmanVersion:    version.GetPodmanVersion(),
 	})
 }
diff --git a/pkg/crc/cluster/pullsecret.go b/pkg/crc/cluster/pullsecret.go
index 09ce6e840..53ca708be 100644
--- a/pkg/crc/cluster/pullsecret.go
+++ b/pkg/crc/cluster/pullsecret.go
@@ -15,7 +15,6 @@ import (
 	"github.com/code-ready/crc/pkg/crc/logging"
 	"github.com/code-ready/crc/pkg/crc/preset"
 	"github.com/code-ready/crc/pkg/crc/validation"
-	crcversion "github.com/code-ready/crc/pkg/crc/version"
 	crcos "github.com/code-ready/crc/pkg/os"
 
 	"github.com/AlecAivazis/survey/v2"
@@ -77,8 +76,8 @@ func NewNonInteractivePullSecretLoader(config crcConfig.Storage, path string) Pu
 }
 
 func (loader *nonInteractivePullSecretLoader) Value() (string, error) {
-	// If crc is built from an OKD bundle or podman bundle is used, then use the fake pull secret in contants.
-	if crcversion.IsOkdBuild() || crcConfig.GetPreset(loader.config) == preset.Podman {
+	// If crc is built from an OKD bundle or podman bundle is used, then use the fake pull secret in constants.
+	if crcConfig.GetPreset(loader.config) == preset.OKD || crcConfig.GetPreset(loader.config) == preset.Podman {
 		return constants.OkdPullSecret, nil
 	}
 
diff --git a/pkg/crc/config/settings.go b/pkg/crc/config/settings.go
index 77824a06b..b4c4a14a0 100644
--- a/pkg/crc/config/settings.go
+++ b/pkg/crc/config/settings.go
@@ -57,7 +57,7 @@ func RegisterSettings(cfg *Config) {
 	// Preset setting should be on top because CPUs/Memory config depend on it.
 	if runtime.GOOS != "darwin" || runtime.GOARCH != "arm64" {
 		cfg.AddSetting(Preset, string(preset.OpenShift), validatePreset, RequiresDeleteAndSetupMsg,
-			fmt.Sprintf("Virtual machine preset (alpha feature - valid values are: %s or %s)", preset.Podman, preset.OpenShift))
+			fmt.Sprintf("Virtual machine preset (alpha feature - valid values are: %s, %s and %s)", preset.Podman, preset.OpenShift, preset.OKD))
 	}
 	// Start command settings in config
 	cfg.AddSetting(Bundle, defaultBundlePath(cfg), validateBundlePath, SuccessfullyApplied,
diff --git a/pkg/crc/constants/constants.go b/pkg/crc/constants/constants.go
index 4e68b218c..9d2fc733f 100644
--- a/pkg/crc/constants/constants.go
+++ b/pkg/crc/constants/constants.go
@@ -92,9 +92,9 @@ func defaultBundleForOs(preset crcpreset.Preset) map[string]string {
 		}
 	}
 	return map[string]string{
-		"darwin":  fmt.Sprintf("crc_vfkit_%s_%s.crcbundle", version.GetBundleVersion(), runtime.GOARCH),
-		"linux":   fmt.Sprintf("crc_libvirt_%s_%s.crcbundle", version.GetBundleVersion(), runtime.GOARCH),
-		"windows": fmt.Sprintf("crc_hyperv_%s_%s.crcbundle", version.GetBundleVersion(), runtime.GOARCH),
+		"darwin":  fmt.Sprintf("crc_vfkit_%s_%s.crcbundle", version.GetBundleVersion(preset), runtime.GOARCH),
+		"linux":   fmt.Sprintf("crc_libvirt_%s_%s.crcbundle", version.GetBundleVersion(preset), runtime.GOARCH),
+		"windows": fmt.Sprintf("crc_hyperv_%s_%s.crcbundle", version.GetBundleVersion(preset), runtime.GOARCH),
 	}
 }
 
@@ -186,7 +186,7 @@ func GetCRCWindowsTrayDownloadURL() string {
 
 func GetDefaultCPUs(preset crcpreset.Preset) int {
 	switch preset {
-	case crcpreset.OpenShift:
+	case crcpreset.OpenShift, crcpreset.OKD:
 		return 4
 	case crcpreset.Podman:
 		return 2
@@ -198,7 +198,7 @@ func GetDefaultCPUs(preset crcpreset.Preset) int {
 
 func GetDefaultMemory(preset crcpreset.Preset) int {
 	switch preset {
-	case crcpreset.OpenShift:
+	case crcpreset.OpenShift, crcpreset.OKD:
 		return 9216
 	case crcpreset.Podman:
 		return 2048
diff --git a/pkg/crc/image/image.go b/pkg/crc/image/image.go
index 30c08e80f..a7cd971e1 100644
--- a/pkg/crc/image/image.go
+++ b/pkg/crc/image/image.go
@@ -85,13 +85,14 @@ func getLayerPath(m *v1.Manifest, index int, mediaType string) (string, error) {
 }
 
 func getImageName(preset crcpreset.Preset) string {
-	if preset == crcpreset.Podman {
+	switch preset {
+	case crcpreset.Podman:
 		return "podman-bundle"
-	}
-	if version.IsOkdBuild() {
+	case crcpreset.OKD:
 		return "okd-bundle"
+	default:
+		return "openshift-bundle"
 	}
-	return "openshift-bundle"
 }
 
 func PullBundle(preset crcpreset.Preset) error {
diff --git a/pkg/crc/machine/start.go b/pkg/crc/machine/start.go
index 5bf2cd520..07212b1cd 100644
--- a/pkg/crc/machine/start.go
+++ b/pkg/crc/machine/start.go
@@ -169,7 +169,7 @@ func (client *client) Start(ctx context.Context, startConfig types.StartConfig)
 		}
 
 		if crcBundleMetadata.IsOpenShift() {
-			logging.Infof("Creating CRC VM for OpenShift %s...", crcBundleMetadata.GetOpenshiftVersion())
+			logging.Infof("Creating CRC VM for %s %s...", startConfig.Preset, crcBundleMetadata.GetOpenshiftVersion())
 		} else {
 			logging.Infof("Creating CRC VM for Podman %s...", crcBundleMetadata.GetPodmanVersion())
 		}
@@ -242,7 +242,7 @@ func (client *client) Start(ctx context.Context, startConfig types.StartConfig)
 	}
 
 	if vm.bundle.IsOpenShift() {
-		logging.Infof("Starting CRC VM for OpenShift %s...", vm.bundle.GetOpenshiftVersion())
+		logging.Infof("Starting CRC VM for %s %s...", startConfig.Preset, vm.bundle.GetOpenshiftVersion())
 	}
 
 	if client.useVSock() {
@@ -401,7 +401,7 @@ func (client *client) Start(ctx context.Context, startConfig types.StartConfig)
 		return nil, errors.Wrap(err, "Failed to check certificate validity")
 	}
 
-	logging.Info("Starting OpenShift kubelet service")
+	logging.Info("Starting kubelet service")
 	sd := systemd.NewInstanceSystemdCommander(sshRunner)
 	if err := sd.Start("kubelet"); err != nil {
 		return nil, errors.Wrap(err, "Error starting kubelet")
@@ -486,7 +486,7 @@ func (client *client) Start(ctx context.Context, startConfig types.StartConfig)
 		return nil, errors.Wrap(err, "Failed to update kubeconfig file")
 	}
 
-	logging.Info("Starting OpenShift cluster... [waiting for the cluster to stabilize]")
+	logging.Infof("Starting %s instance... [waiting for the cluster to stabilize]", startConfig.Preset)
 	if err := cluster.WaitForClusterStable(ctx, instanceIP, constants.KubeconfigFilePath, proxyConfig); err != nil {
 		logging.Errorf("Cluster is not ready: %v", err)
 	}
@@ -793,7 +793,7 @@ func updateKubeconfig(ctx context.Context, ocConfig oc.Config, sshRunner *crcssh
 }
 
 func bundleMismatchWithPreset(preset crcPreset.Preset, bundleMetadata *bundle.CrcBundleInfo) error {
-	if preset != crcPreset.OpenShift && bundleMetadata.IsOpenShift() {
+	if preset == crcPreset.Podman && bundleMetadata.IsOpenShift() {
 		return errors.Errorf("Preset %s is used but bundle is provided for %s preset", crcPreset.Podman, crcPreset.OpenShift)
 	}
 	if preset != crcPreset.Podman && !bundleMetadata.IsOpenShift() {
diff --git a/pkg/crc/machine/vsock.go b/pkg/crc/machine/vsock.go
index 9d2e4a9f0..d87688106 100644
--- a/pkg/crc/machine/vsock.go
+++ b/pkg/crc/machine/vsock.go
@@ -93,7 +93,7 @@ func vsockPorts(preset crcPreset.Preset) []types.ExposeRequest {
 		},
 	}
 	switch preset {
-	case crcPreset.OpenShift:
+	case crcPreset.OpenShift, crcPreset.OKD:
 		exposeRequest = append(exposeRequest,
 			types.ExposeRequest{
 				Protocol: "tcp",
diff --git a/pkg/crc/preflight/preflight_checks_common.go b/pkg/crc/preflight/preflight_checks_common.go
index 9fc3370e7..939233f84 100644
--- a/pkg/crc/preflight/preflight_checks_common.go
+++ b/pkg/crc/preflight/preflight_checks_common.go
@@ -13,7 +13,6 @@ import (
 	"github.com/code-ready/crc/pkg/crc/machine/bundle"
 	crcpreset "github.com/code-ready/crc/pkg/crc/preset"
 	"github.com/code-ready/crc/pkg/crc/validation"
-	"github.com/code-ready/crc/pkg/crc/version"
 	"github.com/pkg/errors"
 )
 
@@ -102,7 +101,7 @@ func fixBundleExtracted(bundlePath string, preset crcpreset.Preset) func() error
 			logging.Infof("Downloading %s", constants.GetDefaultBundle(preset))
 			// In case of OKD or podman bundle then pull the bundle image from quay
 			// otherwise use mirror location to download the bundle.
-			if version.IsOkdBuild() || preset == crcpreset.Podman {
+			if preset == crcpreset.OKD || preset == crcpreset.Podman {
 				if err := image.PullBundle(preset); err != nil {
 					return err
 				}
diff --git a/pkg/crc/preset/preset.go b/pkg/crc/preset/preset.go
index 0d5126646..99567838a 100644
--- a/pkg/crc/preset/preset.go
+++ b/pkg/crc/preset/preset.go
@@ -11,6 +11,7 @@ type Preset string
 const (
 	Podman    Preset = "podman"
 	OpenShift Preset = "openshift"
+	OKD       Preset = "okd"
 )
 
 func (preset Preset) String() string {
@@ -19,6 +20,8 @@ func (preset Preset) String() string {
 		return string(Podman)
 	case OpenShift:
 		return string(OpenShift)
+	case OKD:
+		return string(OKD)
 	}
 	return "invalid"
 }
@@ -29,6 +32,8 @@ func ParsePresetE(input string) (Preset, error) {
 		return Podman, nil
 	case OpenShift.String():
 		return OpenShift, nil
+	case OKD.String():
+		return OKD, nil
 	default:
 		return OpenShift, fmt.Errorf("Cannot parse preset '%s'", input)
 	}
diff --git a/pkg/crc/version/version.go b/pkg/crc/version/version.go
index 8a3690562..9afb7c19a 100644
--- a/pkg/crc/version/version.go
+++ b/pkg/crc/version/version.go
@@ -11,6 +11,7 @@ import (
 
 	"github.com/Masterminds/semver/v3"
 	"github.com/code-ready/crc/pkg/crc/logging"
+	crcPreset "github.com/code-ready/crc/pkg/crc/preset"
 )
 
 // The following variables are private fields and should be set when compiling with ldflags, for example --ldflags="-X github.com/code-ready/crc/pkg/version.crcVersion=vX.Y.Z
@@ -27,8 +28,7 @@ var (
 	// Podman version for podman specific bundles
 	podmanVersion = "0.0.0-unset"
 
-	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
@@ -66,8 +66,11 @@ func GetCommitSha() string {
 	return commitSha
 }
 
-func GetBundleVersion() string {
-	return bundleVersion
+func GetBundleVersion(preset crcPreset.Preset) string {
+	if preset == crcPreset.OpenShift {
+		return bundleVersion
+	}
+	return okdVersion
 }
 
 func GetPodmanVersion() string {
@@ -78,10 +81,6 @@ func GetAdminHelperVersion() string {
 	return crcAdminHelperVersion
 }
 
-func IsOkdBuild() bool {
-	return okdBuild == "true"
-}
-
 func GetTrayVersion() string {
 	return crcTrayElectronVersion
 }


Test patch:
diff --git a/pkg/crc/api/api_client_test.go b/pkg/crc/api/api_client_test.go
index 696d8da0e..178de733c 100644
--- a/pkg/crc/api/api_client_test.go
+++ b/pkg/crc/api/api_client_test.go
@@ -50,7 +50,7 @@ func TestVersion(t *testing.T) {
 		t,
 		apiClient.VersionResult{
 			CrcVersion:       version.GetCRCVersion(),
-			OpenshiftVersion: version.GetBundleVersion(),
+			OpenshiftVersion: version.GetBundleVersion(preset.OpenShift),
 			CommitSha:        version.GetCommitSha(),
 			PodmanVersion:    version.GetPodmanVersion(),
 		},
diff --git a/pkg/crc/api/api_http_test.go b/pkg/crc/api/api_http_test.go
index a3637981d..bbd3869ee 100644
--- a/pkg/crc/api/api_http_test.go
+++ b/pkg/crc/api/api_http_test.go
@@ -14,6 +14,7 @@ import (
 	crcConfig "github.com/code-ready/crc/pkg/crc/config"
 	"github.com/code-ready/crc/pkg/crc/constants"
 	"github.com/code-ready/crc/pkg/crc/machine/fakemachine"
+	"github.com/code-ready/crc/pkg/crc/preset"
 	"github.com/code-ready/crc/pkg/crc/version"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
@@ -265,7 +266,7 @@ var testCases = []testCase{
 	// version
 	{
 		request:  get("version"),
-		response: jSon(fmt.Sprintf(`{"CrcVersion":"%s","CommitSha":"%s","OpenshiftVersion":"%s","PodmanVersion":"%s"}`, version.GetCRCVersion(), version.GetCommitSha(), version.GetBundleVersion(), version.GetPodmanVersion())),
+		response: jSon(fmt.Sprintf(`{"CrcVersion":"%s","CommitSha":"%s","OpenshiftVersion":"%s","PodmanVersion":"%s"}`, version.GetCRCVersion(), version.GetCommitSha(), version.GetBundleVersion(preset.OpenShift), version.GetPodmanVersion())),
 	},
 
 	// version never fails