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:
wanglijie6
2022-04-13 10:54:59 +08:00
parent 588c1a0173
commit 7609a3ab3f
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -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:" "`
+1 -1
View File
@@ -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
}