defaults

package
v0.10.0-rc11 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BridgeInterfaceIP

func BridgeInterfaceIP(name string) (string, error)

BridgeInterfaceIP returns the IPv4 address of a named network interface.

func CopyInfrastructure

func CopyInfrastructure(cfg *config.Config, backendName, stackID string) error

CopyInfrastructure renders the embedded infrastructure defaults for the current stack and records the stamp that produced the copied tree.

func DetectedBackendName

func DetectedBackendName(cfg *config.Config) string

DetectedBackendName reads the persisted backend choice, defaulting to k3d for legacy stacks that predate .stack-backend.

func DevImageTag added in v0.10.0

func DevImageTag() string

DevImageTag returns the tag used for locally-built dev images under OBOL_DEVELOPMENT. It is `dev-<short-git-sha>` of the working tree, so each branch/worktree builds a distinct tag and parallel dev stacks sharing one Docker daemon never clobber each other's images (the `:latest` collision that let a sibling worktree's build poison an unrelated stack). Committing changes the SHA and triggers a fresh build; uncommitted changes reuse the committed tag unless OBOL_FORCE_REBUILD_LOCAL_DEV_IMAGES is set. Falls back to `latest` when the source is not a git checkout (e.g. a tarball build), preserving the previous behaviour there.

func DockerBridgeGatewayIP

func DockerBridgeGatewayIP() (string, error)

DockerBridgeGatewayIP returns the IPv4 address of an active Docker bridge interface.

func DockerDesktopGatewayIP

func DockerDesktopGatewayIP() string

DockerDesktopGatewayIP returns the Docker Desktop VM gateway IP.

This is a hardcoded magic value valid only for Docker Desktop on macOS. Colima and Rancher Desktop use different bridge IPs (e.g. 192.168.5.2 for Colima's default profile), so prefer ResolveHostGatewayViaDocker which works across all macOS Docker runtimes.

func InfrastructureReplacements

func InfrastructureReplacements(backendName, stackID string) (map[string]string, error)

InfrastructureReplacements returns the placeholder values used when copying embedded infrastructure defaults.

func OllamaHostForBackend

func OllamaHostForBackend(backendName string) string

OllamaHostForBackend returns the hostname/IP that reaches the host Ollama instance from inside the cluster.

func OllamaHostIPForBackend

func OllamaHostIPForBackend(backendName string) (string, error)

OllamaHostIPForBackend resolves the Ollama host to an IP address. ClusterIP+Endpoints requires an IP, not a hostname.

Resolution order on darwin+k3d:

  1. Resolve host.docker.internal from inside a transient Docker container (works for Docker Desktop, Colima, Rancher Desktop — each exposes a different host gateway IP, but all expose host.docker.internal inside containers).
  2. Fall back to the Docker Desktop magic gateway IP (192.168.65.254) so Docker Desktop users without a working `docker` CLI still work.

func ReadDevImageTag added in v0.10.0

func ReadDevImageTag(cfg *config.Config) string

ReadDevImageTag returns the dev image tag persisted at CopyInfrastructure time, or "latest" if none was recorded (non-dev install, or pre-dates this mechanism). internal/stack uses it to tag the images it builds.

func RefreshInfrastructureIfChanged

func RefreshInfrastructureIfChanged(cfg *config.Config, backendName, stackID string) (bool, error)

RefreshInfrastructureIfChanged refreshes the generated defaults tree when the embedded infrastructure assets, backend, or stack ID changed.

func ResolveHostGatewayViaDocker added in v0.10.0

func ResolveHostGatewayViaDocker() (string, error)

ResolveHostGatewayViaDocker asks the local Docker daemon to resolve the host gateway by running a tiny container that prints the IP of host.docker.internal. This works on Docker Desktop, Colima, and Rancher Desktop because all three expose host.docker.internal inside containers and map it to whatever bridge gateway their VM is using.

Falls back to --add-host=host.docker.internal:host-gateway when the bare hostname is not pre-populated by the runtime.

func StackID

func StackID(cfg *config.Config) string

StackID reads the persisted stack ID.

Types

This section is empty.

Jump to

Keyboard shortcuts

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