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

@ -135,6 +135,13 @@ func GetTestBlueprint() blueprint.Blueprint {
Unattended: true,
SudoNopasswd: []string{`%wheel`},
},
RPM: &blueprint.RPMCustomization{
ImportKeys: &blueprint.RPMImportKeys{
Files: []string{
"/root/gpg-key",
},
},
},
}
return expected
@ -259,6 +266,13 @@ func TestGetBlueprintFromCustomizations(t *testing.T) {
Unattended: common.ToPtr(true),
SudoNopasswd: &[]string{`%wheel`},
},
Rpm: &RPMCustomization{
ImportKeys: &ImportKeys{
Files: &[]string{
"/root/gpg-key",
},
},
},
}}
bp, err = cr.GetBlueprintFromCustomizations()
@ -406,6 +420,13 @@ func TestGetBlueprintFromCompose(t *testing.T) {
Unattended: common.ToPtr(true),
SudoNopasswd: &[]string{`%wheel`},
},
Rpm: &RPMCustomization{
ImportKeys: &ImportKeys{
Files: &[]string{
"/root/gpg-key",
},
},
},
},
}}