The ihasmail default was a pin that went stale within days, and ihasmail keeps ten releases' images, so an old default would in time stop pulling. With no --ihasmail-image the tool now pulls :latest before asking, reads the version the image carries, confirms the dated tag is the same image, and writes that tag into compose.yaml (or the digest, if there is no such tag). Stalwart and Caddy stay pinned. A weekly end-to-end run against the newest release, three hours after ihasmail publishes, is what keeps it safe.
22 lines
620 B
Go
22 lines
620 B
Go
// SPDX-FileCopyrightText: 2026 Coffey Labs
|
|
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
package docker
|
|
|
|
import "testing"
|
|
|
|
func TestEnvValue(t *testing.T) {
|
|
env := "PATH=/usr/local/bin:/usr/bin\nNODE_ENV=production\nIHASMAIL_VERSION=2026.9.13+pr344\nEMPTY=\n"
|
|
for name, want := range map[string]string{
|
|
"IHASMAIL_VERSION": "2026.9.13+pr344",
|
|
"NODE_ENV": "production",
|
|
"EMPTY": "",
|
|
"MISSING": "",
|
|
"IHASMAIL": "", // a prefix of a name is not the name
|
|
} {
|
|
if got := envValue(env, name); got != want {
|
|
t.Errorf("envValue(%q) = %q, want %q", name, got, want)
|
|
}
|
|
}
|
|
}
|