libarcane

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: 17 Imported by: 0

Documentation

Overview

Package libarcane contains shared compatibility helpers, setting utilities, and internal resource metadata used across Arcane's backend and CLI.

Index

Constants

View Source
const DepotTokenSettingKey = "depotToken"
View Source
const (
	InternalResourceLabel = "com.getarcaneapp.internal.resource"
)

Internal containers indicate containers used for arcanes utilties, ie: temp containers used for viewing files for volumes etc

View Source
const NetworkScopedMacAddressMinAPIVersion = "1.44"

Variables

This section is empty.

Functions

func ContainerInspectWithCompatibility added in v1.16.2

func ContainerInspectWithCompatibility(ctx context.Context, apiClient client.APIClient, containerID string, options client.ContainerInspectOptions) (client.ContainerInspectResult, error)

ContainerInspectWithCompatibility retries inspect decoding against raw daemon JSON when the primary typed decode fails on a ParseAddr-style CIDR issue.

func DetectDockerAPIVersion

func DetectDockerAPIVersion(ctx context.Context, dockerClient *client.Client) string

DetectDockerAPIVersion returns the configured client API version when available, and falls back to the daemon-reported version only when the client version is not yet set.

func IsCronSettingKey added in v1.16.0

func IsCronSettingKey(key string) bool

func IsDockerAPIVersionAtLeast

func IsDockerAPIVersionAtLeast(current, minimum string) bool

IsDockerAPIVersionAtLeast performs numeric dot-segment comparison for Docker API versions (e.g. "1.43", "1.44.1"). Returns false when either version cannot be parsed.

func IsInternalContainer

func IsInternalContainer(labels map[string]string) bool

func IsTimeoutSettingKey added in v1.16.0

func IsTimeoutSettingKey(key string) bool

func NetworkInspectWithCompatibility added in v1.16.2

func NetworkInspectWithCompatibility(ctx context.Context, apiClient client.APIClient, networkID string, options client.NetworkInspectOptions) (client.NetworkInspectResult, error)

NetworkInspectWithCompatibility retries inspect decoding against raw daemon JSON when the primary typed decode fails on a ParseAddr-style CIDR issue.

func SanitizeContainerCreateEndpointSettingsForDockerAPI

func SanitizeContainerCreateEndpointSettingsForDockerAPI(endpoints map[string]*network.EndpointSettings, apiVersion string) map[string]*network.EndpointSettings

SanitizeContainerCreateEndpointSettingsForDockerAPI clones endpoint settings for container recreate and removes per-network mac-address when daemon API does not support it (API < 1.44).

func SupportsDockerCreatePerNetworkMACAddress

func SupportsDockerCreatePerNetworkMACAddress(apiVersion string) bool

SupportsDockerCreatePerNetworkMACAddress reports whether the daemon API supports per-network mac-address on container create (Docker API >= 1.44).

func ValidateCronSetting added in v1.16.0

func ValidateCronSetting(key, value string) error

func WrapDockerAPIClientForInspectCompatibility added in v1.16.2

func WrapDockerAPIClientForInspectCompatibility(apiClient client.APIClient) client.APIClient

WrapDockerAPIClientForInspectCompatibility wraps a Docker API client so inspect calls can recover from daemon responses that encode address fields with CIDR suffixes that newer typed Moby structs reject.

Types

type EngineCompatibilityInfo added in v1.16.2

type EngineCompatibilityInfo struct {
	// Name is the normalized engine identifier, such as "docker" or "podman".
	Name string
	// CgroupVersion is the daemon-reported cgroup version, such as "1" or "2".
	CgroupVersion string
}

EngineCompatibilityInfo describes the container engine details Arcane uses to decide whether recreate-time HostConfig sanitization is required.

func PrepareRecreateHostConfigForEngine added in v1.16.2

func PrepareRecreateHostConfigForEngine(ctx context.Context, dockerClient *client.Client, hostConfig *containertypes.HostConfig) (*containertypes.HostConfig, bool, EngineCompatibilityInfo, error)

PrepareRecreateHostConfigForEngine clones hostConfig and removes recreate options that are known to be incompatible with the connected engine.

The returned HostConfig is a shallow copy, so field reassignment is isolated from the caller's original value, but content-level mutation of shared slice or map fields is not. The boolean result reports whether the helper removed any incompatible fields. EngineCompatibilityInfo reports the daemon details used to make that decision.

type SettingUpdate added in v1.16.0

type SettingUpdate struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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