arcaneupdater

package
v1.16.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 13, 2026 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Core labels
	LabelArcane  = "com.getarcaneapp.arcane"         // Identifies the Arcane container itself
	LabelUpdater = "com.getarcaneapp.arcane.updater" // Enable/disable updates (true/false)

	// Dependency labels
	LabelDependsOn  = "com.getarcaneapp.arcane.depends-on"  // Comma-separated list of container names this depends on
	LabelStopSignal = "com.getarcaneapp.arcane.stop-signal" // Custom stop signal (e.g., SIGINT)
)

Variables

This section is empty.

Functions

func ExtractContainerName

func ExtractContainerName(cnt container.Summary) string

ExtractContainerName extracts a clean container name from the summary

func GetStopSignal

func GetStopSignal(labels map[string]string) string

GetStopSignal returns the custom stop signal if set, otherwise empty string

func IsArcaneContainer

func IsArcaneContainer(labels map[string]string) bool

IsArcaneContainer checks if the container is the Arcane application itself

func IsUpdateDisabled

func IsUpdateDisabled(labels map[string]string) bool

IsUpdateDisabled returns true if the special label is present and evaluates to false. Accepts false/0/no/off (case-insensitive) as "disabled". Default is enabled.

func SetupMessageOnlyLogFile

func SetupMessageOnlyLogFile(dataDir string, filePrefix string, minLevel slog.Level) (*os.File, error)

SetupMessageOnlyLogFile configures slog to write structured logs to stdout and a message-only format to a file under dataDir.

The file format is: <msg> key=value key=value ... (no time/level/source) to keep upgrade logs concise for end users.

func UpdateImplicitRestart

func UpdateImplicitRestart(containers []ContainerWithDeps, markedForRestart map[string]bool) []string

UpdateImplicitRestart marks containers that need to restart because their dependencies are restarting. Returns the names of containers that were marked for implicit restart. Note: This function mutates the containers slice by adding "_arcane_implicit_restart" labels.

Types

type CheckResult

type CheckResult struct {
	NeedsUpdate   bool
	LocalDigest   string
	RemoteDigest  string
	Error         error
	CheckedViaAPI bool // True if we checked via registry API, false if we had to pull
}

CheckResult contains the result of a digest check

type ContainerSorter

type ContainerSorter struct {
	// contains filtered or unexported fields
}

ContainerSorter handles topological sorting of containers based on dependencies

func NewContainerSorter

func NewContainerSorter(containers []ContainerWithDeps) *ContainerSorter

NewContainerSorter creates a new sorter for the given containers

func (*ContainerSorter) Sort

func (s *ContainerSorter) Sort() ([]ContainerWithDeps, error)

Sort performs topological sort and returns containers in dependency order Dependencies come first, dependents come later

func (*ContainerSorter) SortReverse

func (s *ContainerSorter) SortReverse() ([]ContainerWithDeps, error)

SortReverse returns containers in reverse dependency order Dependents come first, dependencies come later (for stopping)

type ContainerWithDeps

type ContainerWithDeps struct {
	Container   container.Summary
	Inspect     container.InspectResponse
	Name        string
	Links       []string // Container names this one links to
	DependsOn   []string // Explicit dependencies from label
	NetworkDeps []string // Implicit dependencies from container network mode
}

ContainerWithDeps represents a container with its dependency information for sorting

func ExtractContainerDeps

func ExtractContainerDeps(ctx context.Context, dcli *client.Client, cnt container.Summary, inspect container.InspectResponse) ContainerWithDeps

ExtractContainerDeps extracts dependency information from a container

type DigestChecker

type DigestChecker struct {
	// contains filtered or unexported fields
}

DigestChecker provides methods to check if an image needs updating by comparing digests

func NewDigestChecker

func NewDigestChecker(dcli *client.Client, digestResolver remoteDigestResolver) *DigestChecker

NewDigestChecker creates a new DigestChecker

func (*DigestChecker) CheckImageNeedsUpdate

func (c *DigestChecker) CheckImageNeedsUpdate(ctx context.Context, imageRef string) CheckResult

CheckImageNeedsUpdate checks if an image has a newer version available without pulling Returns true if the remote digest differs from the local digest

func (*DigestChecker) CompareWithPulled

func (c *DigestChecker) CompareWithPulled(ctx context.Context, containerImageID string, newImageRef string) (bool, error)

CompareWithPulled compares the current container's image with a freshly pulled image This is the fallback when HEAD request doesn't work

func (*DigestChecker) GetImageIDsForRef

func (c *DigestChecker) GetImageIDsForRef(ctx context.Context, ref string) ([]string, error)

GetImageIDsForRef returns the image IDs associated with a reference

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL