Merge branch 'master' into 15-remove-sudo-from-makefile

This commit is contained in:
Mikolaj Pawlikowski
2018-12-20 21:06:21 +01:00
committed by GitHub
2 changed files with 3 additions and 2 deletions
+1
View File
@@ -26,5 +26,6 @@ var GoldpingerConfig = struct {
Hostname string `long:"hostname" description:"Hostname to use" env:"HOSTNAME"`
Port int `long:"client-port-override" description:"(for testing) use this port when calling other instances" env:"CLIENT_PORT_OVERRIDE"`
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"`
KubernetesClient *kubernetes.Clientset
}{}
+2 -2
View File
@@ -30,10 +30,10 @@ func getNamespace() string {
return namespace
}
// GetAllPods returns a map of Pod IP to Host IP based on a label selector defined in config
func GetAllPods() map[string]string {
timer := GetLabeledKubernetesCallsTimer()
namespace := getNamespace()
pods, err := GoldpingerConfig.KubernetesClient.CoreV1().Pods(namespace).List(metav1.ListOptions{LabelSelector: "app=goldpinger"})
pods, err := GoldpingerConfig.KubernetesClient.CoreV1().Pods(getNamespace()).List(metav1.ListOptions{LabelSelector: GoldpingerConfig.LabelSelector})
if err != nil {
log.Println("Error getting pods for selector: ", err.Error())
CountError("kubernetes_api")