-
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
Fix azure #210
base: main
Are you sure you want to change the base?
Fix azure #210
Conversation
To fix this error: Message: The specified cookie value in VHD footer indicates that disk 'kairos-ubuntu-24.04-core-amd64-generic-3.3.1-88-g70ebc315.raw.vhd' with blob https://kairoscloudimages.blob.core.windows.net:8443/kairos-cloud-images/kairos-ubuntu-24.04-core-amd64-generic-3.3.1-88-g70ebc315.raw.vhd is not a supported VHD. Disk is expected to have cookie value 'conectix'. Signed-off-by: Dimitris Karakasilis <[email protected]>
Thus we don't have to remove 512 bytes (the "footer"/header size). We just round the file up and we add the footer in the end. Signed-off-by: Dimitris Karakasilis <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #210 +/- ##
==========================================
- Coverage 14.29% 14.02% -0.27%
==========================================
Files 11 11
Lines 1749 1775 +26
==========================================
- Hits 250 249 -1
- Misses 1483 1510 +27
Partials 16 16 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@@ -44,8 +45,6 @@ func Raw2Azure(source string) (string, error) { | |||
var finalSize int64 | |||
// Calculate the final size in bytes | |||
finalSize = ((actualSize + constants.MB - 1) / constants.MB) * constants.MB | |||
finalSize -= 512 |
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.
So this is what its breaking it? what out because IIRC the checksum is calculated based on the size or something like that? I know I added it somehow for a checksum reason or something like that?
Well, if it works, it works :D
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, trial and error :D
@@ -88,7 +87,7 @@ func Raw2Azure(source string) (string, error) { | |||
} | |||
sizeFile := fileInfo.Size() | |||
|
|||
if sizeFile%constants.MB != 0 { | |||
if int64(size)%constants.MB != 0 { |
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.
size is the old size, but we are writing the header to the file afterwards, so the size has changed. Thats why it updates the stat before checking it, to get the actual real size on disk of it. Not sure if this is ok
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.
Azure wants the image size without the "footer" to be a multiple of MB so we don't need to subtract 512 (see the other change). This check becomes less important then, but I changed it anyway to make it work.
Part of: kairos-io/kairos#3198