Add image platform by default
Resolves:
@@ -17,14 +17,15 @@ import org.zstack.header.volume.VolumeVO_;
*/
public class ImageMessageFiller {
public static void fillDefault(AddImageMessage msg) {
- if (ImageConstant.ImageMediaType.DataVolumeTemplate.toString().equals(msg.getMediaType())) {
- return;
- }
-
+ //TODO(weiw): in some cases, platform is needed by default, ZSTAC-41141
if (msg.getPlatform() == null) {
msg.setPlatform(ImagePlatform.Linux.toString());
}
+ if (ImageConstant.ImageMediaType.DataVolumeTemplate.toString().equals(msg.getMediaType())) {
+ return;
+ }
+
if (msg.getPlatform().equals(ImagePlatform.Paravirtualization.toString())) {
msg.setPlatform(ImagePlatform.Other.toString());
} else if (msg.getPlatform().equals(ImagePlatform.WindowsVirtio.toString())) {
