Skip to content

Commit 5c207ac

Browse files
praveenkumaranjannath
authored andcommitted
Fix logic for bundle mismatch function
Bundle created from snc have type as `snc (single node cluster)` for okd/ocp. Current detection around `bundleMetadata.IsOpenShift()` always true for okd and ocp (which is buggy because following scenario fails and it should be capture as part of preset mismatch logic) ``` crc config set preset okd crc start --bundle crc_libvirt_4.10.14.crcbundle Since it is ocp bundle so pullsecret should be asked but as part of okd preset it is ignored and hence a failed cluster. ``` We do need to figure out best way to detect if bundle is OCP/OKD and print out the mismatch here. May be add another field in bundle-info data (snc side) as preset and put ocp/okd/podman according to bundle generation. As of now it is half backed solution (buggy one) but good as long as user manually download bundle and use it with different preset.
1 parent 50315e6 commit 5c207ac

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/crc/machine/start.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,7 @@ func updateKubeconfig(ctx context.Context, ocConfig oc.Config, sshRunner *crcssh
793793
}
794794

795795
func bundleMismatchWithPreset(preset crcPreset.Preset, bundleMetadata *bundle.CrcBundleInfo) error {
796-
if preset != crcPreset.OpenShift && bundleMetadata.IsOpenShift() {
796+
if preset == crcPreset.Podman && bundleMetadata.IsOpenShift() {
797797
return errors.Errorf("Preset %s is used but bundle is provided for %s preset", crcPreset.Podman, crcPreset.OpenShift)
798798
}
799799
if preset != crcPreset.Podman && !bundleMetadata.IsOpenShift() {

0 commit comments

Comments
 (0)