Add support for RPM customizations

Add support for RPM customizations, which currently allow to import RPM
GPG key from a file installed in the image. This is e.g. done for the
Azure RHUI image type.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
This commit is contained in:
Tomáš Hozza 2024-08-07 17:41:00 +02:00 committed by Tomáš Hozza
parent 7d22c42ad7
commit 26dd54a4d7
14 changed files with 303 additions and 185 deletions

View file

@ -545,11 +545,18 @@ func TestBlueprintsCustomizationInfoToml(t *testing.T) {
"minsize": 2147483648
}
],
"openscap": {
"datastream": "/usr/share/xml/scap/ssg/content/ssg-rhel8-ds.xml",
"profile_id": "xccdf_org.ssgproject.content_profile_cis"
},
"partitioning_mode": "raw"
"openscap": {
"datastream": "/usr/share/xml/scap/ssg/content/ssg-rhel8-ds.xml",
"profile_id": "xccdf_org.ssgproject.content_profile_cis"
},
"partitioning_mode": "raw",
"rpm": {
"import_keys": {
"files": [
"/root/gpg-key"
]
}
}
}
}`
resp := test.SendHTTP(api, true, "POST", "/api/v0/blueprints/new", testBlueprint)
@ -645,6 +652,11 @@ func TestBlueprintsCustomizationInfoToml(t *testing.T) {
ProfileID: "xccdf_org.ssgproject.content_profile_cis",
},
PartitioningMode: "raw",
RPM: &blueprint.RPMCustomization{
ImportKeys: &blueprint.RPMImportKeys{
Files: []string{"/root/gpg-key"},
},
},
},
}