mirror of
				https://github.com/k3s-io/kubernetes.git
				synced 2025-10-31 05:40:42 +00:00 
			
		
		
		
	Move deps from _workspace/ to vendor/
godep restore pushd $GOPATH/src/github.com/appc/spec git co master popd go get go4.org/errorutil rm -rf Godeps godep save ./... git add vendor git add -f $(git ls-files --other vendor/) git co -- Godeps/LICENSES Godeps/.license_file_state Godeps/OWNERS
This commit is contained in:
		
							
								
								
									
										29
									
								
								vendor/github.com/mesos/mesos-go/mesosutil/node.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								vendor/github.com/mesos/mesos-go/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 New Issue
	
	Block a user