Skip to content

Commit e0966a1

Browse files
committed
Start: Fix message if user start an already running instance
With this PR now if user start and running microshift instance then it shows correct message. ``` $ ./crc status CRC VM: Running RAM Usage: 1.473GB of 3.913GB Disk Usage: 6GB of 16.1GB (Inside the CRC VM) Cache Usage: 208.9GB Cache Directory: /home/prkumar/.crc/cache $ ./crc start INFO Loading bundle: crc_microshift_libvirt_4.12.9_amd64... INFO A CRC VM for MicroShift 4.12.9 is already running Started the MicroShift cluster. export KUBECONFIG="/home/prkumar/.crc/machines/crc/kubeconfig" Use the 'oc' command line interface: $ eval $(crc oc-env) $ oc COMMAND ``` Without this PR it was showing podman preset message template. ``` $ ./crc start INFO Loading bundle: crc_microshift_libvirt_4.12.9_amd64... INFO A CRC VM for Podman is already running podman runtime is now running. Use the 'podman' command line interface: $ eval $(crc podman-env) $ podman-remote COMMAND ```
1 parent da29c08 commit e0966a1

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pkg/crc/machine/start.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -295,13 +295,12 @@ func (client *client) Start(ctx context.Context, startConfig types.StartConfig)
295295
return nil, errors.Wrap(err, "Error getting the machine state")
296296
}
297297
if vmState == state.Running {
298-
if !vm.bundle.IsOpenShift() {
299-
logging.Infof("A CRC VM for Podman %s is already running", vm.bundle.GetPodmanVersion())
298+
logging.Infof("A CRC VM for %s %s is already running", startConfig.Preset.ForDisplay(), vm.bundle.GetVersion())
299+
if vm.bundle.IsPodman() {
300300
return &types.StartResult{
301301
Status: vmState,
302302
}, nil
303303
}
304-
logging.Infof("A CRC VM for OpenShift %s is already running", vm.bundle.GetOpenshiftVersion())
305304
clusterConfig, err := getClusterConfig(vm.bundle)
306305
if err != nil {
307306
return nil, errors.Wrap(err, "Cannot create cluster configuration")

0 commit comments

Comments
 (0)