Adding dep files and dependencies.
This commit is contained in:
parent
45f9efa578
commit
b341c0a0e4
539 changed files with 313111 additions and 0 deletions
29
vendor/github.com/mesos/mesos-go/api/v0/mesosutil/node.go
generated
vendored
Normal file
29
vendor/github.com/mesos/mesos-go/api/v0/mesosutil/node.go
generated
vendored
Normal file
|
@ -0,0 +1,29 @@
|
|||
package mesosutil
|
||||
|
||||
import (
|
||||
"os"
|
||||
"os/exec"
|
||||
"strings"
|
||||
|
||||
log "github.com/golang/glog"
|
||||
)
|
||||
|
||||
//TODO(jdef) copied from kubernetes/pkg/util/node.go
|
||||
func GetHostname(hostnameOverride string) string {
|
||||
hostname := hostnameOverride
|
||||
if hostname == "" {
|
||||
// Note: We use exec here instead of os.Hostname() because we
|
||||
// want the FQDN, and this is the easiest way to get it.
|
||||
fqdn, err := exec.Command("hostname", "-f").Output()
|
||||
if err != nil || len(fqdn) == 0 {
|
||||
log.Errorf("Couldn't determine hostname fqdn, failing back to hostname: %v", err)
|
||||
hostname, err = os.Hostname()
|
||||
if err != nil {
|
||||
log.Fatalf("Error getting hostname: %v", err)
|
||||
}
|
||||
} else {
|
||||
hostname = string(fqdn)
|
||||
}
|
||||
}
|
||||
return strings.TrimSpace(hostname)
|
||||
}
|
Reference in a new issue