doctor

package
v0.0.0-...-9a6de97 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package doctor provides tools to help validate environments and operational status.

Index

Constants

This section is empty.

Variables

View Source
var (
	// KubernetesRange is the acceptible cluster versions
	KubernetesRange = ">=1.7.0"
	// DockerAPIRange is the acceptible range of API versions.
	DockerAPIRange = ">=1.25.0"

	// DockerRange is the user friendly version of DockerAPIRange. It is really
	// just for the error.
	DockerRange = ">=1.13.0"

	// DockerDriver is all the compatible storage drivers.
	DockerDriver = map[string]bool{
		"overlay":  true,
		"overlay2": true,
	}
)
View Source
var CheckList = []Check{
	Check{
		Name: "Extra Binaries",
		Func: DoesSyncthingExist,
	},
	Check{
		Name: "Cluster Config",
		Func: IsClusterConfigValid,
		Type: "pre",
	},
	Check{
		Name: "Cluster Connection",
		Func: CanConnectToCluster,
		Type: "pre",
	},
	Check{
		Name: "Cluster Version",
		Func: IsClusterVersionSupported,
		Type: "pre",
	},
	Check{
		Name: "Cluster Permissions",
		Func: HasClusterPermissions,
		Type: "pre",
	},
	Check{
		Name: "Cluster Service",
		Func: HasClusterService,
		Type: "post",
	},
	Check{
		Name: "Service Health",
		Func: IsClusterServiceHealthy,
		Type: "post",
	},
	Check{
		Name: "Service Version",
		Func: IsServiceCompatible,
		Type: "post",
	},
	Check{
		Name: "Docker Version",
		Func: IsDockerVersionCompatible,
		Type: "post",
	},
	Check{
		Name: "Docker Storage Driver",
		Func: IsDockerStorageCompatible,
		Type: "post",
	},
	Check{
		Name: "Docker Storage Root",
		Func: IsDockerGraphMatching,
		Type: "post",
	},
	Check{
		Name: "Watch Running",
		Func: IsWatchRunning,
	},
}

CheckList is the full list of checks run by doctor.

Functions

func CanConnectToCluster

func CanConnectToCluster() error

CanConnectToCluster verifies, naively, that the cluster can be connected to and return a basic result.

func DoesSyncthingExist

func DoesSyncthingExist() error

DoesSyncthingExist verifies that the local binary exists.

func HasClusterPermissions

func HasClusterPermissions() error

HasClusterPermissions verifies that the current context/user is able to do everything required on the remote cluster.

func HasClusterService

func HasClusterService() error

HasClusterService verifies that the cluster is running the service.

func IsClusterConfigValid

func IsClusterConfigValid() error

IsClusterConfigValid verifies that the local configuration can be loaded and potentially used to connect to the cluster.

func IsClusterServiceHealthy

func IsClusterServiceHealthy() error

IsClusterServiceHealthy verifies that the cluster service is healthy across all nodes.

func IsClusterVersionSupported

func IsClusterVersionSupported() error

IsClusterVersionSupported verifies that the remote cluster's API version falls within the acceptable range.

func IsDockerGraphMatching

func IsDockerGraphMatching() error

IsDockerGraphMatching checks to see if the configured graph directory (the location of the graph driver storage directories) matches what's configured in radar

func IsDockerStorageCompatible

func IsDockerStorageCompatible() error

IsDockerStorageCompatible verifies that the remote cluster has been configured to use compatible docker storage drivers.

func IsDockerVersionCompatible

func IsDockerVersionCompatible() error

IsDockerVersionCompatible verifies that the remote cluster is running a docker daemon with an API version that falls within the compatible range.

func IsServiceCompatible

func IsServiceCompatible() error

IsServiceCompatible verifies that the remote service is compatible with the local client.

func IsWatchRunning

func IsWatchRunning() error

IsWatchRunning verifies that watch is running and ready to go.

Types

type Check

type Check struct {
	Name string
	Func func() error
	Type string
}

Check provides the definition of check that is named and validates something.

func (*Check) Out

func (c *Check) Out() error

Out provides pretty output with colors and spinners of progress.

Jump to

Keyboard shortcuts

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