v0.345.1: SECURITY — cloudflared 2026.10.3 (Cloudflare's eMudhra notice, 2026-10-20)
gates / gates (push) Successful in 54s
gates / gates (push) Successful in 54s
Built from v0.345.0 (6bfb784) + this commit only. infra.CloudflaredImage 2026.9.3 -> 2026.10.3;
TestEnsureCloudflared_ANewImageRecreatesTheTunnel pins that an image-only change recreates the
running tunnel (red-proved). MinAgent 0.158.1 unchanged.
This commit is contained in:
@@ -326,3 +326,33 @@ func TestEnsureForwardedHeaders_R1033_RewritesAnOldFile(t *testing.T) {
|
||||
t.Fatal("the rewritten file must carry the https-only redirect")
|
||||
}
|
||||
}
|
||||
|
||||
// A controller update that changes only cloudflared's IMAGE recreates the running container on the new image (the
|
||||
// 2026.10.3 security bump rides this: no other step moves a household's tunnel). The control: the same render again
|
||||
// is a no-op.
|
||||
func TestEnsureCloudflared_ANewImageRecreatesTheTunnel(t *testing.T) {
|
||||
state := stubDocker(t)
|
||||
touch(t, filepath.Join(state, "running-cloudflared"), "")
|
||||
m, calls := tunnelTestManager(t, "")
|
||||
dir := t.TempDir()
|
||||
cur, _ := infra.RenderCloudflared(infra.CloudflaredData{CFTunnelToken: "tok-test", Tunnel: true})
|
||||
old := strings.Replace(cur["docker-compose.yml"].Content, "image: "+infra.CloudflaredImage, "image: cloudflare/cloudflared:2026.9.3", 1)
|
||||
if old == cur["docker-compose.yml"].Content {
|
||||
t.Fatal("the render has no `image:` line to age — the test would prove nothing")
|
||||
}
|
||||
touch(t, filepath.Join(dir, "docker-compose.yml"), old)
|
||||
|
||||
if err := m.ensureCloudflared(dir, true); err != nil {
|
||||
t.Fatalf("ensureCloudflared: %v", err)
|
||||
}
|
||||
cmp, _ := os.ReadFile(filepath.Join(dir, "docker-compose.yml"))
|
||||
if !strings.Contains(string(cmp), "image: "+infra.CloudflaredImage) {
|
||||
t.Fatalf("the compose must carry %s:\n%s", infra.CloudflaredImage, cmp)
|
||||
}
|
||||
if len(*calls) != 1 || (*calls)[0].args != "up -d" {
|
||||
t.Fatalf("want one `up -d` (compose recreates on the new image), got %+v", *calls)
|
||||
}
|
||||
if err := m.ensureCloudflared(dir, true); err != nil || len(*calls) != 1 {
|
||||
t.Fatalf("an unchanged image must not recreate the tunnel again; err %v calls %+v", err, *calls)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user