github.com/quay/claircore@v1.5.28/suse/updaterset.go (about)

     1  package suse
     2  
     3  import (
     4  	"context"
     5  	"fmt"
     6  
     7  	"github.com/quay/claircore/libvuln/driver"
     8  )
     9  
    10  var suseReleases = []Release{
    11  	EnterpriseServer15,
    12  	EnterpriseServer12,
    13  	EnterpriseServer11,
    14  	Leap150,
    15  	Leap151,
    16  }
    17  
    18  func UpdaterSet(_ context.Context) (driver.UpdaterSet, error) {
    19  	us := driver.NewUpdaterSet()
    20  	for _, release := range suseReleases {
    21  		u, err := NewUpdater(release)
    22  		if err != nil {
    23  			return us, fmt.Errorf("failed to create updater: %v", err)
    24  		}
    25  		err = us.Add(u)
    26  		if err != nil {
    27  			return us, err
    28  		}
    29  	}
    30  	return us, nil
    31  }