checks

package
v0.0.0-...-62baabf Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	CheckActionPass                      = iota
	CheckActionBlockUpgrade              // Only block upgrade
	CheckActionBlockUpgradeDriverInstall // Block both upgrade and driver install
	CheckActionBlockUpgradeOrDegrade     // Degrade if the driver is installed, block upgrade otherwise
	CheckActionDegrade
)

Ordered by severity, Pass must be 0 (for struct initialization).

Variables

This section is empty.

Functions

func ActionToString

func ActionToString(a CheckAction) string

func CheckClusterStatus

func CheckClusterStatus(result ClusterCheckResult, apiDependencies KubeAPIInterface) (ClusterCheckStatus, ClusterCheckResult)

Types

type CheckAction

type CheckAction int

type CheckArgs

type CheckArgs struct {
	// contains filtered or unexported fields
}

func NewCheckArgs

func NewCheckArgs(connection *check.VSphereConnection, apiClient KubeAPIInterface) CheckArgs

type CheckExistingDriver

type CheckExistingDriver struct{}

func (*CheckExistingDriver) Check

func (c *CheckExistingDriver) Check(ctx context.Context, checkOpts CheckArgs) []ClusterCheckResult

type CheckInterface

type CheckInterface interface {
	Check(ctx context.Context, args CheckArgs) []ClusterCheckResult
}

type CheckStatusType

type CheckStatusType string
const (
	CheckStatusPass                    CheckStatusType = "pass"
	CheckStatusVSphereConnectionFailed CheckStatusType = "vsphere_connection_failed"
	CheckStatusOpenshiftAPIError       CheckStatusType = "openshift_api_error"
	CheckStatusExistingDriverFound     CheckStatusType = "existing_driver_found"
	CheckStatusDeprecatedVCenter       CheckStatusType = "check_deprecated_vcenter"
	CheckStatusDeprecatedHWVersion     CheckStatusType = "check_deprecated_hw_version"
	CheckStatusDeprecatedESXIVersion   CheckStatusType = "check_deprecated_esxi_version"
	CheckStatusVcenterAPIError         CheckStatusType = "vcenter_api_error"
	CheckStatusGenericError            CheckStatusType = "generic_error"
)

type ClusterCheckResult

type ClusterCheckResult struct {
	CheckError  error
	CheckStatus CheckStatusType
	Action      CheckAction
	// if we are blocking cluster upgrades or degrading the cluster
	// this message contains information about why we are degrading the cluster
	// or blocking upgrades.
	Reason string
}

func MakeClusterCheckResultPass

func MakeClusterCheckResultPass() ClusterCheckResult

func MakeClusterDegradedError

func MakeClusterDegradedError(checkStatus CheckStatusType, reason error) ClusterCheckResult

func MakeClusterUnupgradeableError

func MakeClusterUnupgradeableError(checkStatus CheckStatusType, reason error) ClusterCheckResult

func MakeGenericVCenterAPIError

func MakeGenericVCenterAPIError(reason error) ClusterCheckResult

type ClusterCheckStatus

type ClusterCheckStatus string
const (
	ClusterCheckAllGood                   ClusterCheckStatus = "pass"
	ClusterCheckBlockUpgradeDriverInstall ClusterCheckStatus = "installation_blocked"
	ClusterCheckBlockUpgrade              ClusterCheckStatus = "upgrades_blocked"
	ClusterCheckUpgradeStateUnknown       ClusterCheckStatus = "upgrades_unknown"
	ClusterCheckDegrade                   ClusterCheckStatus = "degraded"
)

type KubeAPIInterface

type KubeAPIInterface interface {
	// ListNodes returns list of all nodes in the cluster.
	ListNodes() ([]*v1.Node, error)
	GetCSIDriver(name string) (*storagev1.CSIDriver, error)
	ListCSINodes() ([]*storagev1.CSINode, error)
	GetStorageClass(name string) (*storagev1.StorageClass, error)
	GetInfrastructure() *ocpv1.Infrastructure
}

type KubeAPIInterfaceImpl

type KubeAPIInterfaceImpl struct {
	Infrastructure     *ocpv1.Infrastructure
	NodeLister         corelister.NodeLister
	CSINodeLister      storagelister.CSINodeLister
	CSIDriverLister    storagelister.CSIDriverLister
	StorageClassLister storagelister.StorageClassLister
}

func (*KubeAPIInterfaceImpl) GetCSIDriver

func (k *KubeAPIInterfaceImpl) GetCSIDriver(name string) (*storagev1.CSIDriver, error)

func (*KubeAPIInterfaceImpl) GetInfrastructure

func (k *KubeAPIInterfaceImpl) GetInfrastructure() *ocpv1.Infrastructure

func (*KubeAPIInterfaceImpl) GetStorageClass

func (k *KubeAPIInterfaceImpl) GetStorageClass(name string) (*storagev1.StorageClass, error)

func (*KubeAPIInterfaceImpl) ListCSINodes

func (k *KubeAPIInterfaceImpl) ListCSINodes() ([]*storagev1.CSINode, error)

func (*KubeAPIInterfaceImpl) ListNodes

func (k *KubeAPIInterfaceImpl) ListNodes() ([]*v1.Node, error)

type NodeChecker

type NodeChecker struct {
	// contains filtered or unexported fields
}

func (*NodeChecker) Check

func (n *NodeChecker) Check(ctx context.Context, checkOpts CheckArgs) []ClusterCheckResult

type VCenterChecker

type VCenterChecker struct{}

func (*VCenterChecker) Check

func (v *VCenterChecker) Check(ctx context.Context, checkOpts CheckArgs) []ClusterCheckResult

Jump to

Keyboard shortcuts

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