Documentation
¶
Overview ¶
Package upgrade provides the Arcane CLI command that upgrades a running Arcane container by recreating it with a newer image.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var UpgradeCmd = &cobra.Command{
Use: "upgrade",
Short: "Upgrade an Arcane container to the latest version",
Long: `Upgrade an Arcane container by pulling the latest image and recreating the container.
This command should be run from outside the container (e.g., from the host or another container).`,
Example: ` # Auto-detect and upgrade the Arcane container
arcane upgrade --auto
# Upgrade a specific container
arcane upgrade --container arcane
# Upgrade to a specific image tag
arcane upgrade --container arcane --image ghcr.io/getarcaneapp/arcane:v1.2.3`,
RunE: runUpgrade,
}
UpgradeCmd recreates a running Arcane container with a newer image while preserving its configuration.
Functions ¶
func UpgradeContainer ¶ added in v2.9.0
func UpgradeContainer(ctx context.Context, dockerClient *client.Client, oldContainer container.InspectResponse, newImage, expectedImageID string, environment map[string]string) error
UpgradeContainer recreates an Arcane container with the supplied image and optional expected image ID and environment replacements. It runs from detached maintenance containers so stopping the target cannot interrupt the operation.
Types ¶
type LogWriter ¶ added in v2.6.0
type LogWriter struct {
// contains filtered or unexported fields
}
LogWriter accumulates the upgrade log in memory and rewrites the whole file through atomic.WriteFile on every entry. The upgrade recreates the container it is reporting on, so a run can be cut short at any point -- rewriting atomically per entry means the file on disk is always a complete, untorn log up to the last entry emitted, with no partial line ever visible to whoever reads it afterwards.
func SetupMessageOnlyLogFile ¶ added in v2.6.0
SetupMessageOnlyLogFile writes normal slog output to stdout and message-only output to a timestamped file under dataDir. Every entry is persisted as it is logged, so the returned writer needs no closing -- it is returned so the caller can report where the log landed.