RHEL-84: 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
795294d98f
commit
e7f6b95032
6 changed files with 22642 additions and 3 deletions
|
|
@ -1576,6 +1576,23 @@ func newDistro(name, modulePlatformID, ostreeRef string, isCentos bool) distro.D
|
||||||
partitionTableGenerator: defaultPartitionTable,
|
partitionTableGenerator: defaultPartitionTable,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gceRhuiImgType := imageTypeS2{
|
||||||
|
name: "gce-rhui",
|
||||||
|
filename: "image.tar.gz",
|
||||||
|
mimeType: "application/gzip",
|
||||||
|
packageSets: map[string]rpmmd.PackageSet{
|
||||||
|
"packages": getGceRhuiPackageSet(),
|
||||||
|
},
|
||||||
|
kernelOptions: "net.ifnames=0 biosdevname=0 scsi_mod.use_blk_mq=Y crashkernel=auto console=ttyS0,38400n8d",
|
||||||
|
bootable: true,
|
||||||
|
defaultSize: 20 * GigaByte,
|
||||||
|
pipelines: gceRhuiPipelines,
|
||||||
|
buildPipelines: []string{"build"},
|
||||||
|
payloadPipelines: []string{"os", "image", "archive"},
|
||||||
|
exports: []string{"archive"},
|
||||||
|
partitionTableGenerator: defaultPartitionTable,
|
||||||
|
}
|
||||||
|
|
||||||
x8664.addImageTypes(
|
x8664.addImageTypes(
|
||||||
amiImgType,
|
amiImgType,
|
||||||
qcow2ImageType,
|
qcow2ImageType,
|
||||||
|
|
@ -1585,7 +1602,7 @@ func newDistro(name, modulePlatformID, ostreeRef string, isCentos bool) distro.D
|
||||||
vmdkImgType,
|
vmdkImgType,
|
||||||
)
|
)
|
||||||
|
|
||||||
x8664.addS2ImageTypes(gceImgType)
|
x8664.addS2ImageTypes(gceImgType, gceRhuiImgType)
|
||||||
|
|
||||||
if !isCentos {
|
if !isCentos {
|
||||||
x8664.addImageTypes(edgeImgTypeX86_64)
|
x8664.addImageTypes(edgeImgTypeX86_64)
|
||||||
|
|
|
||||||
|
|
@ -82,6 +82,12 @@ func TestFilenameFromType(t *testing.T) {
|
||||||
want: "image.tar.gz",
|
want: "image.tar.gz",
|
||||||
want1: "application/gzip",
|
want1: "application/gzip",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "gce-rhui",
|
||||||
|
args: args{"gce-rhui"},
|
||||||
|
want: "image.tar.gz",
|
||||||
|
want1: "application/gzip",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "invalid-output-type",
|
name: "invalid-output-type",
|
||||||
args: args{"foobar"},
|
args: args{"foobar"},
|
||||||
|
|
@ -475,6 +481,7 @@ func TestArchitecture_ListImageTypes(t *testing.T) {
|
||||||
"vhd",
|
"vhd",
|
||||||
"vmdk",
|
"vmdk",
|
||||||
"gce",
|
"gce",
|
||||||
|
"gce-rhui",
|
||||||
},
|
},
|
||||||
rhelAdditionalImageTypes: []string{"rhel-edge-commit", "rhel-edge-container", "rhel-edge-installer"},
|
rhelAdditionalImageTypes: []string{"rhel-edge-commit", "rhel-edge-container", "rhel-edge-installer"},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -88,6 +88,15 @@ func getGcePackageSet() rpmmd.PackageSet {
|
||||||
return getGceCommonPackageSet()
|
return getGceCommonPackageSet()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GCE RHUI image
|
||||||
|
func getGceRhuiPackageSet() rpmmd.PackageSet {
|
||||||
|
return rpmmd.PackageSet{
|
||||||
|
Include: []string{
|
||||||
|
"google-rhui-client-rhel8",
|
||||||
|
},
|
||||||
|
}.Append(getGceCommonPackageSet())
|
||||||
|
}
|
||||||
|
|
||||||
// gcePipelinesRhel86 is a slightly modified RHEL-86 version of gcePipelines() function
|
// gcePipelinesRhel86 is a slightly modified RHEL-86 version of gcePipelines() function
|
||||||
func gcePipelinesRhel86(t *imageTypeS2, imageConfig *distro.ImageConfig, customizations *blueprint.Customizations, options distro.ImageOptions, repos []rpmmd.RepoConfig, packageSetSpecs map[string][]rpmmd.PackageSpec, rng *rand.Rand) ([]osbuild.Pipeline, error) {
|
func gcePipelinesRhel86(t *imageTypeS2, imageConfig *distro.ImageConfig, customizations *blueprint.Customizations, options distro.ImageOptions, repos []rpmmd.RepoConfig, packageSetSpecs map[string][]rpmmd.PackageSpec, rng *rand.Rand) ([]osbuild.Pipeline, error) {
|
||||||
pipelines := make([]osbuild.Pipeline, 0)
|
pipelines := make([]osbuild.Pipeline, 0)
|
||||||
|
|
@ -252,3 +261,36 @@ func getDefaultGceByosImageConfig() *distro.ImageConfig {
|
||||||
func gceByosPipelines(t *imageTypeS2, customizations *blueprint.Customizations, options distro.ImageOptions, repos []rpmmd.RepoConfig, packageSetSpecs map[string][]rpmmd.PackageSpec, rng *rand.Rand) ([]osbuild.Pipeline, error) {
|
func gceByosPipelines(t *imageTypeS2, customizations *blueprint.Customizations, options distro.ImageOptions, repos []rpmmd.RepoConfig, packageSetSpecs map[string][]rpmmd.PackageSpec, rng *rand.Rand) ([]osbuild.Pipeline, error) {
|
||||||
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 *imageTypeS2, 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)
|
||||||
|
}
|
||||||
|
|
|
||||||
22572
test/data/manifests/rhel_84-x86_64-gce_rhui-boot.json
Normal file
22572
test/data/manifests/rhel_84-x86_64-gce_rhui-boot.json
Normal file
File diff suppressed because one or more lines are too long
|
|
@ -96,6 +96,7 @@
|
||||||
"x86_64": [
|
"x86_64": [
|
||||||
"ami",
|
"ami",
|
||||||
"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