RHEL-85: add gce-rhui image type
Add the `gce-rhui` image type intended for Google Compute Engine. The image uses Google's RHUI infrastructure to access Red Hat content. Signed-off-by: Tomas Hozza <thozza@redhat.com>
This commit is contained in:
parent
6ffe63442e
commit
77b5ef459d
8 changed files with 11728 additions and 5 deletions
|
|
@ -884,6 +884,25 @@ func newDistro(name, modulePlatformID, ostreeRef string) distro.Distro {
|
||||||
basePartitionTables: defaultBasePartitionTables,
|
basePartitionTables: defaultBasePartitionTables,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gceRhuiImgType := imageType{
|
||||||
|
name: "gce-rhui",
|
||||||
|
filename: "image.tar.gz",
|
||||||
|
mimeType: "application/gzip",
|
||||||
|
packageSets: map[string]packageSetFunc{
|
||||||
|
buildPkgsKey: distroBuildPackageSet,
|
||||||
|
osPkgsKey: gceRhuiPackageSet,
|
||||||
|
},
|
||||||
|
kernelOptions: "net.ifnames=0 biosdevname=0 scsi_mod.use_blk_mq=Y crashkernel=auto console=ttyS0,38400n8d",
|
||||||
|
bootable: true,
|
||||||
|
bootType: distro.UEFIBootType,
|
||||||
|
defaultSize: 20 * GigaByte,
|
||||||
|
pipelines: gceRhuiPipelines,
|
||||||
|
buildPipelines: []string{"build"},
|
||||||
|
payloadPipelines: []string{"os", "image", "archive"},
|
||||||
|
exports: []string{"archive"},
|
||||||
|
basePartitionTables: defaultBasePartitionTables,
|
||||||
|
}
|
||||||
|
|
||||||
tarImgType := imageType{
|
tarImgType := imageType{
|
||||||
name: "tar",
|
name: "tar",
|
||||||
filename: "root.tar.xz",
|
filename: "root.tar.xz",
|
||||||
|
|
@ -920,7 +939,7 @@ func newDistro(name, modulePlatformID, ostreeRef string) distro.Distro {
|
||||||
exports: []string{"bootiso"},
|
exports: []string{"bootiso"},
|
||||||
}
|
}
|
||||||
|
|
||||||
x86_64.addImageTypes(qcow2ImgType, vhdImgType, vmdkImgType, openstackImgType, amiImgTypeX86_64, ec2ImgTypeX86_64, ec2HaImgTypeX86_64, tarImgType, imageInstallerImgTypeX86_64, edgeCommitImgType, edgeInstallerImgType, edgeOCIImgType, edgeRawImgType, edgeSimplifiedInstallerImgType, ociImageType, gceImgType)
|
x86_64.addImageTypes(qcow2ImgType, vhdImgType, vmdkImgType, openstackImgType, amiImgTypeX86_64, ec2ImgTypeX86_64, ec2HaImgTypeX86_64, tarImgType, imageInstallerImgTypeX86_64, edgeCommitImgType, edgeInstallerImgType, edgeOCIImgType, edgeRawImgType, edgeSimplifiedInstallerImgType, ociImageType, gceImgType, gceRhuiImgType)
|
||||||
aarch64.addImageTypes(qcow2ImgType, openstackImgType, amiImgTypeAarch64, ec2ImgTypeAarch64, tarImgType, edgeCommitImgType, edgeInstallerImgType, edgeOCIImgType, edgeRawImgType, edgeSimplifiedInstallerImgType)
|
aarch64.addImageTypes(qcow2ImgType, openstackImgType, amiImgTypeAarch64, ec2ImgTypeAarch64, tarImgType, edgeCommitImgType, edgeInstallerImgType, edgeOCIImgType, edgeRawImgType, edgeSimplifiedInstallerImgType)
|
||||||
ppc64le.addImageTypes(qcow2ImgType, tarImgType)
|
ppc64le.addImageTypes(qcow2ImgType, tarImgType)
|
||||||
s390x.addImageTypes(qcow2ImgType, tarImgType)
|
s390x.addImageTypes(qcow2ImgType, tarImgType)
|
||||||
|
|
|
||||||
|
|
@ -171,6 +171,14 @@ func TestFilenameFromType(t *testing.T) {
|
||||||
mimeType: "application/gzip",
|
mimeType: "application/gzip",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "gce-rhui",
|
||||||
|
args: args{"gce-rhui"},
|
||||||
|
want: wantResult{
|
||||||
|
filename: "image.tar.gz",
|
||||||
|
mimeType: "application/gzip",
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "invalid-output-type",
|
name: "invalid-output-type",
|
||||||
args: args{"foobar"},
|
args: args{"foobar"},
|
||||||
|
|
@ -275,6 +283,7 @@ func TestImageType_Name(t *testing.T) {
|
||||||
"tar",
|
"tar",
|
||||||
"image-installer",
|
"image-installer",
|
||||||
"gce",
|
"gce",
|
||||||
|
"gce-rhui",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -464,6 +473,7 @@ func TestArchitecture_ListImageTypes(t *testing.T) {
|
||||||
"image-installer",
|
"image-installer",
|
||||||
"oci",
|
"oci",
|
||||||
"gce",
|
"gce",
|
||||||
|
"gce-rhui",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -457,6 +457,15 @@ func gcePackageSet(t *imageType) rpmmd.PackageSet {
|
||||||
return gceCommonPackageSet(t)
|
return gceCommonPackageSet(t)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GCE RHUI image
|
||||||
|
func gceRhuiPackageSet(t *imageType) rpmmd.PackageSet {
|
||||||
|
return rpmmd.PackageSet{
|
||||||
|
Include: []string{
|
||||||
|
"google-rhui-client-rhel8",
|
||||||
|
},
|
||||||
|
}.Append(gceCommonPackageSet(t))
|
||||||
|
}
|
||||||
|
|
||||||
// edge commit OS package set
|
// edge commit OS package set
|
||||||
func edgeCommitPackageSet(t *imageType) rpmmd.PackageSet {
|
func edgeCommitPackageSet(t *imageType) rpmmd.PackageSet {
|
||||||
ps := rpmmd.PackageSet{
|
ps := rpmmd.PackageSet{
|
||||||
|
|
|
||||||
|
|
@ -854,6 +854,39 @@ func gceByosPipelines(t *imageType, customizations *blueprint.Customizations, op
|
||||||
return gcePipelinesRhel86(t, getDefaultGceByosImageConfig(), customizations, options, repos, packageSetSpecs, rng)
|
return gcePipelinesRhel86(t, getDefaultGceByosImageConfig(), customizations, options, repos, packageSetSpecs, rng)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func getDefaultGceRhuiImageConfig() *distro.ImageConfig {
|
||||||
|
defaultGceRhuiImageConfig := &distro.ImageConfig{
|
||||||
|
RHSMConfig: map[distro.RHSMSubscriptionStatus]*osbuild.RHSMStageOptions{
|
||||||
|
distro.RHSMConfigNoSubscription: {
|
||||||
|
SubMan: &osbuild.RHSMStageOptionsSubMan{
|
||||||
|
Rhsmcertd: &osbuild.SubManConfigRHSMCERTDSection{
|
||||||
|
AutoRegistration: common.BoolToPtr(true),
|
||||||
|
},
|
||||||
|
Rhsm: &osbuild.SubManConfigRHSMSection{
|
||||||
|
ManageRepos: common.BoolToPtr(false),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
distro.RHSMConfigWithSubscription: {
|
||||||
|
SubMan: &osbuild.RHSMStageOptionsSubMan{
|
||||||
|
Rhsmcertd: &osbuild.SubManConfigRHSMCERTDSection{
|
||||||
|
AutoRegistration: common.BoolToPtr(true),
|
||||||
|
},
|
||||||
|
// do not disable the redhat.repo management if the user
|
||||||
|
// explicitly request the system to be subscribed
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
defaultGceRhuiImageConfig = defaultGceRhuiImageConfig.InheritFrom(getDefaultGceByosImageConfig())
|
||||||
|
return defaultGceRhuiImageConfig
|
||||||
|
}
|
||||||
|
|
||||||
|
// GCE RHUI image
|
||||||
|
func gceRhuiPipelines(t *imageType, customizations *blueprint.Customizations, options distro.ImageOptions, repos []rpmmd.RepoConfig, packageSetSpecs map[string][]rpmmd.PackageSpec, rng *rand.Rand) ([]osbuild.Pipeline, error) {
|
||||||
|
return gcePipelinesRhel86(t, getDefaultGceRhuiImageConfig(), customizations, options, repos, packageSetSpecs, rng)
|
||||||
|
}
|
||||||
|
|
||||||
func tarArchivePipeline(name, inputPipelineName string, tarOptions *osbuild.TarStageOptions) *osbuild.Pipeline {
|
func tarArchivePipeline(name, inputPipelineName string, tarOptions *osbuild.TarStageOptions) *osbuild.Pipeline {
|
||||||
p := new(osbuild.Pipeline)
|
p := new(osbuild.Pipeline)
|
||||||
p.Name = name
|
p.Name = name
|
||||||
|
|
|
||||||
11651
test/data/manifests/rhel_85-x86_64-gce_rhui-boot.json
Normal file
11651
test/data/manifests/rhel_85-x86_64-gce_rhui-boot.json
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -126,6 +126,7 @@
|
||||||
"ec2",
|
"ec2",
|
||||||
"ec2-ha",
|
"ec2-ha",
|
||||||
"gce",
|
"gce",
|
||||||
|
"gce-rhui",
|
||||||
"openstack",
|
"openstack",
|
||||||
"tar",
|
"tar",
|
||||||
"qcow2",
|
"qcow2",
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue