Skip to content

Commit

Permalink
Fetch IP only for running instances (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ranjandas authored Aug 12, 2024
1 parent b7f8a36 commit 3bda077
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/lima/lima.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,10 @@ func (vm LimaVM) GetVMDir() string {

func (vm LimaVM) GetIPAddress() string {

if vm.Status != "Running" {
return ""
}

command := "ip -j addr show dev lima0"
cmd := exec.Command("/bin/sh", "-c", fmt.Sprintf("limactl shell %s %s", vm.Name, command))

Expand Down

0 comments on commit 3bda077

Please sign in to comment.