Skip to content

Commit

Permalink
CrcBundleInfo's IsOpenShift() now considers OKD to also be OpenShift
Browse files Browse the repository at this point in the history
There are numerous places in the CRC code base that calls IsOpenShift()
to run logic that is not intended for Podman setups or other more
limited setups. Using the "okd" preset gives you something that is
very close to the "openshift" preset.

CrcBundleInfo's IsOpenShift() now treats the "okd" preset as if it was
OpenShift. This means we can avoid littering the code with checks for
both OpenShift and OKD in a bunch of places, which also reduces the risk
of forgetting to check for OKD.

Fixes #3635
  • Loading branch information
Marcus Bergner authored and openshift-merge-robot committed May 15, 2023
1 parent 9292564 commit 524bc82
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/crc/machine/bundle/metadata.go
Expand Up @@ -199,7 +199,8 @@ func (bundle *CrcBundleInfo) GetBundleType() crcPreset.Preset {
}

func (bundle *CrcBundleInfo) IsOpenShift() bool {
return bundle.GetBundleType() == crcPreset.OpenShift
preset := bundle.GetBundleType()
return preset == crcPreset.OpenShift || preset == crcPreset.OKD
}

func (bundle *CrcBundleInfo) IsMicroshift() bool {
Expand Down

0 comments on commit 524bc82

Please sign in to comment.