Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change the app handling path register. #14432

Merged
merged 6 commits into from
Jun 14, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 2 additions & 4 deletions pilot/cmd/pilot-agent/status/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const (
readyPath = "/healthz/ready"
// KubeAppProberEnvName is the name of the command line flag for pilot agent to pass app prober config.
// The json encoded string to pass app HTTP probe information from injector(istioctl or webhook).
// For example, --ISTIO_KUBE_APP_PROBERS='{"/app-health/httpbin/livez":{"path": "/hello", "port": 8080}.
// For example, ISTIO_KUBE_APP_PROBERS='{"/app-health/httpbin/livez":{"path": "/hello", "port": 8080}.
// indicates that httpbin container liveness prober port is 8080 and probing path is /hello.
// This environment variable should never be set manually.
KubeAppProberEnvName = "ISTIO_KUBE_APP_PROBERS"
Expand Down Expand Up @@ -123,9 +123,7 @@ func (s *Server) Run(ctx context.Context) {

// Add the handler for ready probes.
mux.HandleFunc(readyPath, s.handleReadyProbe)
mux.HandleFunc("/", s.handleAppProbe)

mux.HandleFunc("/app-health", s.handleAppProbe)
mux.HandleFunc("/app-health/", s.handleAppProbe)

l, err := net.Listen("tcp", fmt.Sprintf(":%d", s.statusPort))
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions pilot/cmd/pilot-agent/status/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ func TestAppProbe(t *testing.T) {
statusCode int
}{
{
probePath: fmt.Sprintf(":%v/bad-path-should-be-disallowed", statusPort),
statusCode: http.StatusBadRequest,
probePath: fmt.Sprintf(":%v/bad-path-should-be-404", statusPort),
statusCode: http.StatusNotFound,
},
{
probePath: fmt.Sprintf(":%v/app-health/hello-world/readyz", statusPort),
Expand Down