standalone

package
v0.37.0-alpha.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 20, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetectStandaloneHost

func DetectStandaloneHost() ([]byte, bool, error)

DetectStandaloneHost returns the local standalone systemd unit contents when running on a standalone host. Missing standalone markers are reported as found=false without an error.

func IsServiceActive

func IsServiceActive() (active bool, state string)

IsServiceActive reports whether the standalone vCluster systemd unit is currently active on this host, along with the unit's observed state (the systemctl is-active output) so callers can name it in an error. It treats activating, deactivating, and refreshing as active as well — in all of them a server process may still hold the backing store open — so callers can use it as a guard that refuses to run while a control plane is up. It reports false where systemd cannot answer (non-Linux, no systemctl binary, systemd unreachable, unit stopped/failed/not installed), so the in-pod restore path, which has no systemd, proceeds.

func ParseEnvFromSystemdUnit

func ParseEnvFromSystemdUnit(data []byte, key string) string

ParseEnvFromSystemdUnit extracts the value of an Environment="KEY=value" directive from a systemd unit file. Returns empty string if not found.

func ResolveStandaloneIPAddress

func ResolveStandaloneIPAddress(dataDir string) (string, error)

Types

type RuntimeMetadata

type RuntimeMetadata struct {
	Version   string `json:"version,omitempty"`
	IPAddress string `json:"ip,omitempty"`
	NodeClaim string `json:"nodeClaim,omitempty"`
	StartTime string `json:"startTime,omitempty"`
}

func LoadRuntimeMetadata

func LoadRuntimeMetadata(dataDir string) (*RuntimeMetadata, error)

type ServiceManager

type ServiceManager interface {
	Stop() error
	Start() error
}

ServiceManager abstracts stopping and starting the standalone vCluster process.

func NewServiceManager

func NewServiceManager() (ServiceManager, error)

NewServiceManager returns a systemd-based service manager when on Linux with systemd available. Returns an error on other platforms or when the service unit is not found.

type SystemdServiceManager

type SystemdServiceManager struct {
	// contains filtered or unexported fields
}

func (*SystemdServiceManager) Start

func (s *SystemdServiceManager) Start() error

func (*SystemdServiceManager) Stop

func (s *SystemdServiceManager) Stop() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL