Skip to content

Commit

Permalink
why 404?
Browse files Browse the repository at this point in the history
  • Loading branch information
akyyy committed May 8, 2018
1 parent da609ad commit 8861351
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions elaconfig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ data:
autoscale.concurrency-quantum-of-time: "100ms"

# Scale to zero feature flag
autoscale.enable-scale-to-zero: "false"
autoscale.enable-scale-to-zero: "true"

# Dynamic parameters (take effect when config map is updated):

# Scale to zero threshold is the time a revision must be idle before
# it is scaled to zero.
autoscale.scale-to-zero-threshold: "5m"
autoscale.scale-to-zero-threshold: "1m"


# LOGGING CONFIGURATION
Expand Down
4 changes: 2 additions & 2 deletions pkg/activator/activator.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ func (a *Activator) getRevisionTargetURL(revision *v1alpha1.Revision) (*url.URL,
}
return nil, err
}
svc, err = services.Get(controller.GetElaK8SServiceNameForRevision(revision), metav1.GetOptions{})
// TODO: in the future, the target service could have more than one ports.
// https://github.com/elafros/elafros/issues/837
if len(svc.Spec.Ports) != 1 {
return nil, fmt.Errorf("need just one port. Found %v ports", len(svc.Spec.Ports))
}
Expand All @@ -114,7 +115,6 @@ func (a *Activator) getRevisionTargetURL(revision *v1alpha1.Revision) (*url.URL,
}

func (a *Activator) proxyRequest(revRequest RevisionRequest, serviceURL *url.URL) {
glog.Infof("Sending the request to %q", serviceURL)
// TODO: We need to wait a bit after the revision is marked ready.
// See https://github.com/elafros/elafros/issues/660: Mark a revision ready at the right time.
time.Sleep(2 * time.Second)
Expand Down
5 changes: 4 additions & 1 deletion sample/helloworld/helloworld.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ import (
)

func handler(w http.ResponseWriter, r *http.Request) {
log.Print("Hello world received a request.")
log.Println("Hello world received a request.")
log.Printf("request\n%+v", r)
log.Printf("request.Host\n%+v", r.Host)
log.Printf("request.URL.Host\n%+v", r.URL.Host)
target := os.Getenv("TARGET")
if target == "" {
target = "NOT SPECIFIED"
Expand Down

0 comments on commit 8861351

Please sign in to comment.