Skip to content

Commit

Permalink
Fix log message
Browse files Browse the repository at this point in the history
  • Loading branch information
thegridman committed Nov 13, 2023
1 parent 504937c commit f690bc8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/rest/rest.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ func (s server) getRackLabelForNode(w http.ResponseWriter, r *http.Request) {
func (s server) getLabelForNode(labels, prefixLabels []string, w http.ResponseWriter, r *http.Request) {
var value string
labelUsed := "<None>"
prefixUsed := "<None>"
var prefixUsed = "<None>"

path := r.URL.Path
// strip off any trailing slash
Expand All @@ -233,7 +233,7 @@ func (s server) getLabelForNode(labels, prefixLabels []string, w http.ResponseWr
prefixValue := ""
for _, label := range prefixLabels {
if prefix, ok := node.Labels[label]; ok && prefix != "" {
prefixUsed = label
labelUsed = label
prefixValue = prefix + "-"
break
}
Expand Down Expand Up @@ -264,7 +264,7 @@ func (s server) getLabelForNode(labels, prefixLabels []string, w http.ResponseWr
if _, err = fmt.Fprint(w, value); err != nil {
log.Error(err, "Error writing value response for node "+name)
} else {
log.Info("GET query for node labels", "node", name, "label", labelUsed, "value", value, "remoteAddress", r.RemoteAddr)
log.Info("GET query for node labels", "node", name, "label", labelUsed, "prefix", prefixUsed, "value", value, "remoteAddress", r.RemoteAddr)
}
}

Expand Down

0 comments on commit f690bc8

Please sign in to comment.