cloudapi: Make sigmd5 in PackageMetadata optional

In order to reuse PackageMetadata with DepsolveResponse and not include
unused fields this changes the sigmd5 entry to an optional field. This
doesn't effect the use of PackageMetadata in the Compose response since
it is always set, and it allows it to be omitted in the response for
depsolving.

Also adds a basic test for stagesToPackageMetadata

Related: RHEL-60125
This commit is contained in:
Brian C. Lane 2024-09-18 11:23:02 -07:00 committed by Brian C. Lane
parent 08dc5f3041
commit 4f3c93ef1e
4 changed files with 188 additions and 70 deletions

View file

@ -674,7 +674,7 @@ func stagesToPackageMetadata(stages []osbuild.RPMStageMetadata) []PackageMetadat
Release: rpm.Release,
Epoch: rpm.Epoch,
Arch: rpm.Arch,
Sigmd5: rpm.SigMD5,
Sigmd5: common.ToPtr(rpm.SigMD5),
Signature: osbuild.RPMPackageMetadataToSignature(rpm),
},
)