Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(plugin/block-devices): don't panic on unmanaged pools #914

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

tiagolobocastro
Copy link
Contributor

fix(plugin/block-devices): don't panic on unmanaged pools

When fetching the block-devices, don't panic if the pool spec is missing,
that is, if the pool is unmanaged.
(this can happen when troubleshooting and we remove pool
from control plane).

Signed-off-by: Tiago Castro <[email protected]>

test: add pool create test rpc

Signed-off-by: Tiago Castro <[email protected]>

In addition, the current plugin output tests are not running it seems as they otherwise fail when ran manually (at least the pool).
I fixed the pool test, but I don't think these are maintainable the way they are written. I'd rather smart parse the human output into json and then compare json with expected output.
Also we are calling rest directly, and thus we're not testing the actual calling of rest itself, we're just testing the human output formatting.

When fetching the block-devices, don't panic if the pool spec is missing,
that is, if the pool is unmanaged.
(this can happen when troubleshooting and we remove pool
from control plane).

Signed-off-by: Tiago Castro <[email protected]>
Comment on lines +426 to +429
" {id} {disks} {managed} {node} {status} {capacity} {allocated} {available} {committed} \n",
id = pool_state.id,
node = pool_state.node,
status = pool_state.status.to_string(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah agreed this is not a good way anymore now that the plugin has become more complex. The earlier intention was just to validate the stdout, tabular output, when the plugin was in initial stages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants