-
Notifications
You must be signed in to change notification settings - Fork 6
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
Accept more paths to devices for install #552
Conversation
Accepts any of the paths that udev adds for ease of use and are laying under /dev/disk/by-X As those are all softlinks to the actual device, it should be faily easy to just read the link and use the final target as that should always be a full device path (/dev/vda for example) Signed-off-by: Itxaka <itxaka@kairos.io>
Signed-off-by: Itxaka <itxaka@kairos.io>
25da0cc
to
80f2e83
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #552 +/- ##
==========================================
- Coverage 49.80% 49.72% -0.08%
==========================================
Files 48 48
Lines 4566 4581 +15
==========================================
+ Hits 2274 2278 +4
- Misses 2018 2027 +9
- Partials 274 276 +2 ☔ View full report in Codecov by Sentry. |
pkg/types/v1/config.go
Outdated
@@ -76,6 +78,22 @@ type InstallSpec struct { | |||
// Sanitize checks the consistency of the struct, returns error | |||
// if unsolvable inconsistencies are found | |||
func (i *InstallSpec) Sanitize() error { | |||
// Accept that the target can be a /dev/disk/by-{label,uuid,path,etc..} and resolve it into a /dev/device |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be moved into a method so It can be called from anywhere I guess.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup not a bad idea
Signed-off-by: Itxaka <itxaka@kairos.io>
23d6f26
to
584bc88
Compare
077034f
to
0819945
Compare
@@ -47,6 +47,27 @@ const ( | |||
TiB | |||
) | |||
|
|||
// TODO: Move it to the sdk | |||
func resolveTarget(fs v1.FS, target string) (string, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good here to test it directly on kairos via branches, if it works will move it into the sdk as its a very generic method that can be used everywhere, including immucore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code wise it looks ok. Needs manual testing (or even better, automated one :) ).
Trying to test it here: https://github.com/kairos-io/kairos/actions/runs/10990339501 |
…4.2 (#639) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [github.com/kairos-io/kairos-agent/v2](https://redirect.github.com/kairos-io/kairos-agent) | `v2.14.1` -> `v2.14.2` | [![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fkairos-io%2fkairos-agent%2fv2/v2.14.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/go/github.com%2fkairos-io%2fkairos-agent%2fv2/v2.14.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/go/github.com%2fkairos-io%2fkairos-agent%2fv2/v2.14.1/v2.14.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fkairos-io%2fkairos-agent%2fv2/v2.14.1/v2.14.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>kairos-io/kairos-agent (github.com/kairos-io/kairos-agent/v2)</summary> ### [`v2.14.2`](https://redirect.github.com/kairos-io/kairos-agent/releases/tag/v2.14.2) [Compare Source](https://redirect.github.com/kairos-io/kairos-agent/compare/v2.14.1...v2.14.2) #### What's Changed - chore(deps): update securego/gosec action to v2.21.3 by [@​renovate](https://redirect.github.com/renovate) in [https://github.com/kairos-io/kairos-agent/pull/547](https://redirect.github.com/kairos-io/kairos-agent/pull/547) - Revert "chore(deps): update securego/gosec action to v2.21.3" by [@​Itxaka](https://redirect.github.com/Itxaka) in [https://github.com/kairos-io/kairos-agent/pull/549](https://redirect.github.com/kairos-io/kairos-agent/pull/549) - chore(deps): update securego/gosec action to v2.21.3 by [@​renovate](https://redirect.github.com/renovate) in [https://github.com/kairos-io/kairos-agent/pull/551](https://redirect.github.com/kairos-io/kairos-agent/pull/551) - Expose the Analize method of yip by [@​Itxaka](https://redirect.github.com/Itxaka) in [https://github.com/kairos-io/kairos-agent/pull/548](https://redirect.github.com/kairos-io/kairos-agent/pull/548) - Revert "chore(deps): update securego/gosec action to v2.21.3" by [@​Itxaka](https://redirect.github.com/Itxaka) in [https://github.com/kairos-io/kairos-agent/pull/553](https://redirect.github.com/kairos-io/kairos-agent/pull/553) - fix(deps): update dependency codemirror to v5.65.18 by [@​renovate](https://redirect.github.com/renovate) in [https://github.com/kairos-io/kairos-agent/pull/555](https://redirect.github.com/kairos-io/kairos-agent/pull/555) - Accept more paths to devices for install by [@​Itxaka](https://redirect.github.com/Itxaka) in [https://github.com/kairos-io/kairos-agent/pull/552](https://redirect.github.com/kairos-io/kairos-agent/pull/552) **Full Changelog**: kairos-io/kairos-agent@v2.14.1...v2.14.2 </details> --- ### Configuration 📅 **Schedule**: Branch creation - "after 11pm every weekday,before 7am every weekday,every weekend" in timezone Europe/Brussels, Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/kairos-io/provider-kairos). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC44MC4wIiwidXBkYXRlZEluVmVyIjoiMzguODAuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Accepts any of the paths that udev adds for ease of use and are laying
under /dev/disk/by-X
As those are all softlinks to the actual device, it should be faily easy
to just read the link and use the final target as that should always be
a full device path (/dev/vda for example)
Fixes: kairos-io/kairos#1879
Signed-off-by: Itxaka itxaka@kairos.io