Reload the guard for a changed table and restart it only for a changed unit, as the controller declares it (hq ADR 0103)

This commit is contained in:
2026-09-22 18:33:57 +02:00
parent b4f3eaf11b
commit 272e1a65ea
2 changed files with 8 additions and 2 deletions
+4 -1
View File
@@ -121,7 +121,10 @@ func TestAnAdoptedBundleLoadsNoDroppingTableAndExactlyTheGuard(t *testing.T) {
t.Error("nft, which loads the guard, is no longer installed")
}
unit := r.Declaration.Resources[at[guardRunningID]].(*declaration.Service)
if unit.Unit != guardUnit || unit.State != "running" || strings.Join(unit.RestartOn, ",") != guardID+","+guardUnitID {
// A changed table is reloaded, never restarted: a restart deletes the table before loading
// it again, leaving the ports unguarded in between.
if unit.Unit != guardUnit || unit.State != "running" || strings.Join(unit.RestartOn, ",") != guardUnitID ||
strings.Join(unit.ReloadOn, ",") != guardID {
t.Errorf("the guard's service: %+v", unit)
}
stop := r.Declaration.Resources[at[guardUnitID]].(*declaration.File).Content