feat: flag Ubuntu phased updates and leave them out of pending counts
apt lists phased updates as upgradable, but an upgrade defers them until the host is selected. A simulated upgrade names them; they are reported with the phased flag (vantage-shared v0.6.0) and not counted in pending_after.
This commit is contained in:
@@ -120,12 +120,12 @@ func reportPendingUpdates(cfg *config.Config) int {
|
||||
}
|
||||
list := make([]pb.PackageUpdate, len(pkgs))
|
||||
for i, p := range pkgs {
|
||||
list[i] = pb.PackageUpdate{Name: p.Name, CurrentVersion: p.CurrentVersion, NewVersion: p.NewVersion}
|
||||
list[i] = pb.PackageUpdate{Name: p.Name, CurrentVersion: p.CurrentVersion, NewVersion: p.NewVersion, Phased: p.Phased}
|
||||
}
|
||||
client, err := grpcclient.New(cfg.ServerURL, cfg.TLS)
|
||||
if err != nil {
|
||||
log.Printf("post-apply report dial: %v", err)
|
||||
return len(pkgs)
|
||||
return updates.CountInstallable(pkgs)
|
||||
}
|
||||
defer client.Close()
|
||||
if err := client.ReportUpdates(cfg.ServerID, cfg.AgentToken, list); err != nil {
|
||||
|
||||
@@ -406,6 +406,7 @@ func runUpdateCheck(ctx context.Context, cfg *config.Config) {
|
||||
Name: p.Name,
|
||||
CurrentVersion: p.CurrentVersion,
|
||||
NewVersion: p.NewVersion,
|
||||
Phased: p.Phased,
|
||||
}
|
||||
}
|
||||
client, err := grpcclient.New(cfg.ServerURL, cfg.TLS)
|
||||
|
||||
Reference in New Issue
Block a user