Updated comments for functions.

This commit is contained in:
Klaus Ma 2017-06-09 16:41:24 +08:00
parent 0f132e8406
commit 3953f90102

View File

@ -41,8 +41,9 @@ const (
NodeUnreachablePodMessage = "Node %v which was running pod %v is unresponsive"
)
// GetHostname returns OS's hostname if 'hostnameOverride' is empty; otherwise, return 'hostnameOverride'.
func GetHostname(hostnameOverride string) string {
var hostname string = hostnameOverride
hostname := hostnameOverride
if hostname == "" {
nodename, err := os.Hostname()
if err != nil {
@ -109,8 +110,8 @@ func InternalGetNodeHostIP(node *api.Node) (net.IP, error) {
return nil, fmt.Errorf("host IP unknown; known addresses: %v", addresses)
}
// Helper function that builds a string identifier that is unique per failure-zone
// Returns empty-string for no zone
// GetZoneKey is a helper function that builds a string identifier that is unique per failure-zone;
// it returns empty-string for no zone.
func GetZoneKey(node *v1.Node) string {
labels := node.Labels
if labels == nil {