mirror of
https://github.com/bloomberg/goldpinger.git
synced 2026-08-23 21:36:25 +00:00
Add --display-nodename option to control UI display
Add GoldpingerConfig.DisplayNodeName to control UI display, default is `false`, which means to display podName Signed-off-by: wanglijie6 <wanglijie6@xiaomi.com>
This commit is contained in:
@@ -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:" "`
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user