Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions internal/handlers/descriptors/applications.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
---
#############################################################################
# Asset commands
#############################################################################
get:
use: applications
group: admin-essentials
Expand All @@ -14,11 +11,6 @@ describe:
description: |
Display detailed information about an application


#############################################################################
# Inspector commands
#############################################################################

inspect:
use: applications
description: |
Expand All @@ -38,5 +30,3 @@ restart:
use: application <name>
description: |
Restart an application


8 changes: 6 additions & 2 deletions internal/handlers/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ import (
var registry []any

func register(types ...any) {
for _, ele := range types {
registry = append(registry, ele)
// FIXME (privateip) this is a short term work around for the fact that the
// handler is now loaded multiple times.
if len(registry) == 0 {
for _, ele := range types {
registry = append(registry, ele)
}
}
}

Expand Down
18 changes: 6 additions & 12 deletions internal/runners/adapters.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,9 +331,11 @@ func (r *AdapterRunner) Export(in Request) (*Response, error) {
}, nil
}

//////////////////////////////////////////////////////////////////////////////
// Inspector interface
//
/*
*******************************************************************************
Inspector interfaceo
*******************************************************************************
*/

func (r *AdapterRunner) Inspect(in Request) (*Response, error) {
logger.Trace()
Expand All @@ -344,16 +346,8 @@ func (r *AdapterRunner) Inspect(in Request) (*Response, error) {
return nil, err
}

var display = []string{"NAME\tSTATUS\tVERSION"}

for _, ele := range adapters {
display = append(display, fmt.Sprintf(
"%s\t%s\t%s", ele.Id, ele.State, ele.Version,
))
}

return &Response{
Keys: []string{"name", "status", "version"},
Keys: []string{"id", "state", "version"},
Object: adapters,
}, nil
}
Expand Down
8 changes: 7 additions & 1 deletion internal/runners/applications.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,12 @@ func (r *ApplicationRunner) Restart(in Request) (*Response, error) {
}, nil
}

/*
*******************************************************************************
Inspector interfaceo
*******************************************************************************
*/

func (r *ApplicationRunner) Inspect(in Request) (*Response, error) {
logger.Trace()

Expand All @@ -119,7 +125,7 @@ func (r *ApplicationRunner) Inspect(in Request) (*Response, error) {
}

return &Response{
Keys: []string{"name", "status", "version"},
Keys: []string{"id", "state", "version"},
Object: res,
}, nil
}