executor

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2026 License: MIT Imports: 29 Imported by: 0

Documentation

Overview

Package executor carries out an upgrade or rollback. It runs as a detached kubesolo process (kubesolo --upgrade-executor=<job>), outside the KubeSolo service it stops and restarts, and holds the upgrade lock from start to finish.

It needs SQLite and a Kubernetes client, so only the kubesolo binary links it. The parts kubesoloctl shares live in internal/upgrade.

Index

Constants

View Source
const (
	CheckAPIServer = "apiserver"
	CheckNode      = "node"
	CheckVersion   = "version"
	CheckDNS       = "coredns"
)

Health check names, as they appear in upgrade.Health.Checks.

Variables

This section is empty.

Functions

func CheckDatastore

func CheckDatastore(path string) error

CheckDatastore is the datastore dry-run, run by the *new* binary against a copy of the datastore: it opens the copy exactly as kine will, which applies kine's schema setup and data migration, then checks the result is intact and readable.

It catches the one failure that makes a rollback ugly — a binary that cannot open, or corrupts, the store it is about to be started on — while the real datastore is untouched and the old binary is still running.

func CheckHealth

func CheckHealth(ctx context.Context, kubeconfig, wantVersion string) upgrade.Health

CheckHealth is KubeSolo's own view of whether it works: the API server is ready, the node is Ready, and CoreDNS — the first workload KubeSolo deploys, and so a fair test that the runtime, the network and the kubelet all work — has a ready pod.

wantVersion, when set, must be the KubeSolo version the kubelet reports. The node object outlives the process, so a Ready node alone does not show which binary is behind it.

func CloneFile

func CloneFile(src, dst string, mode os.FileMode) error

CloneFile copies src to dst, sharing blocks when the filesystem supports it (FICLONE: btrfs, XFS with reflink, bcachefs, overlayfs on those). A clone is instant and takes no space until either file changes. Elsewhere it is an ordinary copy. dst is synced either way.

func Main

func Main(jobFile string) int

Main runs the job in jobFile and returns the process exit code. It is the whole of `kubesolo --upgrade-executor`.

func QuickCheck

func QuickCheck(path string) error

QuickCheck runs SQLite's quick_check on a database file.

func SnapshotDatastore

func SnapshotDatastore(src, dst string) error

SnapshotDatastore writes a consistent copy of the live datastore at src to dst while kine keeps running.

VACUUM INTO reads the database inside one transaction, so the copy is a single point in time even with kine writing, and it folds the WAL in: the result is one self-contained file with no -wal or -shm to keep beside it. Copying state.db alone would lose every transaction still in the WAL.

func Summary

func Summary(h upgrade.Health) string

Summary describes the failing checks in one line.

Types

This section is empty.

Jump to

Keyboard shortcuts

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