Skip to content

Commit

Permalink
clair: use new cmd.LoadConfig
Browse files Browse the repository at this point in the history
Signed-off-by: Hank Donnay <hdonnay@redhat.com>
  • Loading branch information
hdonnay committed Jun 15, 2023
1 parent 06f5bc0 commit 5226d2a
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions cmd/clair/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
_ "github.com/quay/claircore/updater/defaults"
"github.com/quay/zlog"
"golang.org/x/sync/errgroup"
yaml "gopkg.in/yaml.v3"

"github.com/quay/clair/v4/cmd"
"github.com/quay/clair/v4/health"
Expand Down Expand Up @@ -55,13 +54,8 @@ func main() {
}
switch f.Name {
case "conf":
cf, err := os.Open(fv)
if err != nil {
golog.Fatalf("failed to open config file: %v", err)
}
defer cf.Close()
if err := yaml.NewDecoder(cf).Decode(&conf); err != nil {
golog.Fatalf("failed to decode yaml config: %v", err)
if err := cmd.LoadConfig(&conf, fv, true); err != nil {
golog.Fatalf("failed loading config: %v", err)
}
case "mode":
if fv == "" {
Expand Down

0 comments on commit 5226d2a

Please sign in to comment.