preflight

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Copyright Contributors to the Open Cluster Management project

Copyright Contributors to the Open Cluster Management project

Index

Constants

This section is empty.

Variables

View Source
var BootstrapConfigMap = "cluster-info"

Functions

func BoolPointer

func BoolPointer(value bool) *bool

func CreateOrUpdateConfigMap

func CreateOrUpdateConfigMap(client kubernetes.Interface, cm *corev1.ConfigMap) error

CreateOrUpdateConfigMap creates a ConfigMap if target resource does not exist. If the resource exists already, the function will update the resource instead.

func RunChecks

func RunChecks(checks []Checker, ww io.Writer) error

RunChecks runs each check, display it's warning/errors, and once all are processed will exist if any errors occured.

Types

type Checker

type Checker interface {
	Check() (warnings, errorList []error)
	Name() string
}

Checker validates the state of the cluster to ensure clusteradm will be successfully as often as possible.

type ClusterInfoCheck

type ClusterInfoCheck struct {
	Namespace    string
	ResourceName string
	ClusterCtx   string // current-context in kubeconfig
	ConfigPath   string // kubeconfig file path
	Client       kubernetes.Interface
}

ClusterInfoCheck checks whether the target kubernetes resource exist in the cluster.

func (ClusterInfoCheck) Check

func (c ClusterInfoCheck) Check() (warnings []error, errorList []error)

func (ClusterInfoCheck) Name

func (c ClusterInfoCheck) Name() string

type Error

type Error struct {
	Msg string
}

func (Error) Error

func (e Error) Error() string

func (*Error) Preflight

func (e *Error) Preflight() bool

type HubApiServerCheck

type HubApiServerCheck struct {
	ClusterCtx string // current-context in kubeconfig
	ConfigPath string // kubeconfig file path
}

func (HubApiServerCheck) Check

func (c HubApiServerCheck) Check() (warnings []error, errorList []error)

func (HubApiServerCheck) Name

func (c HubApiServerCheck) Name() string

Jump to

Keyboard shortcuts

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