Skip to content

Commit

Permalink
Fix two go vet issues in the kvstore handlers
Browse files Browse the repository at this point in the history
daemon/daemonapi/get_object_kvstore_keys.go:51:40: github.com/opensvc/om3/util/key.T struct literal uses unkeyed fields
daemon/daemonapi/get_object_kvstore_entry.go:53:3: unreachable code
  • Loading branch information
cvaroqui committed Sep 6, 2024
1 parent 91e8c6b commit ea58be3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 0 additions & 1 deletion daemon/daemonapi/get_object_kvstore_entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ func (a *DaemonAPI) GetObjectKVStoreEntry(ctx echo.Context, namespace string, ki
}
return ctx.Blob(http.StatusOK, contentType, b)
}
return ctx.NoContent(http.StatusNoContent)
}

for nodename := range instanceConfigData {
Expand Down
7 changes: 6 additions & 1 deletion daemon/daemonapi/get_object_kvstore_keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,16 @@ func (a *DaemonAPI) GetObjectKVStoreKeys(ctx echo.Context, namespace string, kin
} else {
items := make(api.KVStoreKeyListItems, 0)
for _, name := range names {
configKey := key.T{
Section: "data",
Option: name,
}
size := len(ks.Config().GetString(configKey))
items = append(items, api.KVStoreKeyListItem{
Object: p.String(),
Node: a.localhost,
Key: name,
Size: len(ks.Config().GetString(key.T{"data", name})),
Size: size,
})
}
return ctx.JSON(http.StatusOK, api.KVStoreKeyList{
Expand Down

0 comments on commit ea58be3

Please sign in to comment.