@@ -27,7 +27,7 @@ const MaxReplicas = 5
27
27
28
28
// MaxFunctions licensed for OpenFaaS CE is 15
29
29
// a license for OpenFaaS Standard is required to increase this limit.
30
- const MaxFunctions = 10
30
+ const MaxFunctions = 15
31
31
32
32
// MakeReplicaReader reads the amount of replicas for a deployment
33
33
func MakeReplicaReader (defaultNamespace string , lister v1.DeploymentLister ) http.HandlerFunc {
@@ -54,8 +54,9 @@ func MakeReplicaReader(defaultNamespace string, lister v1.DeploymentLister) http
54
54
55
55
function , err := getService (lookupNamespace , functionName , lister )
56
56
if err != nil {
57
- log .Printf ("Unable to fetch service: %s %s \n " , functionName , namespace )
57
+ log .Printf ("Unable to fetch service: %s" , functionName )
58
58
w .WriteHeader (http .StatusInternalServerError )
59
+ http .Error (w , fmt .Sprintf ("Unable to fetch service: %s" , functionName ), http .StatusInternalServerError )
59
60
return
60
61
}
61
62
@@ -65,13 +66,12 @@ func MakeReplicaReader(defaultNamespace string, lister v1.DeploymentLister) http
65
66
}
66
67
67
68
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 ())
69
70
70
71
functionBytes , err := json .Marshal (function )
71
72
if err != nil {
72
73
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 )
75
75
return
76
76
}
77
77
0 commit comments