Skip to content

Commit

Permalink
corrected string handling for node info
Browse files Browse the repository at this point in the history
  • Loading branch information
phenixblue committed Mar 24, 2019
1 parent a79a051 commit 77794cb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cmd/pods.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,13 @@ where the pods are scheduled.`,

if string(node) != "" {

kv := strings.Split(string(node), " ")
kv := strings.Fields(string(node))

k, v := kv[0], kv[1]

// Print k,v for debug
//fmt.Println(k, v)

nodeinfo[k] = v
nodeazs[v] = struct{}{}

Expand Down Expand Up @@ -127,7 +130,7 @@ func buildPods(nodeinfo map[string]string, nodeazs map[string]struct{}, k8sNames
podMap[p.name] = p

// Print pod info for debug
//fmt.Printf("Pod: %s\n", podMap[p.name])
fmt.Printf("Pod: %s\n", podMap[p.name])
}

}
Expand Down

0 comments on commit 77794cb

Please sign in to comment.