From 77c72e702b56c206b9a1cd4e48e3ec9cbe890357 Mon Sep 17 00:00:00 2001 From: Praveen Kumar Date: Tue, 2 Jan 2024 11:31:03 +0530 Subject: [PATCH] network_darwin: Remove dead code This PR removes dead code which also contain `exec.Command` step. --- pkg/drivers/vfkit/network_darwin.go | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/pkg/drivers/vfkit/network_darwin.go b/pkg/drivers/vfkit/network_darwin.go index fe65ba2d55..3cd94c3b18 100644 --- a/pkg/drivers/vfkit/network_darwin.go +++ b/pkg/drivers/vfkit/network_darwin.go @@ -20,9 +20,7 @@ import ( "bufio" "fmt" "io" - "net" "os" - "os/exec" "regexp" "strings" @@ -125,20 +123,3 @@ func parseDHCPdLeasesFile(file io.Reader) ([]DHCPEntry, error) { func trimMACAddress(macAddress string) string { return leadingZeroRegexp.ReplaceAllString(macAddress, "$1") } - -// GetNetAddr gets the network address for vmnet -func GetNetAddr() (net.IP, error) { - plistPath := VMNetDomain + ".plist" - if _, err := os.Stat(plistPath); err != nil { - return nil, fmt.Errorf("stat: %v", err) - } - out, err := exec.Command("defaults", "read", VMNetDomain, SharedNetAddrKey).Output() - if err != nil { - return nil, err - } - ip := net.ParseIP(strings.TrimSpace(string(out))) - if ip == nil { - return nil, fmt.Errorf("could not get the network address for vmnet") - } - return ip, nil -}