Skip to content
This repository has been archived by the owner on Feb 24, 2020. It is now read-only.

Commit

Permalink
Merge pull request #3059 from euank/machined-error-output
Browse files Browse the repository at this point in the history
api_service: Improve machined call error output
  • Loading branch information
lucab committed Aug 12, 2016
2 parents b228b3d + cd9e59d commit b57d834
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions rkt/api_service.go
Expand Up @@ -16,7 +16,6 @@ package main

import (
"encoding/json"
"errors"
"fmt"
"net"
"os"
Expand Down Expand Up @@ -479,15 +478,16 @@ func waitForMachinedRegistration(uuid string) error {
machined := conn.Object("org.freedesktop.machine1", "/org/freedesktop/machine1")
machineName := "rkt-" + uuid

var machinedErr error
var o dbus.ObjectPath
for i := 0; i < 10; i++ {
if err := machined.Call("org.freedesktop.machine1.Manager.GetMachine", 0, machineName).Store(&o); err == nil {
if machinedErr = machined.Call("org.freedesktop.machine1.Manager.GetMachine", 0, machineName).Store(&o); machinedErr == nil {
return nil
}
time.Sleep(time.Millisecond * 50)
}

return errors.New("pod not found")
return fmt.Errorf("pod %v not found in machined: %v", uuid, machinedErr)
}

// fillPodDetails fills the v1pod's dynamic info in place, e.g. the pod's state,
Expand Down Expand Up @@ -555,7 +555,7 @@ func fillPodDetails(store *imagestore.Store, p *pod, v1pod *v1alpha.Pod) {
if err := waitForMachinedRegistration(v1pod.Id); err != nil {
// If there's an error, it means we're not registered to machined
// in a reasonable time. Just output the cgroup we're in.
stderr.PrintE("checking for machined registration failed", err)
stderr.PrintE("checking for machined registration failed: ", err)
}
// Get cgroup for the "name=systemd" controller.
pid, err := p.getContainerPID1()
Expand Down

0 comments on commit b57d834

Please sign in to comment.