@@ -27,7 +27,7 @@ const MaxReplicas = 5
2727
2828// MaxFunctions licensed for OpenFaaS CE is 15
2929// a license for OpenFaaS Standard is required to increase this limit.
30- const MaxFunctions = 10
30+ const MaxFunctions = 15
3131
3232// MakeReplicaReader reads the amount of replicas for a deployment
3333func MakeReplicaReader (defaultNamespace string , lister v1.DeploymentLister ) http.HandlerFunc {
@@ -54,8 +54,9 @@ func MakeReplicaReader(defaultNamespace string, lister v1.DeploymentLister) http
5454
5555 function , err := getService (lookupNamespace , functionName , lister )
5656 if err != nil {
57- log .Printf ("Unable to fetch service: %s %s \n " , functionName , namespace )
57+ log .Printf ("Unable to fetch service: %s" , functionName )
5858 w .WriteHeader (http .StatusInternalServerError )
59+ http .Error (w , fmt .Sprintf ("Unable to fetch service: %s" , functionName ), http .StatusInternalServerError )
5960 return
6061 }
6162
@@ -65,13 +66,12 @@ func MakeReplicaReader(defaultNamespace string, lister v1.DeploymentLister) http
6566 }
6667
6768 d := time .Since (s )
68- log .Printf ("Replicas: %s.%s, (%d/%d) %dms\n " , functionName , lookupNamespace , function .AvailableReplicas , function .Replicas , d .Milliseconds ())
69+ log .Printf ("Replicas: %s.%s, (%d/%d) %dms" , functionName , lookupNamespace , function .AvailableReplicas , function .Replicas , d .Milliseconds ())
6970
7071 functionBytes , err := json .Marshal (function )
7172 if err != nil {
7273 klog .Errorf ("Failed to marshal function: %s" , err .Error ())
73- w .WriteHeader (http .StatusInternalServerError )
74- w .Write ([]byte ("Failed to marshal function" ))
74+ http .Error (w , "Failed to marshal function" , http .StatusInternalServerError )
7575 return
7676 }
7777
0 commit comments