Skip to content

Commit fa22a0f

Browse files
committed
Implement ListByPluginName
Signed-off-by: Yoshiki Fujikane <[email protected]>
1 parent fa548f6 commit fa22a0f

File tree

1 file changed

+15
-2
lines changed
  • pkg/app/pipedv1/apistore/applicationstore

1 file changed

+15
-2
lines changed

pkg/app/pipedv1/apistore/applicationstore/store.go

+15-2
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,19 @@ func (s *store) Get(id string) (*model.Application, bool) {
159159

160160
// ListByPluginName lists all applications for a given plugin name.
161161
func (s *store) ListByPluginName(name string) []*model.Application {
162-
// TODO: implement it
163-
return nil
162+
apps := s.applicationList.Load()
163+
if apps == nil {
164+
return nil
165+
}
166+
167+
out := make([]*model.Application, 0)
168+
list := apps.([]*model.Application)
169+
170+
for _, app := range list {
171+
if app.Plugin == name {
172+
out = append(out, app)
173+
}
174+
}
175+
176+
return out
164177
}

0 commit comments

Comments
 (0)