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

Accept more paths to devices for install #552

Merged
merged 5 commits into from
Sep 23, 2024
Merged

Accept more paths to devices for install #552

merged 5 commits into from
Sep 23, 2024

Conversation

Itxaka
Copy link
Member

@Itxaka Itxaka commented Sep 20, 2024

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

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>
@Itxaka Itxaka requested a review from a team September 20, 2024 15:44
Signed-off-by: Itxaka <itxaka@kairos.io>
Copy link

codecov bot commented Sep 20, 2024

Codecov Report

Attention: Patch coverage is 26.66667% with 11 lines in your changes missing coverage. Please review.

Project coverage is 49.72%. Comparing base (ea731eb) to head (0819945).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
pkg/config/spec.go 26.66% 9 Missing and 2 partials ⚠️
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.
📢 Have feedback on the report? Share it here.

@@ -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
Copy link
Member Author

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.

Copy link
Member

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>
Signed-off-by: Itxaka <itxaka@kairos.io>
@@ -47,6 +47,27 @@ const (
TiB
)

// TODO: Move it to the sdk
func resolveTarget(fs v1.FS, target string) (string, error) {
Copy link
Member Author

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

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.

Code wise it looks ok. Needs manual testing (or even better, automated one :) ).

@Itxaka
Copy link
Member Author

Itxaka commented Sep 23, 2024

Trying to test it here: https://github.com/kairos-io/kairos/actions/runs/10990339501

@Itxaka Itxaka merged commit 60af824 into main Sep 23, 2024
14 checks passed
@Itxaka Itxaka deleted the accept_devices branch September 23, 2024 15:13
renovate bot referenced this pull request in kairos-io/provider-kairos Sep 24, 2024
…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
[@&#8203;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
[@&#8203;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
[@&#8203;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
[@&#8203;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
[@&#8203;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
[@&#8203;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
[@&#8203;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>
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.

Failure to install to /dev/disk/by-id/<id>
3 participants