Documentation
¶
Overview ¶
Package instance records the host-instance ServerConfiguration values (containerd namespace suffix and cgroup root) that a given runPath was bootstrapped under, so the daemon can refuse to start when reconfigured to a different layout. Migration between layouts is out of scope — the operator destroys the runPath and re-runs `kuke init` against the new config.
Index ¶
Constants ¶
const MetadataFile = ".kukeon-instance.json"
MetadataFile is the basename of the instance-metadata file written under runPath. The dot prefix keeps it visually distinct from realm directories (which never start with a dot) so a directory listing of /opt/kukeon makes the instance file obvious.
Variables ¶
This section is empty.
Functions ¶
func VerifyOrWrite ¶
VerifyOrWrite enforces the runPath / configuration consistency contract: if a prior instance metadata exists under runPath and disagrees with the supplied (suffix, cgroupRoot), return an ErrInstanceMismatch-wrapped error so the caller can refuse to start. If absent, write the supplied values so the next start can verify against them. If present and matching, do nothing.
suffix is the operator-facing form without a leading dot. cgroupRoot is the absolute cgroup path. Both inputs are canonicalized here (TrimSpace on both, plus TrimRight slash on cgroupRoot, mirroring consts.ConfigureRuntime) so callers can pass raw viper / flag values without tripping a spurious mismatch when one start uses "/kukeon-dev/" and the next uses "/kukeon-dev". Validation of well-formedness lives in consts.ConfigureRuntime, which call sites invoke before this.
Types ¶
type Metadata ¶
type Metadata struct {
ContainerdNamespaceSuffix string `json:"containerdNamespaceSuffix"`
CgroupRoot string `json:"cgroupRoot"`
}
Metadata is the on-disk shape of the instance file. The suffix is stored in operator-facing form (no leading dot, e.g. "kukeon.io"); the cgroup root is stored as written by the operator with trailing slashes trimmed.