diff options
author | Kiran Kamineni <kiran.k.kamineni@intel.com> | 2019-07-17 17:14:07 -0700 |
---|---|---|
committer | Kiran Kamineni <kiran.k.kamineni@intel.com> | 2019-07-18 16:24:34 -0700 |
commit | b8ecedd40b6be727233bf620a0aa5592f98161e7 (patch) | |
tree | 43d8525616b1a6ddd01ce23ad1bee090b8984264 /src/k8splugin/internal/rb | |
parent | 045ce10b7c48136dee24761e23ea0156f6255521 (diff) |
Add a listallhandler to definitions api
GET calls to the v1/rb/definition will
return all definitions and their versions
Issue-ID: MULTICLOUD-715
Change-Id: Ia0951ac83283830e475bf727e7d5ced7aab3add2
Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
Diffstat (limited to 'src/k8splugin/internal/rb')
-rw-r--r-- | src/k8splugin/internal/rb/definition.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/k8splugin/internal/rb/definition.go b/src/k8splugin/internal/rb/definition.go index 6998eedf..65ae8e00 100644 --- a/src/k8splugin/internal/rb/definition.go +++ b/src/k8splugin/internal/rb/definition.go @@ -121,10 +121,13 @@ func (v *DefinitionClient) List(name string) ([]Definition, error) { log.Printf("[Definition] Error Unmarshaling value for: %s", key) continue } + //Select only the definitions that match name provided - if def.RBName == name { + //If name is empty, return all + if def.RBName == name || name == "" { results = append(results, def) } + } } |