Skip to content

Commit

Permalink
Fix logic for bundle mismatch function
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
praveenkumar authored and anjannath committed Aug 1, 2022
1 parent 50315e6 commit 5c207ac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/crc/machine/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 5c207ac

Please sign in to comment.