Documentation
¶
Overview ¶
Package host manages the Miabi stack on the machine the CLI runs on, as opposed to talking to a panel over HTTP. It is the CLI's half of the platform-stack engine: everything Docker-specific lives behind Open, which is stubbed out on platforms that cannot host a stack.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrUnsupported = errors.New("stack management requires a Linux or macOS host with Docker")
ErrUnsupported is returned by Open on a platform with no Docker host to manage.
Functions ¶
func InspectSelfImage ¶
InspectSelfImage reads back the image of the container with the given id, so an installer running as a container can pin the exact ref it was started from. Empty when it cannot be determined.
func ManifestPath ¶
ManifestPath resolves the manifest to operate on: the --file flag if given, else the platform default (see stack.ManifestPath).
func OtherInstall ¶ added in v0.13.2
OtherInstall returns a manifest that exists somewhere other than path, or "" when there is none.
Two installs on one host are not two installs: they converge the same container, volume and network names against the same Docker daemon, and the second one adopts and then fights over the first one's containers. Better to refuse than to discover it as a restart loop.
func RequireReadable ¶ added in v0.13.2
RequireReadable fails early when the manifest exists but this process cannot read it. The file is mode 0600 because it holds the database password, so "you are not the owner" is the likely reason and is worth saying outright.
func RequireWritable ¶ added in v0.13.2
RequireWritable fails early when this process cannot write the manifest, rather than surfacing a permission error from three layers down.
func UserManifestPath ¶ added in v0.13.2
func UserManifestPath() string
UserManifestPath is where a non-root install keeps its manifest: ~/.miabi/miabi.yaml, beside the CLI's own config. The gateway config lands next to it, because everything an install needs is resolved relative to the manifest. Empty when there is no home directory.
It mirrors stack.UserConfigPath in the platform module, which this CLI tracks by release: fold this into a call to that one on the next dependency bump.
Types ¶
type Session ¶
type Session struct {
Svc *stack.Service
Manifest string
// contains filtered or unexported fields
}
Session is an open connection to the local Docker engine plus the stack service driving it. Close releases the connection.