Documentation
¶
Index ¶
- func ApplyPlatformPinsToConfig(cfg *config.Config, pins *api.PlatformPins, log Logger)
- func ApplyToolPins(v *Validator, pins *api.PlatformPins)
- func CompareSemverLoose(current, required string) (int, error)
- func CredentialsSecretName(helmRelease, instanceID string) string
- func DeriveToolDownloadURL(name, version, goos, goarch, override string) (string, error)
- func DetectInstalledComponents(ctx context.Context) (k3s, calico, liqo, apiReachable bool)
- func EnsureCLIBinDir() (string, error)
- func EnsureHypervisorCRDs(ctx context.Context, kubeconfig string, logger Logger) error
- func EnsureRFBVNCGatewayImage(ctx context.Context, repository, tag string, logger Logger) error
- func EnsureReadableKubeconfig(ctx context.Context, preferred string, logger Logger) string
- func NormalizeHypervisorAPIURL(raw string) string
- func PrependPath(dir string)
- func ResolveDefaultKubeconfig() string
- func ResolveOperatorChart(explicit string) (chart string, version string)
- func ResolveSolusVMOperatorChart(explicit string) (chart string, version string)
- func ResolveVirtFusionOperatorChart(explicit string) (chart string, version string)
- func SolusVMCredentialsSecretName(helmRelease, instanceID string) string
- func VerifySHA256File(path, expectedHex string) error
- func VersionSatisfies(current, required, minVersion string) bool
- func VersionsMap(pins *api.PlatformPins) map[string]string
- func VirtFusionCredentialsSecretName(helmRelease, instanceID string) string
- type CalicoConfig
- type CalicoInstaller
- type ClusterCleaner
- func (c *ClusterCleaner) CleanupLiqoTenantLeftovers(ctx context.Context) error
- func (c *ClusterCleaner) ForceCleanupAll(ctx context.Context, peeringKubeconfig string) []error
- func (c *ClusterCleaner) UninstallCalico(ctx context.Context) error
- func (c *ClusterCleaner) UninstallK3s(ctx context.Context) error
- func (c *ClusterCleaner) UninstallLiqo(ctx context.Context, kubeconfigPath string) error
- func (c *ClusterCleaner) UnoffloadNamespaces(ctx context.Context) error
- func (c *ClusterCleaner) UnpeerLiqo(ctx context.Context, remoteKubeconfig string) error
- func (c *ClusterCleaner) WaitForPlatformUnpeer(ctx context.Context) error
- type K3sConfig
- type K3sInstaller
- type LiqoConfig
- type LiqoManager
- func (l *LiqoManager) GeneratePeeringUser(ctx context.Context, consumerClusterID, outPath string) error
- func (l *LiqoManager) GetPeeredClusterID(ctx context.Context) (string, error)
- func (l *LiqoManager) Install(ctx context.Context) error
- func (l *LiqoManager) IsInstalled(ctx context.Context) bool
- func (l *LiqoManager) IsPeeringComplete(ctx context.Context) (bool, error)
- func (l *LiqoManager) NeedsPeeringReset(ctx context.Context) (bool, error)
- func (l *LiqoManager) OffloadNamespace(ctx context.Context, ...) error
- func (l *LiqoManager) Peer(ctx context.Context, kubeconfigPath string, gwServerServicePort string) error
- func (l *LiqoManager) PeerAfterReset(ctx context.Context, kubeconfigPath string, gwServerServicePort string) error
- func (l *LiqoManager) ResetPartialPeering(ctx context.Context, remoteKubeconfigPath string)
- type Logger
- type ProxmoxInstance
- type ProxmoxOperatorConfig
- type ProxmoxOperatorInstaller
- type SolusVMInstance
- type SolusVMOperatorConfig
- type SolusVMOperatorInstaller
- type SudoManager
- type SystemCheckResult
- type SystemValidator
- type ToolBootstrapper
- type ToolRequirement
- type ValidationResult
- type Validator
- type VersionChecker
- type VirtFusionInstance
- type VirtFusionOperatorConfig
- type VirtFusionOperatorInstaller
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyPlatformPinsToConfig ¶
func ApplyPlatformPinsToConfig(cfg *config.Config, pins *api.PlatformPins, log Logger)
ApplyPlatformPinsToConfig overlays server pins onto local config (server wins).
func ApplyToolPins ¶
func ApplyToolPins(v *Validator, pins *api.PlatformPins)
ApplyToolPins sets tool minimums from GetPlatformVersions pins. MinVersion is preferred; Version is used when MinVersion is empty (exact pin as floor).
func CompareSemverLoose ¶
CompareSemverLoose compares versions after normalizing common prefixes/suffixes. Returns -1, 0, 1 like semver Compare, or error if unparsable.
func CredentialsSecretName ¶
CredentialsSecretName matches the chart fullname: {release}-proxmox-operator-proxmox-credentials-{id}.
func DeriveToolDownloadURL ¶
DeriveToolDownloadURL builds a download URL for a tool, or uses override when set.
func DetectInstalledComponents ¶
DetectInstalledComponents probes the host/cluster for installed pieces.
func EnsureCLIBinDir ¶
EnsureCLIBinDir creates ~/.nr/bin and prepends it to PATH for this process.
func EnsureHypervisorCRDs ¶
EnsureHypervisorCRDs installs both Proxmox and VirtFusion CRD charts. Mothership Liqo AllowList always includes both API groups; missing CRDs on a provider stall custom-resource informers with "the server could not find the requested resource".
func EnsureRFBVNCGatewayImage ¶
EnsureRFBVNCGatewayImage builds vnc-gateway:local-rfb from the sibling checkout (if needed) and imports it into k3s as repository:tag. Proxmox agents must not call this — they pull Harbor :main. No-ops when SKIP_VNC_GATEWAY_IMAGE_LOAD=1 or when the tag is Harbor stock main.
func EnsureReadableKubeconfig ¶
EnsureReadableKubeconfig returns a kubeconfig path the current user can read. If preferred (or a discovered path) exists but is not readable (typical for root-owned /etc/rancher/k3s/k3s.yaml with mode 600), it copies the file via sudo into ~/.nr/k3s.kubeconfig (mode 0600) and returns that path.
When /etc/rancher/k3s/k3s.yaml exists and is newer than the cached copy (e.g. after k3s reinstall), the cache is refreshed so TLS clients do not keep using a stale CA from a previous cluster.
func NormalizeHypervisorAPIURL ¶ added in v1.0.2
NormalizeHypervisorAPIURL trims whitespace and trailing slashes so https://192.168.1.103/ and https://192.168.1.103 store as the same origin. Operators append their API path (VirtFusion/SolusVM /api/v1, Proxmox /api2/json).
func PrependPath ¶
func PrependPath(dir string)
PrependPath puts dir at the front of PATH if not already present.
func ResolveDefaultKubeconfig ¶
func ResolveDefaultKubeconfig() string
ResolveDefaultKubeconfig returns a best-effort kubeconfig path that is readable by the current user when possible.
func ResolveOperatorChart ¶
ResolveOperatorChart returns local path, OCI ref, or empty. Precedence: explicit path/OCI → sibling checkout → Harbor OCI default.
func ResolveSolusVMOperatorChart ¶
ResolveSolusVMOperatorChart returns local path, OCI ref, or empty. Precedence: explicit path/OCI → SOLUSVM_OPERATOR_CHART → sibling checkout → Harbor OCI default.
func ResolveVirtFusionOperatorChart ¶
ResolveVirtFusionOperatorChart returns local path, OCI ref, or empty. Precedence: explicit path/OCI → VIRTFUSION_OPERATOR_CHART → sibling checkout → Harbor OCI default.
func SolusVMCredentialsSecretName ¶
SolusVMCredentialsSecretName matches the chart fullname: {release}-solusvm-operator-solusvm-credentials-{id}.
func VerifySHA256File ¶
VerifySHA256File checks that path has the expected hex SHA-256 digest.
func VersionSatisfies ¶
VersionSatisfies reports whether current meets required (or minVersion when required is empty).
func VersionsMap ¶
func VersionsMap(pins *api.PlatformPins) map[string]string
VersionsMap returns a flat name→version map for persistence / diagnostics.
func VirtFusionCredentialsSecretName ¶
VirtFusionCredentialsSecretName matches the chart fullname: {release}-virtfusion-operator-virtfusion-credentials-{id}.
Types ¶
type CalicoConfig ¶
type CalicoConfig struct {
Version string // e.g., "v3.30.2"
RolloutTimeout string // e.g., "10m"
CRDsURL string // URL to Calico CRDs manifest (operator-crds.yaml)
OperatorURL string // URL to Calico operator manifest (tigera-operator.yaml)
CustomResourcesURL string // URL to Calico custom resources manifest (custom-resources.yaml)
PodCIDR string // Calico IPv4 pool CIDR. Must match k3s cluster CIDR.
}
CalicoConfig holds Calico installation configuration
type CalicoInstaller ¶
type CalicoInstaller struct {
// contains filtered or unexported fields
}
CalicoInstaller handles Calico installation using client-go
func NewCalicoInstaller ¶
func NewCalicoInstaller(k8sClient *k8s.Client, config *CalicoConfig, logger Logger) *CalicoInstaller
NewCalicoInstaller creates a new Calico installer
func (*CalicoInstaller) Install ¶
func (c *CalicoInstaller) Install(ctx context.Context) error
Install installs Calico using Kubernetes client-go. Calico remains the provider-cluster CNI (k3s flannel is disabled). Liqo peering does not require matching CNIs across clusters, but the local cluster still needs a CNI for in-cluster pod networking.
When Calico is already present, Install still re-applies networking patches and verifies ClusterIP DNS so resume/--force paths heal a broken CNI dataplane.
type ClusterCleaner ¶
type ClusterCleaner struct {
// contains filtered or unexported fields
}
ClusterCleaner removes local cluster components during deregister/force.
func NewClusterCleaner ¶
func NewClusterCleaner(logger Logger) (*ClusterCleaner, error)
NewClusterCleaner creates a cluster cleaner.
func (*ClusterCleaner) CleanupLiqoTenantLeftovers ¶
func (c *ClusterCleaner) CleanupLiqoTenantLeftovers(ctx context.Context) error
CleanupLiqoTenantLeftovers deletes leftover tenant CRs (and namespaces) that block `liqoctl uninstall` after ForeignClusters were removed but networking objects remain.
func (*ClusterCleaner) ForceCleanupAll ¶
func (c *ClusterCleaner) ForceCleanupAll(ctx context.Context, peeringKubeconfig string) []error
ForceCleanupAll runs best-effort cleanup of Liqo, Calico, and k3s.
func (*ClusterCleaner) UninstallCalico ¶
func (c *ClusterCleaner) UninstallCalico(ctx context.Context) error
UninstallCalico best-effort removes Calico namespaces/resources.
func (*ClusterCleaner) UninstallK3s ¶
func (c *ClusterCleaner) UninstallK3s(ctx context.Context) error
UninstallK3s runs the k3s uninstall script if present.
func (*ClusterCleaner) UninstallLiqo ¶
func (c *ClusterCleaner) UninstallLiqo(ctx context.Context, kubeconfigPath string) error
UninstallLiqo best-effort uninstalls Liqo via liqoctl.
func (*ClusterCleaner) UnoffloadNamespaces ¶
func (c *ClusterCleaner) UnoffloadNamespaces(ctx context.Context) error
UnoffloadNamespaces disables Liqo namespace offloading so uninstall does not hang. liqoctl uninstall can hang silently when NamespaceOffloading resources remain.
func (*ClusterCleaner) UnpeerLiqo ¶
func (c *ClusterCleaner) UnpeerLiqo(ctx context.Context, remoteKubeconfig string) error
UnpeerLiqo best-effort unpeers Liqo using liqoctl. remoteKubeconfig is optional; local kubeconfig is always resolved to a user-readable path (k3s.yaml is often mode 600 / root-owned). After liqoctl unpeer, leftover ForeignCluster CRs are deleted — uninstall pre-checks fail while authentication remains enabled on those objects.
func (*ClusterCleaner) WaitForPlatformUnpeer ¶
func (c *ClusterCleaner) WaitForPlatformUnpeer(ctx context.Context) error
WaitForPlatformUnpeer blocks until the platform has removed the ForeignCluster it owns.
DeleteAgent only enqueues that teardown, so continuing immediately races it: while the platform still holds the peering its controllers recreate any ForeignCluster deleted here, and `liqoctl uninstall` refuses to run while one exists. Waiting turns that race into a deterministic handover.
type K3sConfig ¶
type K3sConfig struct {
InstallScriptURL string
KubeconfigMode string
ClusterCIDR string
ServiceCIDR string
FlannelBackend string
InstallDisables string
InstallChannel string
Version string // Exact k3s version tag (INSTALL_K3S_VERSION)
KubeconfigPath string // Path to kubeconfig after installation
NodeIP string
NodeExternalIP string
}
K3sConfig holds k3s installation configuration
type K3sInstaller ¶
type K3sInstaller struct {
// contains filtered or unexported fields
}
K3sInstaller handles k3s installation
func NewK3sInstaller ¶
func NewK3sInstaller(config *K3sConfig, log Logger) (*K3sInstaller, error)
NewK3sInstaller creates a new k3s installer
func (*K3sInstaller) GetK8sClient ¶
func (k *K3sInstaller) GetK8sClient() *k8s.Client
GetK8sClient returns the Kubernetes client (after installation)
func (*K3sInstaller) GetKubeconfigPath ¶
func (k *K3sInstaller) GetKubeconfigPath() string
GetKubeconfigPath returns the kubeconfig path that was actually used. This may be ~/.nr/k3s.kubeconfig when sudo was needed to read k3s.yaml.
type LiqoConfig ¶
type LiqoConfig struct {
Version string
Timeout string
GWServiceType string
GWServerServiceLocation string
PodOffloadingStrategy string
PodCIDR string
ServiceCIDR string
ClusterID string // Cluster/Agent ID for liqoctl install
KubeconfigPath string // Path to kubeconfig file (optional, liqoctl will use default if not provided)
ProxyURL string // Proxy URL for liqo peer command (optional)
APIServerURL string
GWServerServiceNodePort string
GWClientAddress string
GWClientPort string
DisableAPIServerSanityCheck bool
// ChartOCI is the Helm OCI chart reference without version (e.g. oci://harbor.noderings.com/noderings/liqo).
ChartOCI string
// ChartVersion is the Helm chart version (usually Version without a leading v).
ChartVersion string
}
LiqoConfig holds Liqo configuration
type LiqoManager ¶
type LiqoManager struct {
// contains filtered or unexported fields
}
LiqoManager handles Liqo installation, peering, and namespace offloading
func NewLiqoManager ¶
func NewLiqoManager(validator *Validator, k8sClient *k8s.Client, config *LiqoConfig, logger Logger) *LiqoManager
NewLiqoManager creates a new Liqo manager
func (*LiqoManager) GeneratePeeringUser ¶
func (l *LiqoManager) GeneratePeeringUser(ctx context.Context, consumerClusterID, outPath string) error
GeneratePeeringUser runs liqoctl generate peering-user and writes the kubeconfig to outPath.
func (*LiqoManager) GetPeeredClusterID ¶
func (l *LiqoManager) GetPeeredClusterID(ctx context.Context) (string, error)
GetPeeredClusterID returns the remote Liqo cluster ID from the local agent cluster after peering. It uses liqoctl info peer on the local kubeconfig (not the restricted remote peering-user kubeconfig).
func (*LiqoManager) Install ¶
func (l *LiqoManager) Install(ctx context.Context) error
Install installs Liqo using system liqoctl binary
func (*LiqoManager) IsInstalled ¶
func (l *LiqoManager) IsInstalled(ctx context.Context) bool
IsInstalled reports whether Liqo is present and has a real cluster ID.
func (*LiqoManager) IsPeeringComplete ¶
func (l *LiqoManager) IsPeeringComplete(ctx context.Context) (bool, error)
IsPeeringComplete reports whether liqoctl peer finished (resource slice accepted or virtual node present).
func (*LiqoManager) NeedsPeeringReset ¶
func (l *LiqoManager) NeedsPeeringReset(ctx context.Context) (bool, error)
NeedsPeeringReset reports partial peering that blocks re-peer (e.g. resource slice stuck unaccepted).
func (*LiqoManager) OffloadNamespace ¶
func (l *LiqoManager) OffloadNamespace(ctx context.Context, ns, remoteNamespaceName, namespaceMappingStrategy, selector string) error
OffloadNamespace offloads a namespace to peered clusters CLI manages the entire offloading operation
func (*LiqoManager) Peer ¶
func (l *LiqoManager) Peer(ctx context.Context, kubeconfigPath string, gwServerServicePort string) error
Peer configures and peers clusters using liqoctl. gwServerServicePort is the agent-allocated gateway port: NodePort value when service type is NodePort, otherwise --gw-server-service-port for LoadBalancer. Optional gw-client-* overrides come only from LiqoConfig (NAT edge cases); test-k3d.md-style peer does not set them — the client discovers the NodePort.
func (*LiqoManager) PeerAfterReset ¶
func (*LiqoManager) ResetPartialPeering ¶
func (l *LiqoManager) ResetPartialPeering(ctx context.Context, remoteKubeconfigPath string)
ResetPartialPeering tears down incomplete peering state on local and remote clusters. Partial runs often leave nonce secrets or tenant namespaces that block the next peer.
type Logger ¶
type Logger interface {
Info(args ...any)
Infof(format string, args ...any)
Warn(args ...any)
Warnf(format string, args ...any)
Error(args ...any)
Errorf(format string, args ...any)
Debug(args ...any)
Debugf(format string, args ...any)
}
Logger interface for install components
type ProxmoxInstance ¶
type ProxmoxInstance struct {
ID string `yaml:"id" json:"id"`
URL string `yaml:"url" json:"url"`
Username string `yaml:"username" json:"username"`
TokenID string `yaml:"tokenId" json:"tokenId"`
TokenSecret string `yaml:"tokenSecret" json:"tokenSecret"`
}
ProxmoxInstance holds one Proxmox API endpoint + token (user-supplied secrets).
func LoadProxmoxInstancesFile ¶
func LoadProxmoxInstancesFile(path string) ([]ProxmoxInstance, error)
LoadProxmoxInstancesFile reads a YAML file with either:
instances: [ { id, url, username, tokenId, tokenSecret }, ... ]
or a bare list of instances.
func ProxmoxInstanceFromEnv ¶
func ProxmoxInstanceFromEnv() (*ProxmoxInstance, error)
ProxmoxInstanceFromEnv builds a single instance from PROXMOX_* env vars (test-k3d compat). Returns nil, nil when none of the required vars are set.
func (ProxmoxInstance) Validate ¶
func (p ProxmoxInstance) Validate() error
Validate checks required fields for one instance.
type ProxmoxOperatorConfig ¶
type ProxmoxOperatorConfig struct {
ChartPath string
ChartVersion string
HelmNamespace string
HelmRelease string
VNCGatewayNamespace string
Instances []ProxmoxInstance
MimirBearerToken string
MimirServiceEndpoint string
// MimirTLSEnabled selects https vs http for alloy.mimir.serviceEndpoint.
// Production (metrics.noderings.com) uses true; local control-plane Mimir uses false.
MimirTLSEnabled bool
// AgentID is stamped onto Alloy remote_write external_labels as agent_id.
AgentID string
VNCGatewayImageTag string
VNCTLSServerName string
VNCCAFile string
// VNCInsecureSkipVerify is a temporary opt-out; ignored by vnc-gateway when a CA is supplied.
VNCInsecureSkipVerify bool
KubeconfigPath string
}
ProxmoxOperatorConfig holds inputs for provider-side operator + vnc-gateway install.
func BaseConfigFromEnv ¶
func BaseConfigFromEnv(kubeconfigPath string) *ProxmoxOperatorConfig
BaseConfigFromEnv fills non-secret defaults from environment (same knobs as install-proxmox-operator-provider.sh).
type ProxmoxOperatorInstaller ¶
type ProxmoxOperatorInstaller struct {
// contains filtered or unexported fields
}
ProxmoxOperatorInstaller installs proxmox-operator via helm subprocess.
func NewProxmoxOperatorInstaller ¶
func NewProxmoxOperatorInstaller(cfg *ProxmoxOperatorConfig, logger Logger) *ProxmoxOperatorInstaller
NewProxmoxOperatorInstaller creates an installer.
type SolusVMInstance ¶
type SolusVMInstance struct {
ID string `yaml:"id" json:"id"`
URL string `yaml:"url" json:"url"`
Token string `yaml:"token" json:"token"`
}
SolusVMInstance holds one SolusVM 2 management-node API endpoint + bearer token.
func LoadSolusVMInstancesFile ¶
func LoadSolusVMInstancesFile(path string) ([]SolusVMInstance, error)
LoadSolusVMInstancesFile reads a YAML file with either:
instances: [ { id, url, token }, ... ]
or a bare list of instances. The file must be mode 0600.
func SolusVMInstanceFromEnv ¶
func SolusVMInstanceFromEnv() (*SolusVMInstance, error)
SolusVMInstanceFromEnv builds a single instance from SOLUSVM_* env vars. Returns nil, nil when none of the required vars are set.
func (SolusVMInstance) Validate ¶
func (v SolusVMInstance) Validate() error
Validate checks required fields for one SolusVM 2 instance.
type SolusVMOperatorConfig ¶
type SolusVMOperatorConfig struct {
ChartPath string
ChartVersion string
HelmNamespace string
HelmRelease string
VNCGatewayNamespace string
Instances []SolusVMInstance
MimirBearerToken string
MimirServiceEndpoint string
// MimirTLSEnabled selects https vs http for alloy.mimir.serviceEndpoint.
MimirTLSEnabled bool
// AgentID is stamped onto Alloy remote_write external_labels as agent_id.
AgentID string
VNCGatewayImageTag string
KubeconfigPath string
}
SolusVMOperatorConfig holds inputs for provider-side SolusVM operator + vnc-gateway install.
func SolusVMBaseConfigFromEnv ¶
func SolusVMBaseConfigFromEnv(kubeconfigPath string) *SolusVMOperatorConfig
SolusVMBaseConfigFromEnv fills non-secret defaults from environment. HelmNamespace is solusvm-system unless HELM_NAMESPACE is explicitly set.
type SolusVMOperatorInstaller ¶
type SolusVMOperatorInstaller struct {
// contains filtered or unexported fields
}
SolusVMOperatorInstaller installs solusvm-operator via helm subprocess.
func NewSolusVMOperatorInstaller ¶
func NewSolusVMOperatorInstaller(cfg *SolusVMOperatorConfig, logger Logger) *SolusVMOperatorInstaller
NewSolusVMOperatorInstaller creates a SolusVM operator installer.
type SudoManager ¶
type SudoManager struct {
// contains filtered or unexported fields
}
SudoManager handles sudo authentication and command execution
func NewSudoManager ¶
func NewSudoManager(logger Logger) (*SudoManager, error)
NewSudoManager creates a new sudo manager and authenticates once
func (*SudoManager) PrepareStdin ¶
func (sm *SudoManager) PrepareStdin(additionalData []byte) io.Reader
PrepareStdin prepares stdin for a command After initial authentication, sudo -n doesn't need password input
func (*SudoManager) RunCommand ¶
RunCommand runs a command with sudo if needed Uses sudo -n -E (non-interactive, preserve environment) after initial authentication
type SystemCheckResult ¶
type SystemCheckResult struct {
Check string
Status string // "pass" | "fail" | "warn"
Message string
}
SystemCheckResult represents the result of a system check
type SystemValidator ¶
type SystemValidator struct {
// contains filtered or unexported fields
}
SystemValidator performs pre-flight system checks
func NewSystemValidator ¶
func NewSystemValidator(logger Logger) *SystemValidator
NewSystemValidator creates a new system validator
func (*SystemValidator) ValidateSystem ¶
func (v *SystemValidator) ValidateSystem(ctx context.Context, agentIP string) ([]SystemCheckResult, error)
ValidateSystem checks system requirements. agentIP is --agent-ip; it must be assigned to a local interface because k3s is started with --node-ip from that value.
func (*SystemValidator) ValidateTempDir ¶
func (v *SystemValidator) ValidateTempDir(tempDir string) error
ValidateTempDir checks if temp directory is writable
type ToolBootstrapper ¶
type ToolBootstrapper struct {
// contains filtered or unexported fields
}
ToolBootstrapper downloads and installs CLI-managed tools (helm, liqoctl).
func NewToolBootstrapper ¶
func NewToolBootstrapper(verifyChecksums bool, logger Logger) (*ToolBootstrapper, error)
NewToolBootstrapper creates a bootstrapper that installs into ~/.nr/bin.
func (*ToolBootstrapper) BootstrapTools ¶
func (t *ToolBootstrapper) BootstrapTools(ctx context.Context, pins *api.PlatformPins) error
BootstrapTools ensures helm and liqoctl match the given platform pins.
type ToolRequirement ¶
type ToolRequirement struct {
Name string
MinVersion string
Optional bool
InstallURL string
VersionFlag string // Flag to get version (e.g., "--version", "version")
}
ToolRequirement defines a requirement for an external tool
type ValidationResult ¶
type ValidationResult struct {
Tool string
Available bool
Version string
Valid bool
Error error
Requirement *ToolRequirement
}
ValidationResult represents the result of validating a tool
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
Validator validates prerequisites
func NewToolValidator ¶
func NewToolValidator(pins *api.PlatformPins, cfg *config.Config) *Validator
NewToolValidator builds a validator using server pins when available. After preparePlatformVersions, cfg.Liqo holds the same fork pin as liqoctl.
func NewValidator ¶
func NewValidator() *Validator
NewValidator creates a new prerequisites validator with offline-safe defaults. Prefer NewToolValidator so liqoctl/helm floors come from /v1/platform-versions.
func (*Validator) CheckTool ¶
CheckTool checks if a tool is available (public method for compatibility)
func (*Validator) PrintResults ¶
func (v *Validator) PrintResults(results []ValidationResult) error
PrintResults prints validation results
func (*Validator) SetMinVersion ¶
SetMinVersion updates the minimum version for a known tool (e.g. from server pins).
func (*Validator) ValidatePrerequisites ¶
func (v *Validator) ValidatePrerequisites(ctx context.Context) ([]ValidationResult, error)
ValidatePrerequisites validates all required tools
type VersionChecker ¶
type VersionChecker struct{}
VersionChecker checks and compares tool versions
func NewVersionChecker ¶
func NewVersionChecker() *VersionChecker
NewVersionChecker creates a new version checker
func (*VersionChecker) CompareVersions ¶
func (v *VersionChecker) CompareVersions(current, minimum string) (int, error)
CompareVersions compares two semantic versions Returns: -1 if current < minimum, 0 if equal, 1 if current >= minimum
func (*VersionChecker) ExtractVersion ¶
func (v *VersionChecker) ExtractVersion(versionOutput string) (string, error)
ExtractVersion extracts a semantic version from tool output Handles various output formats like: - "v1.2.3" - "1.2.3" - "tool version 1.2.3" - "tool 1.2.3 (build abc123)"
func (*VersionChecker) MeetsMinimum ¶
func (v *VersionChecker) MeetsMinimum(current, minimum string) (bool, error)
MeetsMinimum checks if current version meets minimum requirement
type VirtFusionInstance ¶
type VirtFusionInstance struct {
ID string `yaml:"id" json:"id"`
URL string `yaml:"url" json:"url"`
Token string `yaml:"token" json:"token"`
}
VirtFusionInstance holds one VirtFusion control-plane API endpoint + bearer token.
func LoadVirtFusionInstancesFile ¶
func LoadVirtFusionInstancesFile(path string) ([]VirtFusionInstance, error)
LoadVirtFusionInstancesFile reads a YAML file with either:
instances: [ { id, url, token }, ... ]
or a bare list of instances. The file must be mode 0600.
func VirtFusionInstanceFromEnv ¶
func VirtFusionInstanceFromEnv() (*VirtFusionInstance, error)
VirtFusionInstanceFromEnv builds a single instance from VIRTFUSION_* env vars. Returns nil, nil when none of the required vars are set.
func (VirtFusionInstance) Validate ¶
func (v VirtFusionInstance) Validate() error
Validate checks required fields for one VirtFusion instance.
type VirtFusionOperatorConfig ¶
type VirtFusionOperatorConfig struct {
ChartPath string
ChartVersion string
HelmNamespace string
HelmRelease string
VNCGatewayNamespace string
Instances []VirtFusionInstance
MimirBearerToken string
MimirServiceEndpoint string
// MimirTLSEnabled selects https vs http for alloy.mimir.serviceEndpoint.
MimirTLSEnabled bool
// AgentID is stamped onto Alloy remote_write external_labels as agent_id.
AgentID string
VNCGatewayImageTag string
KubeconfigPath string
}
VirtFusionOperatorConfig holds inputs for provider-side VirtFusion operator + vnc-gateway install.
func VirtFusionBaseConfigFromEnv ¶
func VirtFusionBaseConfigFromEnv(kubeconfigPath string) *VirtFusionOperatorConfig
VirtFusionBaseConfigFromEnv fills non-secret defaults from environment. HelmNamespace is virtfusion-system unless HELM_NAMESPACE is explicitly set.
type VirtFusionOperatorInstaller ¶
type VirtFusionOperatorInstaller struct {
// contains filtered or unexported fields
}
VirtFusionOperatorInstaller installs virtfusion-operator via helm subprocess.
func NewVirtFusionOperatorInstaller ¶
func NewVirtFusionOperatorInstaller(cfg *VirtFusionOperatorConfig, logger Logger) *VirtFusionOperatorInstaller
NewVirtFusionOperatorInstaller creates a VirtFusion operator installer.
Source Files
¶
- calico.go
- calico_api.go
- hypervisor_crds.go
- hypervisor_url.go
- k3s.go
- kubeconfig.go
- liqo.go
- liqo_peering_status.go
- liqo_values.go
- prerequisites.go
- proxmox_instances.go
- proxmox_operator.go
- solusvm_instances.go
- solusvm_operator.go
- sudo.go
- tools.go
- uninstall.go
- validator.go
- validator_ip.go
- validator_unix.go
- versions.go
- virtfusion_instances.go
- virtfusion_operator.go
- vnc_gateway_image.go