Commit 95be540b authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #47242 from k82cn/make_golint_happy

Automatic merge from submit-queue Updated comments for functions.
parents 9a4a0cb3 3953f901
...@@ -41,8 +41,9 @@ const ( ...@@ -41,8 +41,9 @@ const (
NodeUnreachablePodMessage = "Node %v which was running pod %v is unresponsive" 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 { func GetHostname(hostnameOverride string) string {
var hostname string = hostnameOverride hostname := hostnameOverride
if hostname == "" { if hostname == "" {
nodename, err := os.Hostname() nodename, err := os.Hostname()
if err != nil { if err != nil {
...@@ -109,8 +110,8 @@ func InternalGetNodeHostIP(node *api.Node) (net.IP, error) { ...@@ -109,8 +110,8 @@ func InternalGetNodeHostIP(node *api.Node) (net.IP, error) {
return nil, fmt.Errorf("host IP unknown; known addresses: %v", addresses) return nil, fmt.Errorf("host IP unknown; known addresses: %v", addresses)
} }
// Helper function that builds a string identifier that is unique per failure-zone // GetZoneKey is a helper function that builds a string identifier that is unique per failure-zone;
// Returns empty-string for no zone // it returns empty-string for no zone.
func GetZoneKey(node *v1.Node) string { func GetZoneKey(node *v1.Node) string {
labels := node.Labels labels := node.Labels
if labels == nil { if labels == nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment