hub v0.137.0 source + burn-down round 2 in felhom.eu: R-277 R-581 R-600 R-544 R-855 R-134 R-92 R-292 R-599 R-725 R-728 (hub), R-819 R-857 R-555 R-364 R-587 (gates/tools), R-571 R-129 R-124-runbook (docs); 28 rows closed incl. catalog + agent v0.147.0 rows, R-350 merged into R-132, R-888 opened, R-887 mechanism (249 -> 222)
gates / gates (push) Successful in 2m3s
gates / gates (push) Successful in 2m3s
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
package osupdates
|
||||
|
||||
import "testing"
|
||||
|
||||
// R-855: the start log and the approval rule read the same effective count. The TEST override
|
||||
// OS_DOCKER_APPROVE_NIGHTS=0 is stored as -1 ("none") and must print 0, never -1; the zero value is
|
||||
// the default 2.
|
||||
func TestDockerNightsEffective(t *testing.T) {
|
||||
for _, tc := range []struct{ raw, want int }{{-1, 0}, {0, 2}, {3, 3}, {2, 2}} {
|
||||
s := &Service{DockerNights: tc.raw}
|
||||
if got := s.DockerNightsEffective(); got != tc.want {
|
||||
t.Errorf("DockerNights=%d → effective %d, want %d", tc.raw, got, tc.want)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -159,6 +159,19 @@ type ReleaseBlock struct {
|
||||
Packages []Package `json:"packages"`
|
||||
}
|
||||
|
||||
// DockerNightsEffective is the number of healthy ring-0 nights the Docker engine set actually needs: 0 means
|
||||
// the default 2, negative means none (a TEST override only). The start log prints THIS, not the raw field —
|
||||
// the raw "none" value read "after -1 healthy ring-0 night(s)" (R-855). Pinned by TestDockerNightsEffective.
|
||||
func (s *Service) DockerNightsEffective() int {
|
||||
switch {
|
||||
case s.DockerNights == 0:
|
||||
return 2
|
||||
case s.DockerNights < 0:
|
||||
return 0
|
||||
}
|
||||
return s.DockerNights
|
||||
}
|
||||
|
||||
// Service ties the store, the events and the clock together.
|
||||
type Service struct {
|
||||
Store *store.Store
|
||||
@@ -559,13 +572,7 @@ func (s *Service) DockerStatus() (Status, error) {
|
||||
st.Approved, st.Waiting = rel.ID, "already approved"
|
||||
return st, nil
|
||||
}
|
||||
need := s.DockerNights // 0 = the default 2; negative = none (a TEST override only, logged at start)
|
||||
switch {
|
||||
case need == 0:
|
||||
need = 2
|
||||
case need < 0:
|
||||
need = 0
|
||||
}
|
||||
need := s.DockerNightsEffective()
|
||||
for _, h := range ring0 {
|
||||
reps, err := s.Store.OSReportsSince(h, LayerDocker, first)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user