Skip to content

Commit

Permalink
config: Rename PresetConfigurationKey to Preset
Browse files Browse the repository at this point in the history
This is consistent with the naming used for all other configuration
keys.
  • Loading branch information
cfergeau authored and praveenkumar committed Nov 22, 2021
1 parent 7707f55 commit c82161e
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cmd/crc/cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func runStart(ctx context.Context) (*types.StartResult, error) {
NameServer: config.Get(crcConfig.NameServer).AsString(),
PullSecret: cluster.NewInteractivePullSecretLoader(config),
KubeAdminPassword: config.Get(crcConfig.KubeAdminPassword).AsString(),
Preset: config.Get(crcConfig.PresetConfigurationKey).AsString(),
Preset: config.Get(crcConfig.Preset).AsString(),
}

client := newMachine()
Expand Down
2 changes: 1 addition & 1 deletion pkg/crc/api/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func getStartConfig(cfg crcConfig.Storage, args client.StartConfig) types.StartC
NameServer: cfg.Get(crcConfig.NameServer).AsString(),
PullSecret: cluster.NewNonInteractivePullSecretLoader(cfg, args.PullSecretFile),
KubeAdminPassword: cfg.Get(crcConfig.KubeAdminPassword).AsString(),
Preset: cfg.Get(crcConfig.PresetConfigurationKey).AsString(),
Preset: cfg.Get(crcConfig.Preset).AsString(),
}
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/crc/cluster/pullsecret.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func NewNonInteractivePullSecretLoader(config crcConfig.Storage, path string) Pu
func (loader *nonInteractivePullSecretLoader) Value() (string, error) {
// If crc is built from an OKD bundle or podman bundle is used, then use the fake pull secret in contants.
if crcversion.IsOkdBuild() ||
loader.config.Get(crcConfig.PresetConfigurationKey).AsString() == string(preset.Podman) {
loader.config.Get(crcConfig.Preset).AsString() == string(preset.Podman) {
return constants.OkdPullSecret, nil
}

Expand Down
6 changes: 3 additions & 3 deletions pkg/crc/config/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const (
EnableClusterMonitoring = "enable-cluster-monitoring"
AutostartTray = "autostart-tray"
KubeAdminPassword = "kubeadmin-password"
PresetConfigurationKey = "preset"
Preset = "preset"
)

func RegisterSettings(cfg *Config) {
Expand Down Expand Up @@ -73,7 +73,7 @@ func RegisterSettings(cfg *Config) {
}

// Preset setting should be on top because CPUs/Memory config depend on it.
cfg.AddSetting(PresetConfigurationKey, string(preset.OpenShift), validatePreset, RequiresDeleteMsg,
cfg.AddSetting(Preset, string(preset.OpenShift), validatePreset, RequiresDeleteMsg,
fmt.Sprintf("Virtal machine preset (alpha feature - valid values are: %s or %s)", preset.Podman, preset.OpenShift))
// Start command settings in config
cfg.AddSetting(Bundle, constants.DefaultBundlePath, ValidateBundlePath, SuccessfullyApplied,
Expand Down Expand Up @@ -133,7 +133,7 @@ func DefaultMem(cfg Storage) int {
}

func IsOpenShift(cfg Storage) bool {
return cfg.Get(PresetConfigurationKey).AsString() == string(preset.OpenShift)
return cfg.Get(Preset).AsString() == string(preset.OpenShift)
}

func defaultNetworkMode() network.Mode {
Expand Down
4 changes: 2 additions & 2 deletions pkg/crc/preflight/preflight.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ func StartPreflightChecks(config crcConfig.Storage) error {
mode := crcConfig.GetNetworkMode(config)
trayAutostart := config.Get(crcConfig.AutostartTray).AsBool()
bundlePath := config.Get(crcConfig.Bundle).AsString()
preset = config.Get(crcConfig.PresetConfigurationKey).AsString()
preset = config.Get(crcConfig.Preset).AsString()
if err := doPreflightChecks(config, getPreflightChecks(experimentalFeatures, trayAutostart, mode, bundlePath, preset)); err != nil {
return &errors.PreflightError{Err: err}
}
Expand All @@ -174,7 +174,7 @@ func SetupHost(config crcConfig.Storage, checkOnly bool) error {
mode := crcConfig.GetNetworkMode(config)
trayAutostart := config.Get(crcConfig.AutostartTray).AsBool()
bundlePath := config.Get(crcConfig.Bundle).AsString()
preset = config.Get(crcConfig.PresetConfigurationKey).AsString()
preset = config.Get(crcConfig.Preset).AsString()
logging.Infof("Using bundle path %s", bundlePath)
return doFixPreflightChecks(config, getPreflightChecks(experimentalFeatures, trayAutostart, mode, bundlePath, preset), checkOnly)
}
Expand Down

0 comments on commit c82161e

Please sign in to comment.