Documentation
¶
Overview ¶
Package state provides cluster state persistence for distributions that cannot introspect their running configuration (Kind, K3d).
State is stored as JSON in ~/.ksail/clusters/<name>/spec.json so that the update command can compare the desired configuration against the actual configuration used at creation time, avoiding false-positive diffs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidClusterName = errors.New(
"invalid cluster name: must not contain path separators or '..'",
)
ErrInvalidClusterName is returned when a cluster name contains path traversal characters.
var ErrStateNotFound = errors.New("cluster state not found")
ErrStateNotFound is returned when no saved state exists for a cluster.
Functions ¶
func DeleteClusterState ¶
DeleteClusterState removes the saved state for a cluster. This should be called during cluster deletion to clean up. Returns nil if the state does not exist (idempotent).
func LoadClusterSpec ¶
func LoadClusterSpec(clusterName string) (*v1alpha1.ClusterSpec, error)
LoadClusterSpec loads a previously saved ClusterSpec for a cluster. Returns ErrStateNotFound if no state exists for this cluster name.
func SaveClusterSpec ¶
func SaveClusterSpec(clusterName string, spec *v1alpha1.ClusterSpec) error
SaveClusterSpec persists the ClusterSpec used during cluster creation. This allows the update command to compare against the actual creation-time configuration instead of static defaults.
Types ¶
This section is empty.