From f346e5628b12a503100f58af35cd2d7fb8093235 Mon Sep 17 00:00:00 2001 From: Thomas Stromberg Date: Tue, 12 Feb 2019 13:57:02 -0800 Subject: [PATCH 01/10] Add logging around the DHCP discovery process --- pkg/drivers/hyperkit/network.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/drivers/hyperkit/network.go b/pkg/drivers/hyperkit/network.go index 61ff3b07a1ca..8c453ec0577c 100644 --- a/pkg/drivers/hyperkit/network.go +++ b/pkg/drivers/hyperkit/network.go @@ -25,6 +25,8 @@ import ( "os/exec" "regexp" "strings" + + "github.com/docker/machine/libmachine/log" ) const ( @@ -46,6 +48,7 @@ func GetIPAddressByMACAddress(mac string) (string, error) { } func getIpAddressFromFile(mac, path string) (string, error) { + log.Infof("Searching for %s in %s ...", mac, path) file, err := os.Open(path) if err != nil { return "", err @@ -56,8 +59,11 @@ func getIpAddressFromFile(mac, path string) (string, error) { if err != nil { return "", err } + log.Infof("Found %d entries in %s!", len(dhcpEntries), path) for _, dhcpEntry := range dhcpEntries { + log.Infof("dhcp entry: %+v", dhcpEntry) if dhcpEntry.HWAddress == mac { + log.Infof("Found match: %s", mac) return dhcpEntry.IPAddress, nil } } From 888978c3a9aafc0325de03305b6f30a333a2d651 Mon Sep 17 00:00:00 2001 From: Thomas Stromberg Date: Tue, 12 Feb 2019 13:58:18 -0800 Subject: [PATCH 02/10] Improve VM re-use reliability: detect crashing and/or badly installed hyperkit --- pkg/drivers/hyperkit/driver.go | 56 ++++++++++++++++++++++++++++------ 1 file changed, 47 insertions(+), 9 deletions(-) diff --git a/pkg/drivers/hyperkit/driver.go b/pkg/drivers/hyperkit/driver.go index 6314f7094c28..fe4d2cc9bc5a 100644 --- a/pkg/drivers/hyperkit/driver.go +++ b/pkg/drivers/hyperkit/driver.go @@ -79,19 +79,28 @@ func NewDriver(hostName, storePath string) *Driver { // PreCreateCheck is called to enforce pre-creation steps func (d *Driver) PreCreateCheck() error { + return d.verifyRootPermissions() +} + +// verifyRootPermissions is called before any step which needs root access +func (d *Driver) verifyRootPermissions() error { exe, err := os.Executable() if err != nil { return err } - - if syscall.Geteuid() != 0 { + euid := syscall.Geteuid() + log.Infof("exe=%s uid=%d", exe, euid) + if euid != 0 { return fmt.Errorf(permErr, filepath.Base(exe), exe, exe) } - return nil } func (d *Driver) Create() error { + if err := d.verifyRootPermissions(); err != nil { + return err + } + // TODO: handle different disk types. if err := pkgdrivers.MakeDiskImage(d.BaseDriver, d.Boot2DockerURL, d.DiskSize); err != nil { return errors.Wrap(err, "making disk image") @@ -127,20 +136,27 @@ func (d *Driver) GetURL() (string, error) { // GetState returns the state that the host is in (running, stopped, etc) func (d *Driver) GetState() (state.State, error) { + if err := d.verifyRootPermissions(); err != nil { + return state.Error, err + } + pid := d.getPid() + log.Infof("hyperkit pid from json: %d", pid) if pid == 0 { return state.Stopped, nil } - p, err := os.FindProcess(pid) + + p, err := ps.FindProcess(pid) if err != nil { + log.Errorf("findprocess %d failed: %v", pid, err) return state.Error, err } - - // Sending a signal of 0 can be used to check the existence of a process. - if err := p.Signal(syscall.Signal(0)); err != nil { + if p == nil { + log.Infof("hyperkit pid not running: %v", err) return state.Stopped, nil } - if p == nil { + if !strings.Contains(p.Executable(), "hyperkit") { + log.Infof("pid %d is stale -- executable is %s, not hyperkit", pid, p.Executable()) return state.Stopped, nil } return state.Running, nil @@ -148,11 +164,18 @@ func (d *Driver) GetState() (state.State, error) { // Kill stops a host forcefully func (d *Driver) Kill() error { + if err := d.verifyRootPermissions(); err != nil { + return err + } return d.sendSignal(syscall.SIGKILL) } // Remove a host func (d *Driver) Remove() error { + if err := d.verifyRootPermissions(); err != nil { + return err + } + s, err := d.GetState() if err != nil || s == state.Error { log.Infof("Error checking machine status: %v, assuming it has been removed already", err) @@ -171,6 +194,10 @@ func (d *Driver) Restart() error { // Start a host func (d *Driver) Start() error { + if err := d.verifyRootPermissions(); err != nil { + return err + } + stateDir := filepath.Join(d.StorePath, "machines", d.MachineName) if err := d.recoverFromUncleanShutdown(); err != nil { return err @@ -219,7 +246,14 @@ func (d *Driver) Start() error { } getIP := func() error { - var err error + st, err := d.GetState() + if err != nil { + return errors.Wrap(err, "get state") + } + if st == state.Error || st == state.Stopped { + return fmt.Errorf("hyperkit crashed! command line:\n hyperkit %s", d.Cmdline) + } + d.IPAddress, err = GetIPAddressByMACAddress(mac) if err != nil { return &commonutil.RetriableError{Err: err} @@ -230,6 +264,7 @@ func (d *Driver) Start() error { if err := commonutil.RetryAfter(30, getIP, 2*time.Second); err != nil { return fmt.Errorf("IP address never found in dhcp leases file %v", err) } + log.Infof("IP: %s", d.IPAddress) if len(d.NFSShares) > 0 { log.Info("Setting up NFS mounts") @@ -298,6 +333,9 @@ func (d *Driver) recoverFromUncleanShutdown() error { // Stop a host gracefully func (d *Driver) Stop() error { + if err := d.verifyRootPermissions(); err != nil { + return err + } d.cleanupNfsExports() return d.sendSignal(syscall.SIGTERM) } From 2045dc9ba419592d4cd70676b13ecb7573ee1c68 Mon Sep 17 00:00:00 2001 From: Thomas Stromberg Date: Wed, 13 Feb 2019 13:35:08 -0800 Subject: [PATCH 03/10] Lint cleanup --- pkg/drivers/hyperkit/network.go | 19 +++++++++---------- pkg/drivers/hyperkit/network_test.go | 6 +++--- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/pkg/drivers/hyperkit/network.go b/pkg/drivers/hyperkit/network.go index 8c453ec0577c..b801d50ebfb4 100644 --- a/pkg/drivers/hyperkit/network.go +++ b/pkg/drivers/hyperkit/network.go @@ -30,9 +30,9 @@ import ( ) const ( - DHCPLeasesFile = "/var/db/dhcpd_leases" - CONFIG_PLIST = "/Library/Preferences/SystemConfiguration/com.apple.vmnet" - NET_ADDR_KEY = "Shared_Net_Address" + LeasesPath = "/var/db/dhcpd_leases" + VMNetDomain = "/Library/Preferences/SystemConfiguration/com.apple.vmnet" + SharedNetAddrKey = "Shared_Net_Address" ) type DHCPEntry struct { @@ -44,10 +44,10 @@ type DHCPEntry struct { } func GetIPAddressByMACAddress(mac string) (string, error) { - return getIpAddressFromFile(mac, DHCPLeasesFile) + return getIPAddressFromFile(mac, LeasesPath) } -func getIpAddressFromFile(mac, path string) (string, error) { +func getIPAddressFromFile(mac, path string) (string, error) { log.Infof("Searching for %s in %s ...", mac, path) file, err := os.Open(path) if err != nil { @@ -120,12 +120,11 @@ func trimMacAddress(rawUUID string) string { } func GetNetAddr() (net.IP, error) { - _, err := os.Stat(CONFIG_PLIST + ".plist") - if err != nil { - return nil, fmt.Errorf("Does not exist %s", CONFIG_PLIST+".plist") + plistPath := VMNetDomain + ".plist" + if _, err := os.Stat(plistPath); err != nil { + return nil, fmt.Errorf("stat: %v", err) } - - out, err := exec.Command("defaults", "read", CONFIG_PLIST, NET_ADDR_KEY).Output() + out, err := exec.Command("defaults", "read", VMNetDomain, SharedNetAddrKey).Output() if err != nil { return nil, err } diff --git a/pkg/drivers/hyperkit/network_test.go b/pkg/drivers/hyperkit/network_test.go index d8b831b82398..45f72ec18379 100644 --- a/pkg/drivers/hyperkit/network_test.go +++ b/pkg/drivers/hyperkit/network_test.go @@ -88,13 +88,13 @@ func Test_getIpAddressFromFile(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - got, err := getIpAddressFromFile(tt.args.mac, tt.args.path) + got, err := getIPAddressFromFile(tt.args.mac, tt.args.path) if (err != nil) != tt.wantErr { - t.Errorf("getIpAddressFromFile() error = %v, wantErr %v", err, tt.wantErr) + t.Errorf("getIPAddressFromFile() error = %v, wantErr %v", err, tt.wantErr) return } if got != tt.want { - t.Errorf("getIpAddressFromFile() = %v, want %v", got, tt.want) + t.Errorf("getIPAddressFromFile() = %v, want %v", got, tt.want) } }) } From 4b875ddd7f5f9577fd9baa38586072ea3ff75bca Mon Sep 17 00:00:00 2001 From: Thomas Stromberg Date: Wed, 13 Feb 2019 13:35:28 -0800 Subject: [PATCH 04/10] Run goimports --- pkg/drivers/hyperkit/iso.go | 1 - 1 file changed, 1 deletion(-) diff --git a/pkg/drivers/hyperkit/iso.go b/pkg/drivers/hyperkit/iso.go index 9139073db7b1..14503e1b2f6d 100644 --- a/pkg/drivers/hyperkit/iso.go +++ b/pkg/drivers/hyperkit/iso.go @@ -21,7 +21,6 @@ import ( "io" "io/ioutil" "os" - "strings" "github.com/hooklift/iso9660" From 473f5983cb8b7e61a15290fc12bbbf87432708fe Mon Sep 17 00:00:00 2001 From: Thomas Stromberg Date: Wed, 13 Feb 2019 13:36:45 -0800 Subject: [PATCH 05/10] Allow driver name to be com.docker.hyper, as seen in integration testing --- pkg/drivers/hyperkit/driver.go | 68 +++++++++++++++++----------------- 1 file changed, 33 insertions(+), 35 deletions(-) diff --git a/pkg/drivers/hyperkit/driver.go b/pkg/drivers/hyperkit/driver.go index fe4d2cc9bc5a..2da6910fd2d8 100644 --- a/pkg/drivers/hyperkit/driver.go +++ b/pkg/drivers/hyperkit/driver.go @@ -134,34 +134,38 @@ func (d *Driver) GetURL() (string, error) { return fmt.Sprintf("tcp://%s:2376", ip), nil } -// GetState returns the state that the host is in (running, stopped, etc) -func (d *Driver) GetState() (state.State, error) { - if err := d.verifyRootPermissions(); err != nil { - return state.Error, err - } - - pid := d.getPid() - log.Infof("hyperkit pid from json: %d", pid) +// Return the state of the hyperkit pid +func pidState(pid int) (state.State, error) { if pid == 0 { return state.Stopped, nil } - p, err := ps.FindProcess(pid) if err != nil { - log.Errorf("findprocess %d failed: %v", pid, err) return state.Error, err } if p == nil { - log.Infof("hyperkit pid not running: %v", err) + log.Infof("hyperkit pid missing from process table, err=%v", err) return state.Stopped, nil } - if !strings.Contains(p.Executable(), "hyperkit") { - log.Infof("pid %d is stale -- executable is %s, not hyperkit", pid, p.Executable()) + // hyperkit or com.docker.hyper + if !strings.Contains(p.Executable(), "hyper") { + log.Infof("pid %d is stale, and is being used by %s", pid, p.Executable()) return state.Stopped, nil } return state.Running, nil } +// GetState returns the state that the host is in (running, stopped, etc) +func (d *Driver) GetState() (state.State, error) { + if err := d.verifyRootPermissions(); err != nil { + return state.Error, err + } + + pid := d.getPid() + log.Infof("hyperkit pid from json: %d", pid) + return pidState(pid) +} + // Kill stops a host forcefully func (d *Driver) Kill() error { if err := d.verifyRootPermissions(); err != nil { @@ -292,42 +296,38 @@ func (d *Driver) recoverFromUncleanShutdown() error { stateDir := filepath.Join(d.StorePath, "machines", d.MachineName) pidFile := filepath.Join(stateDir, pidFileName) - _, err := os.Stat(pidFile) - - if os.IsNotExist(err) { - log.Infof("clean start, hyperkit pid file doesn't exist: %s", pidFile) - return nil - } - - if err != nil { - return errors.Wrap(err, "checking hyperkit pid file existence") + if _, err := os.Stat(pidFile); err != nil { + if os.IsNotExist(err) { + log.Infof("clean start, hyperkit pid file doesn't exist: %s", pidFile) + return nil + } + return errors.Wrap(err, "stat") } log.Warnf("minikube might have been shutdown in an unclean way, the hyperkit pid file still exists: %s", pidFile) - - content, err := ioutil.ReadFile(pidFile) + bs, err := ioutil.ReadFile(pidFile) if err != nil { return errors.Wrapf(err, "reading pidfile %s", pidFile) } - pid, err := strconv.Atoi(string(content)) + content := strings.TrimSpace(string(bs)) + pid, err := strconv.Atoi(content) if err != nil { return errors.Wrapf(err, "parsing pidfile %s", pidFile) } - p, err := ps.FindProcess(pid) + st, err := pidState(pid) if err != nil { - return errors.Wrapf(err, "trying to find process for PID %d", pid) + return errors.Wrap(err, "pidState") } - if p != nil && !strings.Contains(p.Executable(), "hyperkit") { - return fmt.Errorf("something is not right...please stop all minikube instances, seemingly a hyperkit server is already running with pid %d, executable: %s", pid, p.Executable()) + log.Infof("pid %d is in state %q", pid, st) + if st == state.Running { + return nil } - - log.Infof("No running hyperkit process found with PID %d, removing %s...", pid, pidFile) + log.Infof("Removing stale pid file %s...", pidFile) if err := os.Remove(pidFile); err != nil { return errors.Wrap(err, fmt.Sprintf("removing pidFile %s", pidFile)) } - return nil } @@ -372,9 +372,7 @@ func (d *Driver) extractVSockPorts() ([]int, error) { for _, port := range d.VSockPorts { p, err := strconv.Atoi(port) if err != nil { - var err InvalidPortNumberError - err = InvalidPortNumberError(port) - return nil, err + return nil, InvalidPortNumberError(port) } vsockPorts = append(vsockPorts, p) } From 5c1a72f428daddda30550e7d75aa575aaa60635e Mon Sep 17 00:00:00 2001 From: Thomas Stromberg Date: Thu, 14 Feb 2019 10:14:41 -0800 Subject: [PATCH 06/10] Switch Infof statements to Debugf/Warningf, as they go to stderr --- pkg/drivers/hyperkit/driver.go | 24 ++++++++++++------------ pkg/drivers/hyperkit/network.go | 8 ++++---- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/pkg/drivers/hyperkit/driver.go b/pkg/drivers/hyperkit/driver.go index 2da6910fd2d8..24b45778be58 100644 --- a/pkg/drivers/hyperkit/driver.go +++ b/pkg/drivers/hyperkit/driver.go @@ -89,7 +89,7 @@ func (d *Driver) verifyRootPermissions() error { return err } euid := syscall.Geteuid() - log.Infof("exe=%s uid=%d", exe, euid) + log.Debugf("exe=%s uid=%d", exe, euid) if euid != 0 { return fmt.Errorf(permErr, filepath.Base(exe), exe, exe) } @@ -144,12 +144,12 @@ func pidState(pid int) (state.State, error) { return state.Error, err } if p == nil { - log.Infof("hyperkit pid missing from process table, err=%v", err) + log.Warnf("hyperkit pid missing from process table, err=%v", err) return state.Stopped, nil } // hyperkit or com.docker.hyper if !strings.Contains(p.Executable(), "hyper") { - log.Infof("pid %d is stale, and is being used by %s", pid, p.Executable()) + log.Warnf("pid %d is stale, and is being used by %s", pid, p.Executable()) return state.Stopped, nil } return state.Running, nil @@ -162,7 +162,7 @@ func (d *Driver) GetState() (state.State, error) { } pid := d.getPid() - log.Infof("hyperkit pid from json: %d", pid) + log.Debugf("hyperkit pid from json: %d", pid) return pidState(pid) } @@ -182,7 +182,7 @@ func (d *Driver) Remove() error { s, err := d.GetState() if err != nil || s == state.Error { - log.Infof("Error checking machine status: %v, assuming it has been removed already", err) + log.Debugf("Error checking machine status: %v, assuming it has been removed already", err) } if s == state.Running { if err := d.Stop(); err != nil { @@ -228,7 +228,7 @@ func (d *Driver) Start() error { h.VSockPorts = vsockPorts } - log.Infof("Using UUID %s", h.UUID) + log.Debugf("Using UUID %s", h.UUID) mac, err := GetMACAddressFromUUID(h.UUID) if err != nil { return errors.Wrap(err, "getting MAC address from UUID") @@ -236,7 +236,7 @@ func (d *Driver) Start() error { // Need to strip 0's mac = trimMacAddress(mac) - log.Infof("Generated MAC %s", mac) + log.Debugf("Generated MAC %s", mac) h.Disks = []hyperkit.DiskConfig{ { Path: pkgdrivers.GetDiskPath(d.BaseDriver), @@ -244,7 +244,7 @@ func (d *Driver) Start() error { Driver: "virtio-blk", }, } - log.Infof("Starting with cmdline: %s", d.Cmdline) + log.Debugf("Starting with cmdline: %s", d.Cmdline) if err := h.Start(d.Cmdline); err != nil { return errors.Wrapf(err, "starting with cmd line: %s", d.Cmdline) } @@ -268,7 +268,7 @@ func (d *Driver) Start() error { if err := commonutil.RetryAfter(30, getIP, 2*time.Second); err != nil { return fmt.Errorf("IP address never found in dhcp leases file %v", err) } - log.Infof("IP: %s", d.IPAddress) + log.Debugf("IP: %s", d.IPAddress) if len(d.NFSShares) > 0 { log.Info("Setting up NFS mounts") @@ -298,7 +298,7 @@ func (d *Driver) recoverFromUncleanShutdown() error { if _, err := os.Stat(pidFile); err != nil { if os.IsNotExist(err) { - log.Infof("clean start, hyperkit pid file doesn't exist: %s", pidFile) + log.Debugf("clean start, hyperkit pid file doesn't exist: %s", pidFile) return nil } return errors.Wrap(err, "stat") @@ -320,11 +320,11 @@ func (d *Driver) recoverFromUncleanShutdown() error { return errors.Wrap(err, "pidState") } - log.Infof("pid %d is in state %q", pid, st) + log.Debugf("pid %d is in state %q", pid, st) if st == state.Running { return nil } - log.Infof("Removing stale pid file %s...", pidFile) + log.Debugf("Removing stale pid file %s...", pidFile) if err := os.Remove(pidFile); err != nil { return errors.Wrap(err, fmt.Sprintf("removing pidFile %s", pidFile)) } diff --git a/pkg/drivers/hyperkit/network.go b/pkg/drivers/hyperkit/network.go index b801d50ebfb4..07c49e44501f 100644 --- a/pkg/drivers/hyperkit/network.go +++ b/pkg/drivers/hyperkit/network.go @@ -48,7 +48,7 @@ func GetIPAddressByMACAddress(mac string) (string, error) { } func getIPAddressFromFile(mac, path string) (string, error) { - log.Infof("Searching for %s in %s ...", mac, path) + log.Debugf("Searching for %s in %s ...", mac, path) file, err := os.Open(path) if err != nil { return "", err @@ -59,11 +59,11 @@ func getIPAddressFromFile(mac, path string) (string, error) { if err != nil { return "", err } - log.Infof("Found %d entries in %s!", len(dhcpEntries), path) + log.Debugf("Found %d entries in %s!", len(dhcpEntries), path) for _, dhcpEntry := range dhcpEntries { - log.Infof("dhcp entry: %+v", dhcpEntry) + log.Debugf("dhcp entry: %+v", dhcpEntry) if dhcpEntry.HWAddress == mac { - log.Infof("Found match: %s", mac) + log.Debugf("Found match: %s", mac) return dhcpEntry.IPAddress, nil } } From 0c8a452e977d21c5216b4debbfc4d7790291c188 Mon Sep 17 00:00:00 2001 From: Thomas Stromberg Date: Thu, 14 Feb 2019 14:40:16 -0800 Subject: [PATCH 07/10] lowercase error messages --- pkg/drivers/hyperkit/network.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/drivers/hyperkit/network.go b/pkg/drivers/hyperkit/network.go index 07c49e44501f..a699e071ab62 100644 --- a/pkg/drivers/hyperkit/network.go +++ b/pkg/drivers/hyperkit/network.go @@ -67,7 +67,7 @@ func getIPAddressFromFile(mac, path string) (string, error) { return dhcpEntry.IPAddress, nil } } - return "", fmt.Errorf("Could not find an IP address for %s", mac) + return "", fmt.Errorf("could not find an IP address for %s", mac) } func parseDHCPdLeasesFile(file io.Reader) ([]DHCPEntry, error) { @@ -105,7 +105,7 @@ func parseDHCPdLeasesFile(file io.Reader) ([]DHCPEntry, error) { case "lease": dhcpEntry.Lease = val default: - return dhcpEntries, fmt.Errorf("Unable to parse line: %s", line) + return dhcpEntries, fmt.Errorf("unable to parse line: %s", line) } } return dhcpEntries, scanner.Err() @@ -130,7 +130,7 @@ func GetNetAddr() (net.IP, error) { } ip := net.ParseIP(strings.TrimSpace(string(out))) if ip == nil { - return nil, fmt.Errorf("Could not get the network address for vmnet") + return nil, fmt.Errorf("could not get the network address for vmnet") } return ip, nil } From 531e6b0f726da2db061394eaaa21e99439f4078b Mon Sep 17 00:00:00 2001 From: Thomas Stromberg Date: Thu, 14 Feb 2019 14:40:32 -0800 Subject: [PATCH 08/10] Use h.SetLogger --- pkg/drivers/hyperkit/driver.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/drivers/hyperkit/driver.go b/pkg/drivers/hyperkit/driver.go index 24b45778be58..c07fd7a9b35c 100644 --- a/pkg/drivers/hyperkit/driver.go +++ b/pkg/drivers/hyperkit/driver.go @@ -22,6 +22,7 @@ import ( "encoding/json" "fmt" "io/ioutil" + golog "log" "os" "os/user" "path" @@ -220,6 +221,9 @@ func (d *Driver) Start() error { h.CPUs = d.CPU h.Memory = d.Memory h.UUID = d.UUID + // This should stream logs from hyperkit, but doesn't seem to work. + logger := glog.New(os.Stderr, "hyperkit", golog.LstdFlags) + h.SetLogger(logger) if vsockPorts, err := d.extractVSockPorts(); err != nil { return err From 7dd7e5417dfb75b8a6e469cf297809795e0b0bd6 Mon Sep 17 00:00:00 2001 From: Thomas Stromberg Date: Thu, 14 Feb 2019 14:43:22 -0800 Subject: [PATCH 09/10] glog, not golog --- pkg/drivers/hyperkit/driver.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/drivers/hyperkit/driver.go b/pkg/drivers/hyperkit/driver.go index c07fd7a9b35c..f345a4534a98 100644 --- a/pkg/drivers/hyperkit/driver.go +++ b/pkg/drivers/hyperkit/driver.go @@ -222,7 +222,7 @@ func (d *Driver) Start() error { h.Memory = d.Memory h.UUID = d.UUID // This should stream logs from hyperkit, but doesn't seem to work. - logger := glog.New(os.Stderr, "hyperkit", golog.LstdFlags) + logger := golog.New(os.Stderr, "hyperkit", golog.LstdFlags) h.SetLogger(logger) if vsockPorts, err := d.extractVSockPorts(); err != nil { From 07fc64fbe169ea4e13bd4730ef66769e93494c1e Mon Sep 17 00:00:00 2001 From: Thomas Stromberg Date: Thu, 14 Feb 2019 20:12:34 -0800 Subject: [PATCH 10/10] Warnf -> Debugf so that it doesn't interfere with output --- pkg/drivers/hyperkit/driver.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/drivers/hyperkit/driver.go b/pkg/drivers/hyperkit/driver.go index f345a4534a98..450620cfaa20 100644 --- a/pkg/drivers/hyperkit/driver.go +++ b/pkg/drivers/hyperkit/driver.go @@ -145,12 +145,12 @@ func pidState(pid int) (state.State, error) { return state.Error, err } if p == nil { - log.Warnf("hyperkit pid missing from process table, err=%v", err) + log.Debugf("hyperkit pid %d missing from process table", pid) return state.Stopped, nil } // hyperkit or com.docker.hyper if !strings.Contains(p.Executable(), "hyper") { - log.Warnf("pid %d is stale, and is being used by %s", pid, p.Executable()) + log.Debugf("pid %d is stale, and is being used by %s", pid, p.Executable()) return state.Stopped, nil } return state.Running, nil