Skip to content

Commit 65e4803

Browse files
committed
Fix issue with filtering deployments
Fixes issue: openfaas#736 raised by pkoelbl where all deployments in the openfaas-fn namespace were being returned via the REST API when listing functions. The selector's Add method was generating a new value to be returned instead of updating itself. A negative test would have shown this and may be worth adding to the codebase at a later date, or being mocked/stubbed. A PR would be welcomed for this. Thanks also to @LucasRoesler for helping to investigate and confirm the fix. Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
1 parent ea9c13a commit 65e4803

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/handlers/reader.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ func getServiceList(functionNamespace string, deploymentLister v1.DeploymentList
6666
if err != nil {
6767
return functions, err
6868
}
69-
sel.Add(*req)
69+
onlyFunctions := sel.Add(*req)
7070

71-
res, err := deploymentLister.Deployments(functionNamespace).List(sel)
71+
res, err := deploymentLister.Deployments(functionNamespace).List(onlyFunctions)
7272

7373
if err != nil {
7474
return nil, err

0 commit comments

Comments
 (0)