resilience

package
v1.5.7 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: Apache-2.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package resilience judges whether the data plane would keep serving if the control plane went away.

Index

Constants

View Source
const (
	StatusPass    = "pass"
	StatusFail    = "fail"
	StatusWarn    = "warn"
	StatusUnknown = "unknown"
)

Check statuses.

View Source
const (
	CheckRouteSnapshot = "route_snapshot"
	CheckCertCache     = "cert_cache"
	CheckAgentLink     = "agent_link"
	CheckContainers    = "container_restart"
	CheckTelemetry     = "telemetry_buffer"
)

Check IDs.

View Source
const FixSaveSnapshot = "save_snapshot"

FixSaveSnapshot is the fix that rewrites the route snapshot from the applied config.

Variables

This section is empty.

Functions

This section is empty.

Types

type Check

type Check struct {
	ID     string `json:"id"`
	Status string `json:"status"`
	Detail string `json:"detail"`
	Fix    string `json:"fix,omitempty"`
}

Check is one survival property of the ingress or a node.

type IngressInput

type IngressInput struct {
	SnapshotEnabled bool
	SavedAt         time.Time
	SaveError       string
	// Verified is set when the snapshot was opened as a restart would; VerifyErr is the outcome.
	Verified    bool
	VerifyErr   error
	ConfigBytes int
	CertKeys    int
	CertErr     error
}

IngressInput is what the control plane knows about the persisted ingress state.

type NodeInput

type NodeInput struct {
	ID       string
	Name     string
	Local    bool
	Status   string
	LastSeen *time.Time
}

NodeInput is one node as the control plane last saw it.

type Report

type Report struct {
	GeneratedAt time.Time `json:"generated_at"`
	Simulated   bool      `json:"simulated"`
	Overall     string    `json:"overall"`
	Scopes      []Scope   `json:"scopes"`
}

Report is the whole resilience check.

func Evaluate

func Evaluate(now time.Time, simulate bool, in IngressInput, nodes []NodeInput) Report

Evaluate builds the report. simulate adds the restart dry run to the ingress checks.

type Scope

type Scope struct {
	Kind   string  `json:"kind"`
	ID     string  `json:"id"`
	Name   string  `json:"name"`
	Checks []Check `json:"checks"`
}

Scope groups the checks of the ingress or one node.

Jump to

Keyboard shortcuts

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