Skip to content

Commit

Permalink
internal/cloud/gcp/compute: keep legacy Guest OS Features for el9.0
Browse files Browse the repository at this point in the history
The SEV-SNP support was added since RHEL-9.1, so we need to keep the
original Guest OS Feature set when importing RHEL-9.0 images to GCP.

Signed-off-by: Tomáš Hozza <[email protected]>
  • Loading branch information
thozza committed Aug 14, 2023
1 parent 170882e commit 30c82b6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions internal/cloud/gcp/compute.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ var GuestOsFeaturesRHEL9 []*computepb.GuestOsFeature = []*computepb.GuestOsFeatu
{Type: common.ToPtr(computepb.GuestOsFeature_SEV_SNP_CAPABLE.String())},
}

// Guest OS Features for RHEL9.0 images.
// The SEV-SNP support was added since RHEL-9.1, so keeping this for RHEL-9.0 only.
var GuestOsFeaturesRHEL90 []*computepb.GuestOsFeature = []*computepb.GuestOsFeature{
{Type: common.ToPtr(computepb.GuestOsFeature_UEFI_COMPATIBLE.String())},
{Type: common.ToPtr(computepb.GuestOsFeature_VIRTIO_SCSI_MULTIQUEUE.String())},
{Type: common.ToPtr(computepb.GuestOsFeature_SEV_CAPABLE.String())},
{Type: common.ToPtr(computepb.GuestOsFeature_GVNIC.String())},
}

// GuestOsFeaturesByDistro returns the the list of Guest OS Features, which
// should be used when importing an image of the specified distribution.
//
Expand All @@ -42,6 +51,8 @@ func GuestOsFeaturesByDistro(distroName string) []*computepb.GuestOsFeature {
case strings.HasPrefix(distroName, "rhel-8"):
return GuestOsFeaturesRHEL8

case distroName == "rhel-90":
return GuestOsFeaturesRHEL90
case strings.HasPrefix(distroName, "centos-9"):
fallthrough
case strings.HasPrefix(distroName, "rhel-9"):
Expand Down

0 comments on commit 30c82b6

Please sign in to comment.