Documentation
¶
Overview ¶
Package root builds the linuxctl Cobra command tree.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MigrateRegistry ¶
func MigrateRegistry() error
MigrateRegistry auto-migrates ~/.linuxctl/envs.yaml → ~/.linuxctl/stacks.yaml on startup if:
- envs.yaml exists, AND
- stacks.yaml does NOT exist
In that case envs.yaml is renamed to stacks.yaml (preserving contents bit-for-bit) and a one-time warning is printed to stderr. If both exist, stacks.yaml wins, envs.yaml is left alone, and a warning is emitted on every startup until the user removes envs.yaml. Returns nil if no migration is needed.
This is called from NewRootCmd so every invocation has the registry in its canonical location. Fixes #17 with a one-release deprecation window.
func NewRootCmd ¶
NewRootCmd builds the root Cobra command with all subtrees registered.
func RegistryPathForRead ¶
RegistryPathForRead returns the path the stack registry should be loaded from. Callers should normally invoke MigrateRegistry() first; this helper additionally falls back to legacyRegistryPath() if stacks.yaml is absent but envs.yaml exists (defense-in-depth for the deprecation window).