Move the `kernelVerStr()` function duplicated in many distro definitions to the `rpmmd` package as `GetVerStrFromPackageSpecListPanic()`. I could not come up with a better name, sorry. This will prevent creating another copy of the code in rhel-84 for the `gce` image. This change initially exposed a bug in the original implementation of `kernelVerStr()`. Since on the first line, we allocate an empty structure into `kernelPkg` variable, it can never be `nil` and the function never panicked even if there was no `kernel` package in the PackageSpec list. Fix all unit tests to provide valid arguments when calling `Manifest()` method of image types. Signed-off-by: Tomas Hozza <thozza@redhat.com> kernelVerStr fixup Signed-off-by: Tomas Hozza <thozza@redhat.com> |
||
|---|---|---|
| .. | ||
| test | ||
| metadata.go | ||
| metadata_test.go | ||
| repository.go | ||