mirror of
https://github.com/openfaas/faasd.git
synced 2025-06-08 16:06:47 +00:00
Skip adding function if GetFunction returns error
When ListFunctions populate it's function map, it should not add functions that GetFunction returned error. Signed-off-by: Carlos de Paula <me@carlosedp.com>
This commit is contained in:
parent
9dcdbfb7e3
commit
667d74aaf7
@ -33,7 +33,11 @@ func ListFunctions(client *containerd.Client) (map[string]Function, error) {
|
||||
containers, _ := client.Containers(ctx)
|
||||
for _, k := range containers {
|
||||
name := k.ID()
|
||||
functions[name], _ = GetFunction(client, name)
|
||||
f, err := GetFunction(client, name)
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
functions[name] = f
|
||||
}
|
||||
return functions, nil
|
||||
}
|
||||
@ -44,7 +48,6 @@ func GetFunction(client *containerd.Client, name string) (Function, error) {
|
||||
c, err := client.LoadContainer(ctx, name)
|
||||
|
||||
if err == nil {
|
||||
|
||||
image, _ := c.Image(ctx)
|
||||
|
||||
containerName := c.ID()
|
||||
|
Loading…
x
Reference in New Issue
Block a user