-
Notifications
You must be signed in to change notification settings - Fork 9
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
Adds raw disk utils #541
Conversation
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
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.
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 { |
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.
Is this implementing this script? https://github.com/kairos-io/AuroraBoot/blob/main/image-assets/azure.sh
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.
mainly yes, but in pure go instead.
Open(name string) (fs.File, error) | ||
Chmod(name string, mode os.FileMode) 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.
Shouldn't there be the implementations too somewhere in this PR?
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.
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.
nope, going to aurora directyl, makes no sense to reuse them anywhere |
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