osbuild-worker: Recreate rpmmd for each depsolve
The remote workers are long-running, and the subscription certificates might expire. Before each depsolve refresh the subscriptions.
This commit is contained in:
parent
14b29ae98a
commit
c6c311cc3d
2 changed files with 5 additions and 4 deletions
|
|
@ -8,13 +8,15 @@ import (
|
|||
)
|
||||
|
||||
type DepsolveJobImpl struct {
|
||||
RPMMD rpmmd.RPMMD
|
||||
RPMMDCache string
|
||||
}
|
||||
|
||||
func (impl *DepsolveJobImpl) depsolve(packageSets map[string]rpmmd.PackageSet, repos []rpmmd.RepoConfig, modulePlatformID, arch, releasever string) (map[string][]rpmmd.PackageSpec, error) {
|
||||
rpmMD := rpmmd.NewRPMMD(impl.RPMMDCache, "/usr/libexec/osbuild-composer/dnf-json")
|
||||
|
||||
packageSpecs := make(map[string][]rpmmd.PackageSpec)
|
||||
for name, packageSet := range packageSets {
|
||||
packageSpec, _, err := impl.RPMMD.Depsolve(packageSet, repos, modulePlatformID, arch, releasever)
|
||||
packageSpec, _, err := rpmMD.Depsolve(packageSet, repos, modulePlatformID, arch, releasever)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ import (
|
|||
"github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/osbuild/osbuild-composer/internal/common"
|
||||
"github.com/osbuild/osbuild-composer/internal/rpmmd"
|
||||
"github.com/osbuild/osbuild-composer/internal/upload/azure"
|
||||
"github.com/osbuild/osbuild-composer/internal/upload/koji"
|
||||
"github.com/osbuild/osbuild-composer/internal/worker"
|
||||
|
|
@ -287,7 +286,7 @@ func main() {
|
|||
go func() {
|
||||
jobImpls := map[string]JobImplementation{
|
||||
"depsolve": &DepsolveJobImpl{
|
||||
RPMMD: rpmmd.NewRPMMD(rpmmd_cache, "/usr/libexec/osbuild-composer/dnf-json"),
|
||||
RPMMDCache: rpmmd_cache,
|
||||
},
|
||||
}
|
||||
acceptedJobTypes := []string{}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue