Skip to content

Commit

Permalink
Remove newlines from log statements
Browse files Browse the repository at this point in the history
These are not required and are added automatically

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
  • Loading branch information
alexellis committed Dec 9, 2024
1 parent eff2611 commit ee0e5fb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/handlers/replica_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const MaxReplicas = 5

// MaxFunctions licensed for OpenFaaS CE is 15
// a license for OpenFaaS Standard is required to increase this limit.
const MaxFunctions = 10
const MaxFunctions = 15

// MakeReplicaReader reads the amount of replicas for a deployment
func MakeReplicaReader(defaultNamespace string, lister v1.DeploymentLister) http.HandlerFunc {
Expand All @@ -54,8 +54,9 @@ func MakeReplicaReader(defaultNamespace string, lister v1.DeploymentLister) http

function, err := getService(lookupNamespace, functionName, lister)
if err != nil {
log.Printf("Unable to fetch service: %s %s\n", functionName, namespace)
log.Printf("Unable to fetch service: %s", functionName)
w.WriteHeader(http.StatusInternalServerError)
http.Error(w, fmt.Sprintf("Unable to fetch service: %s", functionName), http.StatusInternalServerError)
return
}

Expand All @@ -65,13 +66,12 @@ func MakeReplicaReader(defaultNamespace string, lister v1.DeploymentLister) http
}

d := time.Since(s)
log.Printf("Replicas: %s.%s, (%d/%d) %dms\n", functionName, lookupNamespace, function.AvailableReplicas, function.Replicas, d.Milliseconds())
log.Printf("Replicas: %s.%s, (%d/%d) %dms", functionName, lookupNamespace, function.AvailableReplicas, function.Replicas, d.Milliseconds())

functionBytes, err := json.Marshal(function)
if err != nil {
klog.Errorf("Failed to marshal function: %s", err.Error())
w.WriteHeader(http.StatusInternalServerError)
w.Write([]byte("Failed to marshal function"))
http.Error(w, "Failed to marshal function", http.StatusInternalServerError)
return
}

Expand Down

0 comments on commit ee0e5fb

Please sign in to comment.