Support cosi output type for injection API.#268
Conversation
| if err != nil { | ||
| return fmt.Errorf("failed to convert customized raw image to output format:\n%w", err) | ||
| if detectedImageFormat == imagecustomizerapi.ImageFormatTypeCosi { | ||
| imageConnection, partUuidToFstabEntry, baseImageVerityMetadata, err := connectToExistingImage(rawImageFile, |
There was a problem hiding this comment.
Move the collection of osRelease and osPackages into a function, to help make the code a little cleaner.
There was a problem hiding this comment.
Sorry, I should have been more specific. I meant create a helper function that covers connectToExistingImage to CleanClose.
There was a problem hiding this comment.
I see, please check it again.
| if err != nil { | ||
| return fmt.Errorf("failed to convert customized raw image to output format:\n%w", err) | ||
| if detectedImageFormat == imagecustomizerapi.ImageFormatTypeCosi { | ||
| imageConnection, partUuidToFstabEntry, baseImageVerityMetadata, err := connectToExistingImage(rawImageFile, |
There was a problem hiding this comment.
Sorry, I should have been more specific. I meant create a helper function that covers connectToExistingImage to CleanClose.
b77ea21 to
7ad78e8
Compare
| partUuidToFstabEntry map[string]diskutils.FstabEntry, verityMetadata []verityDeviceMetadata, | ||
| osRelease string, osPackages []OsPackage, imageUuid [UuidSize]byte, imageUuidStr string, | ||
| ) error { | ||
| outputImageBase := strings.TrimSuffix(filepath.Base(outputImageFile), filepath.Ext(outputImageFile)) |
There was a problem hiding this comment.
To be honest, we could probably give the partition files a standard base name of partition instead of it being dynamic. This user isn't going to see these files anyway.
There was a problem hiding this comment.
Fixed, please check again.
| if err != nil { | ||
| return fmt.Errorf("failed to convert customized raw image to output format:\n%w", err) | ||
| if detectedImageFormat == imagecustomizerapi.ImageFormatTypeCosi { | ||
| imageConnection, partUuidToFstabEntry, baseImageVerityMetadata, err := connectToExistingImage(rawImageFile, |
f8a1d27 to
6ee21bf
Compare
Support users to set output image type as COSI when injection API gets called.
Checklist