From e59245118e39d730ff6a95ef987b9ce1eea0c104 Mon Sep 17 00:00:00 2001 From: vyasgun Date: Mon, 10 Jun 2024 00:54:01 +0530 Subject: [PATCH] Release ports on `crc stop` `crc start` opens and uses ports which do not need to remain exposed after the machine has been stopped. This commit will ensure that the ports are unexposed on `crc stop` --- pkg/crc/machine/stop.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/crc/machine/stop.go b/pkg/crc/machine/stop.go index d6db66151b..e355563a2f 100644 --- a/pkg/crc/machine/stop.go +++ b/pkg/crc/machine/stop.go @@ -38,6 +38,10 @@ func (client *client) Stop() (state.State, error) { if err != nil { return state.Error, errors.Wrap(err, "Cannot get VM status") } + // In case usermode networking make sure all the port bind on host should be released + if client.useVSock() { + return status, unexposePorts() + } return status, nil }