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

Adds raw disk utils #541

Closed
wants to merge 1 commit into from
Closed

Adds raw disk utils #541

wants to merge 1 commit into from

Conversation

Itxaka
Copy link
Member

@Itxaka Itxaka commented Dec 18, 2024

Adds raw disk utils to convert a raw disk into a GCE or Azure image Adds a new constants package to store constants that can be reused across all of our projects
Expands KairosFs interface to be in line with whats used on other projects so we can use it

Adds raw disk utils to convert a raw disk into a GCE or Azure image
Adds a new constants package to store constants that can be reused
across all of our projects
Expands KairosFs interface to be in line with whats used on other
projects so we can use it
@Itxaka Itxaka requested a review from a team December 18, 2024 11:18
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.

Magic!

// Raw2Azure converts a raw disk to a VHD disk compatible with Azure
// All VHDs on Azure must have a virtual size aligned to 1 MB (1024 × 1024 bytes)
// The Hyper-V virtual hard disk (VHDX) format isn't supported in Azure, only fixed VHD
func Raw2Azure(source string, logger types.KairosLogger) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

mainly yes, but in pure go instead.

Open(name string) (fs.File, error)
Chmod(name string, mode os.FileMode) error
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't there be the implementations too somewhere in this PR?

Copy link
Member Author

Choose a reason for hiding this comment

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

not really, this means you can pass a vfs that implements this methods everywhere you need it, even create your own. The implementation we use is the github.com/twpayne/go-vfs normally but this would allow us to move to a different one by implementing the missing parts. Like osFS does. Its just to use it as a type param mainly in generic methods so you can provide whatever underlying lib you want as long as it implements the methods. So like the KairosLogger we have.

@Itxaka
Copy link
Member Author

Itxaka commented Dec 23, 2024

nope, going to aurora directyl, makes no sense to reuse them anywhere

@Itxaka Itxaka closed this Dec 23, 2024
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