mirror of
https://github.com/openfaas/faasd.git
synced 2025-06-08 16:06:47 +00:00
Remove newlines from log lines, which are not required
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
This commit is contained in:
parent
1c1bfa6759
commit
5b633cc017
@ -36,12 +36,16 @@ var rootCommand = &cobra.Command{
|
||||
Use: "faasd",
|
||||
Short: "Start faasd",
|
||||
Long: `
|
||||
faasd - Serverless For Everyone Else
|
||||
faasd Community Edition (CE):
|
||||
|
||||
Learn how to build, secure, and monitor functions with faasd with
|
||||
the eBook:
|
||||
|
||||
https://openfaas.gumroad.com/l/serverless-for-everyone-else
|
||||
|
||||
License: OpenFaaS CE EULA with faasd addendum:
|
||||
|
||||
https://github.com/openfaas/faasd/blob/master/EULA.md
|
||||
`,
|
||||
RunE: runRootCommand,
|
||||
SilenceUsage: true,
|
||||
@ -68,7 +72,7 @@ func parseBaseCommand(_ *cobra.Command, _ []string) {
|
||||
}
|
||||
|
||||
func printVersion() {
|
||||
fmt.Printf("faasd version: %s\tcommit: %s\n", pkg.GetVersion(), pkg.GitCommit)
|
||||
fmt.Printf("faasd Community Edition (CE) version: %s\tcommit: %s\n", pkg.GetVersion(), pkg.GitCommit)
|
||||
}
|
||||
|
||||
func printLogo() {
|
||||
|
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// ConnectivityCheck checks if the controller can reach the
|
||||
// public Internet via HTTPS.
|
||||
// A license is required to use OpenFaaS for Commercial Use.
|
||||
// A license is required to use OpenFaaS CE for Commercial Use.
|
||||
func ConnectivityCheck() error {
|
||||
req, err := http.NewRequest(http.MethodGet, "https://checkip.amazonaws.com", nil)
|
||||
if err != nil {
|
||||
@ -27,7 +27,10 @@ func ConnectivityCheck() error {
|
||||
}
|
||||
|
||||
if res.StatusCode != http.StatusOK {
|
||||
body, _ := io.ReadAll(res.Body)
|
||||
var body []byte
|
||||
if res.Body != nil {
|
||||
body, _ = io.ReadAll(res.Body)
|
||||
}
|
||||
|
||||
return fmt.Errorf("unexpected status code checking connectivity: %d, body: %s", res.StatusCode, strings.TrimSpace(string(body)))
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ func MakeDeleteHandler(client *containerd.Client, cni gocni.CNI) func(w http.Res
|
||||
|
||||
req := types.DeleteFunctionRequest{}
|
||||
if err := json.Unmarshal(body, &req); err != nil {
|
||||
log.Printf("[Delete] error parsing input: %s\n", err)
|
||||
log.Printf("[Delete] error parsing input: %s", err)
|
||||
http.Error(w, err.Error(), http.StatusBadRequest)
|
||||
|
||||
return
|
||||
|
@ -44,7 +44,7 @@ func MakeDeployHandler(client *containerd.Client, cni gocni.CNI, secretMountPath
|
||||
req := types.FunctionDeployment{}
|
||||
err := json.Unmarshal(body, &req)
|
||||
if err != nil {
|
||||
log.Printf("[Deploy] - error parsing input: %s\n", err)
|
||||
log.Printf("[Deploy] - error parsing input: %s", err)
|
||||
http.Error(w, err.Error(), http.StatusBadRequest)
|
||||
|
||||
return
|
||||
|
@ -31,7 +31,7 @@ func MakeReadHandler(client *containerd.Client) func(w http.ResponseWriter, r *h
|
||||
res := []types.FunctionStatus{}
|
||||
fns, err := ListFunctions(client, lookupNamespace)
|
||||
if err != nil {
|
||||
log.Printf("[Read] error listing functions. Error: %s\n", err)
|
||||
log.Printf("[Read] error listing functions. Error: %s", err)
|
||||
http.Error(w, err.Error(), http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ func MakeReplicaUpdateHandler(client *containerd.Client, cni gocni.CNI) func(w h
|
||||
|
||||
req := types.ScaleServiceRequest{}
|
||||
if err := json.Unmarshal(body, &req); err != nil {
|
||||
log.Printf("[Scale] error parsing input: %s\n", err)
|
||||
log.Printf("[Scale] error parsing input: %s", err)
|
||||
http.Error(w, err.Error(), http.StatusBadRequest)
|
||||
|
||||
return
|
||||
|
@ -71,7 +71,7 @@ func listSecrets(store provider.Labeller, w http.ResponseWriter, r *http.Request
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
fmt.Printf("Error Occured: %s \n", err)
|
||||
log.Printf("[Secret] Error listing secrets: %s ", err)
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ func MakeUpdateHandler(client *containerd.Client, cni gocni.CNI, secretMountPath
|
||||
req := types.FunctionDeployment{}
|
||||
err := json.Unmarshal(body, &req)
|
||||
if err != nil {
|
||||
log.Printf("[Update] error parsing input: %s\n", err)
|
||||
log.Printf("[Update] error parsing input: %s", err)
|
||||
http.Error(w, err.Error(), http.StatusBadRequest)
|
||||
|
||||
return
|
||||
|
@ -227,7 +227,7 @@ func (s *Supervisor) Start(svcs []Service) error {
|
||||
)
|
||||
|
||||
if err != nil {
|
||||
log.Printf("Error creating container: %s\n", err)
|
||||
log.Printf("Error creating container: %s", err)
|
||||
return err
|
||||
}
|
||||
|
||||
@ -235,7 +235,7 @@ func (s *Supervisor) Start(svcs []Service) error {
|
||||
|
||||
task, err := newContainer.NewTask(ctx, cio.BinaryIO("/usr/local/bin/faasd", nil))
|
||||
if err != nil {
|
||||
log.Printf("Error creating task: %s\n", err)
|
||||
log.Printf("Error creating task: %s", err)
|
||||
return err
|
||||
}
|
||||
|
||||
@ -268,7 +268,7 @@ func (s *Supervisor) Start(svcs []Service) error {
|
||||
}
|
||||
|
||||
if _, err := task.Wait(ctx); err != nil {
|
||||
log.Printf("Task wait error: %s\n", err)
|
||||
log.Printf("Task wait error: %s", err)
|
||||
return err
|
||||
}
|
||||
|
||||
@ -276,7 +276,7 @@ func (s *Supervisor) Start(svcs []Service) error {
|
||||
// log.Println("Exited: ", exitStatusC)
|
||||
|
||||
if err = task.Start(ctx); err != nil {
|
||||
log.Printf("Task start error: %s\n", err)
|
||||
log.Printf("Task start error: %s", err)
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user