mirror of
https://github.com/profullstack/agentbbs.git
synced 2026-12-01 09:24:46 +00:00
fix(pods): heal pods by image ID, not tag, so rebuilt images roll out
setup.sh rebuilds the pod image under the same tag (localhost/agentbbs-pod:latest). hasImage compared only the tag, so every existing pod looked current and kept the old image forever: the "Use c0mpute network" launcher (#183) and any Claude Code or Codex updates never reached existing members. Now an idle pod whose image ID differs from the tag's current ID is recreated (home volume kept). Unknown IDs still never trigger a heal. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
82bc5ba4fc
commit
a7758bddb2
2 changed files with 47 additions and 5 deletions
|
|
@ -35,3 +35,21 @@ func TestPublicHTMLMountCreatesAndMaps(t *testing.T) {
|
|||
t.Fatalf("expected %q to be a created directory, err=%v", wantHost, err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestSameImage(t *testing.T) {
|
||||
cases := []struct {
|
||||
gotName, gotID, wantName, wantID string
|
||||
want bool
|
||||
}{
|
||||
{"localhost/agentbbs-pod:latest", "62a86171b60a", "localhost/agentbbs-pod:latest", "dc18f4df01f5", false}, // rebuilt under the same tag
|
||||
{"localhost/agentbbs-pod:latest", "dc18f4df01f5", "agentbbs-pod:latest", "sha256:dc18f4df01f5", true},
|
||||
{"docker.io/library/ubuntu:24.04", "abc", "localhost/agentbbs-pod:latest", "abc", false}, // different image
|
||||
{"localhost/agentbbs-pod:latest", "", "localhost/agentbbs-pod:latest", "dc18", true}, // unknown id: no heal
|
||||
{"localhost/agentbbs-pod:latest", "dc18", "localhost/agentbbs-pod:latest", "", true},
|
||||
}
|
||||
for _, c := range cases {
|
||||
if got := sameImage(c.gotName, c.gotID, c.wantName, c.wantID); got != c.want {
|
||||
t.Errorf("sameImage(%q,%q,%q,%q) = %v, want %v", c.gotName, c.gotID, c.wantName, c.wantID, got, c.want)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue