check

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2020 License: MPL-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package check provides set of checks to verify cluster readiness.

Package check provides set of checks to verify cluster readiness.

Package check provides set of checks to verify cluster readiness.

Package check provides set of checks to verify cluster readiness.

Index

Constants

This section is empty.

Variables

View Source
var ErrServiceNotFound = fmt.Errorf("service not found")

ErrServiceNotFound is an error that indicates that a service was not found.

Functions

func ApidReadyAssertion

func ApidReadyAssertion(ctx context.Context, cluster ClusterInfo) error

ApidReadyAssertion checks whether apid is responsive on all the nodes.

func K8sAllNodesReadyAssertion

func K8sAllNodesReadyAssertion(ctx context.Context, cluster cluster.K8sProvider) error

K8sAllNodesReadyAssertion checks whether all the nodes are Ready.

func K8sAllNodesReportedAssertion

func K8sAllNodesReportedAssertion(ctx context.Context, cluster ClusterInfo) error

K8sAllNodesReportedAssertion checks whether all the nodes show up in node list.

func K8sAllNodesSchedulableAssertion added in v0.6.0

func K8sAllNodesSchedulableAssertion(ctx context.Context, cluster cluster.K8sProvider) error

K8sAllNodesSchedulableAssertion checks whether all the nodes are schedulable (not cordoned).

func K8sFullControlPlaneAssertion

func K8sFullControlPlaneAssertion(ctx context.Context, cluster ClusterInfo) error

K8sFullControlPlaneAssertion checks whether all the master nodes are k8s master nodes.

nolint: gocyclo

func K8sPodReadyAssertion

func K8sPodReadyAssertion(ctx context.Context, cluster cluster.K8sProvider, namespace, labelSelector string) error

K8sPodReadyAssertion checks whether all the pods are Ready.

func ServiceHealthAssertion

func ServiceHealthAssertion(ctx context.Context, cluster ClusterInfo, service string, setters ...Option) error

ServiceHealthAssertion checks whether service reached some specified state. nolint: gocyclo

func ServiceStateAssertion

func ServiceStateAssertion(ctx context.Context, cluster ClusterInfo, service string, states ...string) error

ServiceStateAssertion checks whether service reached some specified state.

nolint: gocyclo

func Wait

func Wait(ctx context.Context, cluster ClusterInfo, checks []ClusterCheck, reporter Reporter) error

Wait run the checks against the cluster and waits for the full set to succeed.

Context ctx might have a timeout set to limit overall wait time. Each check might define its own timeout.

Types

type ClusterCheck

type ClusterCheck func(ClusterInfo) conditions.Condition

ClusterCheck implements a function which returns condition based on ClusterAccess.

func DefaultClusterChecks

func DefaultClusterChecks() []ClusterCheck

DefaultClusterChecks returns a set of default Talos cluster readiness checks.

func ExtraClusterChecks added in v0.6.0

func ExtraClusterChecks() []ClusterCheck

ExtraClusterChecks returns a set of additional Talos cluster readiness checks which work only for newer versions of Talos.

ExtraClusterChecks can't be used reliably in upgrade tests, as older versions might not pass the checks.

type ClusterInfo

type ClusterInfo interface {
	cluster.ClientProvider
	cluster.K8sProvider
	cluster.Info
}

ClusterInfo is interface requires by checks.

type Option

type Option func(o *Options) error

Option represents functional option.

func WithNodeTypes

func WithNodeTypes(t ...machine.Type) Option

WithNodeTypes sets the node types for a check.

type Options

type Options struct {
	Types []machine.Type
}

Options describes ClusterCheck parameters.

func DefaultOptions

func DefaultOptions() *Options

DefaultOptions returns the default options.

type Reporter

type Reporter interface {
	Update(check conditions.Condition)
}

Reporter presents wait progress.

It is supposed that reporter drops duplicate messages.

func StderrReporter

func StderrReporter() Reporter

StderrReporter returns console reporter with stderr output.

Jump to

Keyboard shortcuts

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