Skip to content

Commit

Permalink
Add --display-nodename option to control UI display
Browse files Browse the repository at this point in the history
Add GoldpingerConfig.DisplayNodeName to control UI display, default is
`false`, which means to display podName

Signed-off-by: wanglijie6 <wanglijie6@xiaomi.com>
  • Loading branch information
wanglijie6 committed Apr 13, 2022
1 parent 588c1a0 commit 7609a3a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions pkg/goldpinger/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ var GoldpingerConfig = struct {
UseHostIP bool `long:"use-host-ip" description:"When making the calls, use host ip (defaults to pod ip)" env:"USE_HOST_IP"`
LabelSelector string `long:"label-selector" description:"label selector to use to discover goldpinger pods in the cluster" env:"LABEL_SELECTOR" default:"app=goldpinger"`
Namespace *string `long:"namespace" description:"namespace to use to discover goldpinger pods in the cluster (empty for all). Defaults to discovering the namespace for the current pod" env:"NAMESPACE"`
DisplayNodeName bool `long:"display-nodename" description:"Display nodename other than podname in UI (defaults is podname)." env:"DISPLAY_NODENAME"`
KubernetesClient *kubernetes.Clientset

DnsHosts []string `long:"host-to-resolve" description:"A host to attempt dns resolve on (space delimited)" env:"HOSTS_TO_RESOLVE" env-delim:" "`
Expand Down
2 changes: 1 addition & 1 deletion pkg/goldpinger/k8s.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func getPodIP(p v1.Pod) string {
}

func getPodNodeName(p v1.Pod) string {
if p.Spec.NodeName != "" {
if GoldpingerConfig.DisplayNodeName {
return p.Spec.NodeName
}

Expand Down

0 comments on commit 7609a3a

Please sign in to comment.