Skip to content

Commit

Permalink
Fix envoy proxy log levels in pilot agent (istio#9186)
Browse files Browse the repository at this point in the history
Signed-off-by: Joshua Benjamin <joshuabnjmn@gmail.com>
  • Loading branch information
annymsMthd authored and istio-testing committed Oct 11, 2018
1 parent b76a5a8 commit 8cbda56
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
4 changes: 2 additions & 2 deletions pilot/cmd/pilot-agent/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -351,9 +351,9 @@ func init() {
proxyCmd.PersistentFlags().StringVar(&customConfigFile, "customConfigFile", values.CustomConfigFile,
"Path to the custom configuration file")
// Log levels are provided by the library https://github.com/gabime/spdlog, used by Envoy.
proxyCmd.PersistentFlags().StringVar(&proxyLogLevel, "proxyLogLevel", "warn",
proxyCmd.PersistentFlags().StringVar(&proxyLogLevel, "proxyLogLevel", "warning",
fmt.Sprintf("The log level used to start the Envoy proxy (choose from {%s, %s, %s, %s, %s, %s, %s})",
"trace", "debug", "info", "warn", "err", "critical", "off"))
"trace", "debug", "info", "warning", "error", "critical", "off"))
proxyCmd.PersistentFlags().IntVar(&concurrency, "concurrency", int(values.Concurrency),
"number of worker threads to run")
proxyCmd.PersistentFlags().StringVar(&templateFile, "templateFile", "",
Expand Down
28 changes: 24 additions & 4 deletions tests/e2e/tests/dashboard/dashboard_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"errors"
"flag"
"fmt"
"net/http"
"os"
"strings"
"testing"
Expand Down Expand Up @@ -500,15 +501,34 @@ func waitForMixerProxyReadiness() error {
time.Sleep(duration)

for _, pod := range mixerPods {
logs, err := util.ShellMuteOutput(fmt.Sprintf("kubectl logs %s -n %s -c istio-proxy", pod, tc.Kube.Namespace))
options := &kube.PodSelectOptions{
PodNamespace: tc.Kube.Namespace,
PodName: pod,
}

forwarder, err := kube.NewPortForwarder(tc.Kube.KubeConfig, options, 16000, 15000)
if err != nil {
log.Infof("Failure retrieving logs for pod %s (container: istio-proxy): %v", pod, err)
log.Infof("Error creating port forwarder: %v", err)
continue
}
if err := forwarder.Start(); err != nil {
log.Infof("Error starting port forwarder: %v", err)
continue
}
if strings.Contains(logs, "starting main dispatch loop") {
log.Infof("Envoy started main dispatch loop.")

resp, err := http.Get("http://localhost:16000/server_info")
forwarder.Close()

if err != nil {
log.Infof("Failure retrieving status for pod %s (container: istio-proxy): %v", pod, err)
continue
}

if resp.StatusCode == 200 {
return nil
}

log.Infof("Failure retrieving status for pod %s (container: istio-proxy) status code should be 200 got: %d", pod, resp.StatusCode)
}
}
return errors.New("proxy for mixer never started main dispatch loop")
Expand Down

0 comments on commit 8cbda56

Please sign in to comment.