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

Bring GHW clone and partition type into sdk #492

Merged
merged 4 commits into from
Sep 12, 2024
Merged

Bring GHW clone and partition type into sdk #492

merged 4 commits into from
Sep 12, 2024

Conversation

Itxaka
Copy link
Member

@Itxaka Itxaka commented Sep 11, 2024

Centralize the Kairos Partition and the methods for getting partitions from the system

Centralize the Kairos Partition and the methods for getting partitions
from the system

Signed-off-by: Itxaka <itxaka@kairos.io>
@Itxaka Itxaka requested a review from a team September 11, 2024 14:18
Copy link

codecov bot commented Sep 11, 2024

Codecov Report

Attention: Patch coverage is 67.39130% with 60 lines in your changes missing coverage. Please review.

Project coverage is 53.83%. Comparing base (d006d56) to head (f015ec2).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
ghw/ghw.go 67.39% 43 Missing and 17 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #492      +/-   ##
==========================================
+ Coverage   52.01%   53.83%   +1.82%     
==========================================
  Files          18       19       +1     
  Lines        1367     1551     +184     
==========================================
+ Hits          711      835     +124     
- Misses        544      587      +43     
- Partials      112      129      +17     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jimmykarily
Copy link
Contributor

Everything copied from other places right? I assume more PRs will follow up to clean up other repos.

Copy link
Contributor

@jimmykarily jimmykarily left a comment

Choose a reason for hiding this comment

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

As long as it's a copy paste 🤷

Signed-off-by: Itxaka <itxaka@kairos.io>
@Itxaka
Copy link
Member Author

Itxaka commented Sep 12, 2024

Everything copied from other places right? I assume more PRs will follow up to clean up other repos.

mainly yes. There is things like the Path struct that its a derivation of what ghw has as we dont need that much, and a lot of dropped methods as we dont use them (we dont care about the disk model for example or the wwn)

Still, I need to improve as I would like to store the disk UUID so we can identify the disk by the UUID directly (remember the kairos disk predictable uuid?) which can come in handy in the future.

@Itxaka
Copy link
Member Author

Itxaka commented Sep 12, 2024

ah yes, there is also an improvements in the Partition struct as we now store the type of FS and the UUID (again, improvements for the future in identifying the disk via a constant uuid :D)

Signed-off-by: Itxaka <itxaka@kairos.io>
 - Get a logger instance
 - Allow setting trace level from env vars
 - log a LOT of stuff
 - Remove uneeded Type filed. It already has FS for the same
 - Fix Paths appending with optional prefix
 - Allow Calling GetDisks with nil logger. It will create its own.
 - Get disk size and uuid
 - log on errors

Signed-off-by: Itxaka <itxaka@kairos.io>
@Itxaka Itxaka merged commit ea5c6c7 into main Sep 12, 2024
13 checks passed
@Itxaka Itxaka deleted the bring_ghw_sdk branch September 12, 2024 13:25
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