status

package
v0.2.28 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Package status reports agent status back to the hub.

Index

Constants

View Source
const (
	// HeartbeatInterval is how often the agent sends heartbeats to the hub.
	HeartbeatInterval = 30 * time.Second
)
View Source
const (

	// PlacementLabel identifies local Deployments managed by a railgrid Placement.
	PlacementLabel = edgesGroup + "/placement"
)

Variables

This section is empty.

Functions

func DarwinHostFacts

func DarwinHostFacts() map[string]string

DarwinHostFacts returns the runtime facts that identify a macOS worker. It intentionally returns no values on other platforms: a Linux container running the agent for a Kubernetes edge must not be inferred as the host OS of that edge.

func DialAndFetchSSHHostKey

func DialAndFetchSSHHostKey(port int, logger klog.Logger) string

DialAndFetchSSHHostKey connects to the SSH server on the given local port and captures its public host key by performing a handshake with a capturing HostKeyCallback. The key is returned in authorized_keys format ("<type> <base64>"). An empty string is returned on any error.

This approach is correct for both production (real sshd on port 22) and e2e tests (embedded TestSSHServer with an in-memory random key), because it asks the actual server for its key rather than reading a file that may belong to a different sshd instance.

Types

type EdgeReporter

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

EdgeReporter sends heartbeats for a connectable edge resource. It works for Kubernetes, LinuxServer, and service-only MacOSServer agents.

func NewEdgeReporter

func NewEdgeReporter(edgeName string, gvr schema.GroupVersionResource, hubClient *railgridclient.Client, tunnelState <-chan bool, sshProxyPort int) *EdgeReporter

NewEdgeReporter creates a new EdgeReporter. tunnelState is the channel produced by tunnel.StartProxyTunnel; pass nil to skip tunnel-state tracking (tunnelConnected will always report false). sshProxyPort is the local SSH daemon port to probe for its host key (server mode only); pass 0 to skip SSH host key reporting.

func (*EdgeReporter) Run

func (r *EdgeReporter) Run(ctx context.Context) error

Run starts the edge heartbeat reporter and blocks until ctx is cancelled.

func (*EdgeReporter) SetHarnessSource added in v0.2.8

func (r *EdgeReporter) SetHarnessSource(source func() []harnessplane.HarnessStatus)

SetHarnessSource wires the harness plane's live view onto the heartbeat, so "which of my edges can run Claude Code" is one field on the edge object rather than something a caller has to discover by reading Services.

func (*EdgeReporter) SetHostFacts

func (r *EdgeReporter) SetHostFacts(labels map[string]string)

SetHostFacts enables OS-aware status reporting without changing the legacy constructor used by existing callers. The values are copied so a caller can safely reuse its input map after setup.

type PlacementReporter

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

PlacementReporter watches local Deployments and reports their status back to the corresponding Placement resources in the tenant workspace.

func NewPlacementReporter

func NewPlacementReporter(
	hubDynamic dynamic.Interface,
	informerFactory informers.SharedInformerFactory,
) *PlacementReporter

NewPlacementReporter creates a PlacementReporter. hubDynamic is scoped to the edge's tenant workspace; informerFactory watches the local cluster.

func (*PlacementReporter) Run

func (r *PlacementReporter) Run(ctx context.Context, workers int) error

Run starts the placement status reporter.

Jump to

Keyboard shortcuts

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