Skip to content

Commit

Permalink
Modify cabbie to explicitly not search for hidden updates during defa…
Browse files Browse the repository at this point in the history
…ult and aukera update timers.

PiperOrigin-RevId: 600885286
  • Loading branch information
Cabbie Team authored and copybara-github committed Jan 23, 2024
1 parent df91cb2 commit d3a62e9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
6 changes: 3 additions & 3 deletions cabbie.go
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ func runMainLoop() error {
for {
select {
case <-t.Default.C:
i := installCmd{Interactive: false, visibleUpdates: true}
i := installCmd{Interactive: false}
err := i.installUpdates()
if e := updateInstallSuccess.Set(err == nil); e != nil {
deck.ErrorfA("Error posting metric:\n%v", e).With(eventID(cablib.EvtErrMetricReport)).Go()
Expand All @@ -385,7 +385,7 @@ func runMainLoop() error {
break
}
if s[0].State == "open" {
i := installCmd{Interactive: false, visibleUpdates: true}
i := installCmd{Interactive: false}
err := i.installUpdates()
if e := updateInstallSuccess.Set(err == nil); e != nil {
deck.ErrorfA("Error posting updateInstallSuccess metric:\n%v", e).With(eventID(cablib.EvtErrMetricReport)).Go()
Expand Down Expand Up @@ -427,7 +427,7 @@ func runMainLoop() error {
}

if config.Deadline != 0 {
i := installCmd{Interactive: false, deadlineOnly: true, visibleUpdates: true}
i := installCmd{Interactive: false, deadlineOnly: true}
if err := i.installUpdates(); err != nil {
deck.ErrorfA("Error installing system updates:\n%v", err).With(eventID(cablib.EvtErrInstallFailure)).Go()
}
Expand Down
9 changes: 3 additions & 6 deletions install.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ import (

// Available flags
type installCmd struct {
all, drivers, deadlineOnly, Interactive, virusDef, visibleUpdates bool
kbs string
all, drivers, deadlineOnly, Interactive, virusDef bool
kbs string
}

type installRsp struct {
Expand Down Expand Up @@ -122,13 +122,10 @@ func (i *installCmd) criteria() (string, []string) {
case i.kbs != "":
c = search.BasicSearch
deck.InfofA("Starting search for KB's %q:\n%s", i.kbs, c).With(eventID(cablib.EvtSearch)).Go()
case i.visibleUpdates:
c = search.BasicSearch + " and IsHidden=0"
deck.InfofA("Starting search for updates which aren't hidden: %s", c).With(eventID(cablib.EvtSearch)).Go()
default:
c = search.BasicSearch
rc = config.RequiredCategories
deck.InfofA("Starting search for all general updates: %s", c).With(eventID(cablib.EvtSearch)).Go()
deck.InfofA("Starting search for general updates: %s", c).With(eventID(cablib.EvtSearch)).Go()
}
return c, rc
}
Expand Down

0 comments on commit d3a62e9

Please sign in to comment.