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

Clarify wording of VirtCheck failure, fix weird line wrapping #654

Merged

Conversation

tserong
Copy link
Contributor

@tserong tserong commented Feb 9, 2024

Problem:
When running under virtualization the current warning message says "System is virtualized (kvm) which is not supported", but should say "not supported in production". Also, in some cases, there's extra linebreaks in the warning messages, e.g.:

image (6)

Solution:
This PR

Related Issue:
harvester/harvester#1154

Test plan:
N/A

Without this fix, if you're extremely unlucky with window size and
string length, the wrap performed by gocui's View.draw() function will
inject an extra linebreak at the same place we already injected one,
leading to annoyingly weird displays like this:

```
Only 19GiB RAM detected. Harvester requires at least 32GiB for testing and 64GiB for production

use.
```

Signed-off-by: Tim Serong <[email protected]>
@tserong tserong added the bug Something isn't working label Feb 9, 2024
@tserong tserong self-assigned this Feb 9, 2024
Copy link
Member

@w13915984028 w13915984028 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks.

panelWidth := p.X1 - p.X0
// Need to subtract 1 from panelWidth here to match the view.Size()
// calculation done in gocui's view.Draw() function
panelWidth := p.X1 - p.X0 - 1

Choose a reason for hiding this comment

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

Is there any chance at all of this becoming negative? Would that be bad or does gocui do the right thing and just occlude anything that's not on the page?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't believe it's possible for that to ever end up negative, but just in case I'm wrong there's an if panelWidth > 0 to ensure our wrapping doesn't kick in if the dimensions are bogus :-)

@w13915984028 w13915984028 merged commit 09b5ac1 into harvester:master Feb 12, 2024
5 checks passed
@tserong tserong deleted the wip-hardware-preflight-check-fix-wording branch February 13, 2024 02:32
@w13915984028
Copy link
Member

FYI: With the fix #654
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants