Documentation
¶
Index ¶
- Constants
- func ActionToString(a CheckAction) string
- func CheckClusterStatus(result ClusterCheckResult, apiDependencies KubeAPIInterface) (ClusterCheckStatus, ClusterCheckResult)
- type CheckAction
- type CheckArgs
- type CheckExistingDriver
- type CheckInterface
- type CheckStatusType
- type ClusterCheckResult
- func MakeClusterCheckResultPass() ClusterCheckResult
- func MakeClusterDegradedError(checkStatus CheckStatusType, reason error) ClusterCheckResult
- func MakeClusterUnupgradeableError(checkStatus CheckStatusType, reason error) ClusterCheckResult
- func MakeGenericVCenterAPIError(reason error) ClusterCheckResult
- type ClusterCheckStatus
- type KubeAPIInterface
- type KubeAPIInterfaceImpl
- func (k *KubeAPIInterfaceImpl) GetCSIDriver(name string) (*storagev1.CSIDriver, error)
- func (k *KubeAPIInterfaceImpl) GetClusterCSIDriver(name string) (*opv1.ClusterCSIDriver, error)
- func (k *KubeAPIInterfaceImpl) GetInfrastructure() *ocpv1.Infrastructure
- func (k *KubeAPIInterfaceImpl) GetStorageClass(name string) (*storagev1.StorageClass, error)
- func (k *KubeAPIInterfaceImpl) ListCSINodes() ([]*storagev1.CSINode, error)
- func (k *KubeAPIInterfaceImpl) ListLinuxNodes() ([]*v1.Node, error)
- type NodeChecker
- type VCenterChecker
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, gates featuregates.FeatureGate) 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" CheckStatusBlockVolumeLimitError CheckStatusType = "block_volume_limit_error" CheckStatusNonVSphereNode CheckStatusType = "non_vsphere_node" )
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 {
// ListLinuxNodes returns list of all linux nodes in the cluster.
ListLinuxNodes() ([]*v1.Node, error)
GetCSIDriver(name string) (*storagev1.CSIDriver, error)
GetClusterCSIDriver(name string) (*opv1.ClusterCSIDriver, 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
ClusterCSIDriverLister clustercsidriverlister.ClusterCSIDriverLister
StorageClassLister storagelister.StorageClassLister
}
func (*KubeAPIInterfaceImpl) GetCSIDriver ¶
func (k *KubeAPIInterfaceImpl) GetCSIDriver(name string) (*storagev1.CSIDriver, error)
func (*KubeAPIInterfaceImpl) GetClusterCSIDriver ¶
func (k *KubeAPIInterfaceImpl) GetClusterCSIDriver(name string) (*opv1.ClusterCSIDriver, 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) ListLinuxNodes ¶
func (k *KubeAPIInterfaceImpl) ListLinuxNodes() ([]*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
Click to show internal directories.
Click to hide internal directories.