Skip to content

Commit

Permalink
Release ports on crc stop
Browse files Browse the repository at this point in the history
`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`
  • Loading branch information
vyasgun authored and praveenkumar committed Jun 18, 2024
1 parent a2b3cd9 commit e592451
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/crc/machine/stop.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit e592451

Please sign in to comment.