예제 #1
0
파일: gce.go 프로젝트: CodeJuan/kubernetes
func getGceInstanceID() info.InstanceID {
	instanceID, err := metadata.Get("instance/id")
	if err != nil {
		return info.UnknownInstance
	}
	return info.InstanceID(info.InstanceType(instanceID))
}
예제 #2
0
파일: azure.go 프로젝트: jbeda/kubernetes
func getAzureInstanceID() info.InstanceID {
	data, err := ioutil.ReadFile(BiosUUIDFileName)
	if err != nil {
		return info.UnNamedInstance
	}
	return info.InstanceID(strings.TrimSuffix(string(data), "\n"))
}
예제 #3
0
파일: aws.go 프로젝트: Clarifai/kubernetes
func getAwsInstanceID() info.InstanceID {
	return info.InstanceID(getAwsMetadata("instance-id"))
}