Documentation
¶
Overview ¶
Package layout centralizes the on-disk filesystem layout used by the d8 plugins subsystem: directory names, suffixes, and helpers that build concrete paths from the install root.
The install root is the on-disk directory under which the subsystem keeps everything it owns - installed plugin binaries (<root>/plugins/...) and cached contracts (<root>/cache/contracts/...). It is supplied by the caller (typically the plugins.Manager directory, sourced from --plugins-dir, with default /opt/deckhouse/lib/deckhouse-cli, or ~/.deckhouse-cli as fallback).
Callers should use the builder functions (PluginDir, BinaryPath, ...) for full paths; the directory-name segments are package-private.
Index ¶
- Constants
- func BinaryPath(installRoot, pluginName string, majorVersion int) string
- func ContractFile(installRoot, pluginName string) string
- func ContractsDir(installRoot string) string
- func CurrentLinkPath(installRoot, pluginName string) string
- func HomeFallbackPath() (string, error)
- func InstallLockPath(installRoot, pluginName string) string
- func PluginDir(installRoot, pluginName string) string
- func PluginsRoot(installRoot string) string
- func RootHasInstall(root string) bool
- func VersionDir(installRoot, pluginName string, majorVersion int) string
Constants ¶
const ( ContractFileExt = ".json" VersionDirPrefix = "v" )
Variables ¶
This section is empty.
Functions ¶
func BinaryPath ¶
BinaryPath returns <installRoot>/plugins/<pluginName>/v<majorVersion>/<pluginName>.
func ContractFile ¶
ContractFile returns <installRoot>/cache/contracts/<pluginName>.json.
func ContractsDir ¶
ContractsDir returns <installRoot>/cache/contracts.
func CurrentLinkPath ¶
CurrentLinkPath returns <installRoot>/plugins/<pluginName>/current - the symlink to the currently active binary version.
func HomeFallbackPath ¶
HomeFallbackPath returns ~/.deckhouse-cli - the fallback install root used when the default /opt path is not writable.
func InstallLockPath ¶
InstallLockPath returns <installRoot>/plugins/<pluginName>/install.lock - one lock per plugin (not per major): installs of different majors still contend on the shared `current` symlink and contract cache, so they must serialize.
func PluginsRoot ¶
PluginsRoot returns <installRoot>/plugins.
func RootHasInstall ¶
RootHasInstall reports whether <root>/plugins holds at least one installed plugin - a directory with a `current` symlink. Requiring the symlink (not just any subdir) means a leftover empty v<major> dir from a failed install does not count as an install. The cache dir is a sibling, never miscounted.
func VersionDir ¶
VersionDir returns <installRoot>/plugins/<pluginName>/v<majorVersion>.
Types ¶
This section is empty.