Skip to content

Commit b14fb9d

Browse files
cfergeauanjannath
authored andcommitted
config: Force use of podman preset on M1 CPUs
Since we cannot have a m1 OpenShift bundles, there's no point in allowing to select one.
1 parent 7429468 commit b14fb9d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Diff for: pkg/crc/config/settings.go

+8-2
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,10 @@ func RegisterSettings(cfg *Config) {
5555
}
5656

5757
// Preset setting should be on top because CPUs/Memory config depend on it.
58-
cfg.AddSetting(Preset, string(preset.OpenShift), validatePreset, RequiresDeleteAndSetupMsg,
59-
fmt.Sprintf("Virtual machine preset (alpha feature - valid values are: %s or %s)", preset.Podman, preset.OpenShift))
58+
if runtime.GOOS != "darwin" || runtime.GOARCH != "arm64" {
59+
cfg.AddSetting(Preset, string(preset.OpenShift), validatePreset, RequiresDeleteAndSetupMsg,
60+
fmt.Sprintf("Virtual machine preset (alpha feature - valid values are: %s or %s)", preset.Podman, preset.OpenShift))
61+
}
6062
// Start command settings in config
6163
cfg.AddSetting(Bundle, defaultBundlePath(cfg), validateBundlePath, SuccessfullyApplied,
6264
fmt.Sprintf("Bundle path (string, default '%s')", defaultBundlePath(cfg)))
@@ -116,6 +118,10 @@ func defaultBundlePath(cfg Storage) string {
116118
}
117119

118120
func GetPreset(config Storage) preset.Preset {
121+
if runtime.GOOS == "darwin" && runtime.GOARCH == "arm64" {
122+
return preset.Podman
123+
}
124+
119125
return preset.ParsePreset(config.Get(Preset).AsString())
120126
}
121127

0 commit comments

Comments
 (0)