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

     1  package oracle
     2  
     3  import (
     4  	"context"
     5  	"fmt"
     6  	"time"
     7  
     8  	"github.com/quay/claircore/libvuln/driver"
     9  )
    10  
    11  func UpdaterSet(_ context.Context) (driver.UpdaterSet, error) {
    12  	us := driver.NewUpdaterSet()
    13  	for year, lim := 2007, time.Now().Year(); year != lim; year++ {
    14  		u, err := NewUpdater(year)
    15  		if err != nil {
    16  			return us, fmt.Errorf("unable to create oracle updater: %v", err)
    17  		}
    18  		err = us.Add(u)
    19  		if err != nil {
    20  			return us, err
    21  		}
    22  	}
    23  	return us, nil
    24  }