Skip to content

Commit

Permalink
Constants: Add the okd bundle specification for getting default bundle
Browse files Browse the repository at this point in the history
Since the okd bundle now contain `crc_okd_<hypervisor>` naming, this
pr accomodates it.
  • Loading branch information
praveenkumar committed Aug 5, 2022
1 parent 609f5c9 commit 2686dd6
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions pkg/crc/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,25 @@ func GetAdminHelperURL() string {
}

func defaultBundleForOs(preset crcpreset.Preset) map[string]string {
if preset == crcpreset.Podman {
switch preset {
case crcpreset.Podman:
return map[string]string{
"darwin": fmt.Sprintf("crc_podman_vfkit_%s_%s.crcbundle", version.GetPodmanVersion(), runtime.GOARCH),
"linux": fmt.Sprintf("crc_podman_libvirt_%s_%s.crcbundle", version.GetPodmanVersion(), runtime.GOARCH),
"windows": fmt.Sprintf("crc_podman_hyperv_%s_%s.crcbundle", version.GetPodmanVersion(), runtime.GOARCH),
}
}
return map[string]string{
"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),
case crcpreset.OKD:
return map[string]string{
"darwin": fmt.Sprintf("crc_okd_vfkit_%s_%s.crcbundle", version.GetBundleVersion(preset), runtime.GOARCH),
"linux": fmt.Sprintf("crc_okd_libvirt_%s_%s.crcbundle", version.GetBundleVersion(preset), runtime.GOARCH),
"windows": fmt.Sprintf("crc_okd_hyperv_%s_%s.crcbundle", version.GetBundleVersion(preset), runtime.GOARCH),
}
default:
return map[string]string{
"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),
}
}
}

Expand Down

0 comments on commit 2686dd6

Please sign in to comment.