Documentation
¶
Index ¶
- func BridgeInterfaceIP(name string) (string, error)
- func CopyInfrastructure(cfg *config.Config, backendName, stackID string) error
- func DetectedBackendName(cfg *config.Config) string
- func DevImageTag() string
- func DockerBridgeGatewayIP() (string, error)
- func DockerDesktopGatewayIP() string
- func InfrastructureReplacements(backendName, stackID string) (map[string]string, error)
- func OllamaHostForBackend(backendName string) string
- func OllamaHostIPForBackend(backendName string) (string, error)
- func ReadDevImageTag(cfg *config.Config) string
- func RefreshInfrastructureIfChanged(cfg *config.Config, backendName, stackID string) (bool, error)
- func ResolveHostGatewayViaDocker() (string, error)
- func StackID(cfg *config.Config) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BridgeInterfaceIP ¶
BridgeInterfaceIP returns the IPv4 address of a named network interface.
func CopyInfrastructure ¶
CopyInfrastructure renders the embedded infrastructure defaults for the current stack and records the stamp that produced the copied tree.
func DetectedBackendName ¶
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 ¶
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 ¶
InfrastructureReplacements returns the placeholder values used when copying embedded infrastructure defaults.
func OllamaHostForBackend ¶
OllamaHostForBackend returns the hostname/IP that reaches the host Ollama instance from inside the cluster.
func OllamaHostIPForBackend ¶
OllamaHostIPForBackend resolves the Ollama host to an IP address. ClusterIP+Endpoints requires an IP, not a hostname.
Resolution order on darwin+k3d:
- 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).
- 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
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 ¶
RefreshInfrastructureIfChanged refreshes the generated defaults tree when the embedded infrastructure assets, backend, or stack ID changed.
func ResolveHostGatewayViaDocker ¶ added in v0.10.0
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.
Types ¶
This section is empty.