v1

package
v0.0.0-...-977d6ef Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SkipDataPlaneRestartFlag         upgradeFlags = "--skip-data-plane-restart"
	SkipSingleReplicaValidationFlag  upgradeFlags = "--skip-single-replica-volume-validation"
	SkipReplicaRebuildFlag           upgradeFlags = "--skip-replica-rebuild"
	SkipCordonNodeValidationFlag     upgradeFlags = "--skip-cordoned-node-validation"
	AllowUpgradeToUnstableBranchFlag upgradeFlags = "--allow-unstable"
	DisablePartialRebuild            upgradeFlags = "agents.core.rebuild.partial.enabled=false"
)
View Source
const ErrOutput = "Error error"
View Source
const ErrorResponse = "412 Precondition Failed"

Variables

This section is empty.

Functions

func CheckAllMayastorVolumesAreHealthy

func CheckAllMayastorVolumesAreHealthy() error

func CheckForMayastorVolumes

func CheckForMayastorVolumes() (bool, error)

func CheckPluginError

func CheckPluginError(jsonInput []byte, err error) error

func GetClusterRestAPINodeIPs

func GetClusterRestAPINodeIPs() ([]string, error)

GetClusterRestAPINodeIPs return a set of IP addresses which can be used to communicate mayastor using the REST API returns test control nodes IP addresses

func GetMayastorNodeStatus

func GetMayastorNodeStatus(nodeName string) (string, error)

func GetMayastorVolumeChildState

func GetMayastorVolumeChildState(uuid string) (string, error)

func GetMayastorVolumeChildren

func GetMayastorVolumeChildren(volName string) ([]common.TargetChild, error)

func GetMayastorVolumeState

func GetMayastorVolumeState(volName string) (string, error)

func GetMayastorVolumeTargetNode

func GetMayastorVolumeTargetNode(uuid string) (string, error)

func GetPluginPath

func GetPluginPath() string

func GetPluginVersion

func GetPluginVersion() (string, error)

GetPluginVersion returns the kubectl-maystor plugin version this function uses the kubectl-mayastor --version command and filter the output to get plugin version using `awk`

func HasNotFoundRestJsonError

func HasNotFoundRestJsonError(str string) bool

func IsMayastorVolumeDeleted

func IsMayastorVolumeDeleted(uuid string) bool

func IsMayastorVolumePublished

func IsMayastorVolumePublished(uuid string) bool

Types

type CPv1

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

func MakeCP

func MakeCP() (CPv1, error)

func (CPv1) CanDeleteMsv

func (cp CPv1) CanDeleteMsv() bool

func (CPv1) CheckAllMsvsAreHealthy

func (cp CPv1) CheckAllMsvsAreHealthy() error

func (CPv1) CheckForMsvs

func (cp CPv1) CheckForMsvs() (bool, error)

func (CPv1) ChildStateDegraded

func (cp CPv1) ChildStateDegraded() string

func (CPv1) ChildStateFaulted

func (cp CPv1) ChildStateFaulted() string

func (CPv1) ChildStateOnline

func (cp CPv1) ChildStateOnline() string

func (CPv1) ChildStateUnknown

func (cp CPv1) ChildStateUnknown() string

func (CPv1) CordonNode

func (cp CPv1) CordonNode(nodeName string, cordonLabel string) error

func (CPv1) CreatePoolOnInstall

func (cp CPv1) CreatePoolOnInstall() bool

func (CPv1) DeleteMsv

func (cp CPv1) DeleteMsv(volName string) error

func (CPv1) DeleteUpgrade

func (cp CPv1) DeleteUpgrade() error

func (CPv1) DrainNode

func (cp CPv1) DrainNode(nodeName string, drainLabel string, drainTimeOut int) error

DrainNode drain the given node with label

func (CPv1) GetCordonNodeLabels

func (cp CPv1) GetCordonNodeLabels(nodeName string) ([]string, error)

func (CPv1) GetDrainNodeLabels

func (cp CPv1) GetDrainNodeLabels(nodeName string) ([]string, []string, error)

GetDrainNodeLabels returns draining, drained labels and error

func (CPv1) GetMSN

func (cp CPv1) GetMSN(nodeName string) (*common.MayastorNode, error)

GetMSN Get pointer to a mayastor control plane volume returns nil and no error if the msn is in pending state.

func (CPv1) GetMSV

func (cp CPv1) GetMSV(uuid string) (*common.MayastorVolume, error)

GetMSV Get pointer to a mayastor control plane volume returns nil and no error if the msv is in pending state.

func (CPv1) GetMsNodeStatus

func (cp CPv1) GetMsNodeStatus(nodeName string) (string, error)

func (CPv1) GetMsPool

func (cp CPv1) GetMsPool(poolName string) (*common.MayastorPool, error)

GetMsPool Get pointer to a mayastor control plane pool

func (CPv1) GetMsvMaxSnapshotCount

func (cp CPv1) GetMsvMaxSnapshotCount(uuid string) (int32, error)

func (CPv1) GetMsvNexusChildren

func (cp CPv1) GetMsvNexusChildren(volName string) ([]common.TargetChild, error)

func (CPv1) GetMsvNexusState

func (cp CPv1) GetMsvNexusState(uuid string) (string, error)

func (CPv1) GetMsvNodes

func (cp CPv1) GetMsvNodes(uuid string) (string, []string)

GetMsvNodes Retrieve the nexus node hosting the Mayastor Volume, and the names of the replica nodes

func (CPv1) GetMsvReplicaTopology

func (cp CPv1) GetMsvReplicaTopology(volUuid string) (common.ReplicaTopology, error)

func (CPv1) GetMsvReplicas

func (cp CPv1) GetMsvReplicas(volName string) ([]common.MsvReplica, error)

func (CPv1) GetMsvSize

func (cp CPv1) GetMsvSize(uuid string) (int64, error)

func (CPv1) GetMsvState

func (cp CPv1) GetMsvState(uuid string) (string, error)

func (CPv1) GetMsvTargetNode

func (cp CPv1) GetMsvTargetNode(volName string) (string, error)

func (CPv1) GetMsvTargetUuid

func (cp CPv1) GetMsvTargetUuid(uuid string) (string, error)

func (CPv1) GetPerSnapshotVolumeSnapshotTopology

func (cp CPv1) GetPerSnapshotVolumeSnapshotTopology(snapshotId string) (common.SnapshotSchema, error)

func (CPv1) GetSnapshot

func (cp CPv1) GetSnapshot(snapshotId string) (common.SnapshotSchema, error)

func (CPv1) GetSnapshots

func (cp CPv1) GetSnapshots() ([]common.SnapshotSchema, error)

func (CPv1) GetToUpgradeVersion

func (cp CPv1) GetToUpgradeVersion() (string, error)

func (CPv1) GetUpgradeStatus

func (cp CPv1) GetUpgradeStatus() (string, error)

func (CPv1) GetVolumeSnapshot

func (cp CPv1) GetVolumeSnapshot(volUuid string, snapshotId string) (common.SnapshotSchema, error)

func (CPv1) GetVolumeSnapshotTopology

func (cp CPv1) GetVolumeSnapshotTopology() ([]common.SnapshotSchema, error)

func (CPv1) GetVolumeSnapshots

func (cp CPv1) GetVolumeSnapshots(volUuid string) ([]common.SnapshotSchema, error)

func (CPv1) IsMsvDeleted

func (cp CPv1) IsMsvDeleted(uuid string) bool

func (CPv1) IsMsvPublished

func (cp CPv1) IsMsvPublished(uuid string) bool

func (CPv1) IsTimeoutError

func (cp CPv1) IsTimeoutError(err error) bool

func (CPv1) ListMsPools

func (cp CPv1) ListMsPools() ([]common.MayastorPool, error)

func (CPv1) ListMsns

func (cp CPv1) ListMsns() ([]common.MayastorNode, error)

func (CPv1) ListMsvs

func (cp CPv1) ListMsvs() ([]common.MayastorVolume, error)

func (CPv1) ListRestoredMsvs

func (cp CPv1) ListRestoredMsvs() ([]common.MayastorVolume, error)

func (CPv1) MajorVersion

func (cp CPv1) MajorVersion() int

func (CPv1) MspStateOnline

func (cp CPv1) MspStateOnline() string

func (CPv1) NexusStateDegraded

func (cp CPv1) NexusStateDegraded() string

func (CPv1) NexusStateFaulted

func (cp CPv1) NexusStateFaulted() string

func (CPv1) NexusStateOnline

func (cp CPv1) NexusStateOnline() string

func (CPv1) NexusStateUnknown

func (cp CPv1) NexusStateUnknown() string

func (CPv1) NodeStateEmpty

func (cp CPv1) NodeStateEmpty() string

func (CPv1) NodeStateOffline

func (cp CPv1) NodeStateOffline() string

func (CPv1) NodeStateOnline

func (cp CPv1) NodeStateOnline() string

func (CPv1) NodeStateUnknown

func (cp CPv1) NodeStateUnknown() string

func (CPv1) ReplicaStateDegraded

func (cp CPv1) ReplicaStateDegraded() string

func (CPv1) ReplicaStateFaulted

func (cp CPv1) ReplicaStateFaulted() string

func (CPv1) ReplicaStateOnline

func (cp CPv1) ReplicaStateOnline() string

func (CPv1) ReplicaStateUnknown

func (cp CPv1) ReplicaStateUnknown() string

func (CPv1) SetMsvReplicaCount

func (cp CPv1) SetMsvReplicaCount(uuid string, replicaCount int) error

func (CPv1) SetVolumeMaxSnapshotCount

func (cp CPv1) SetVolumeMaxSnapshotCount(uuid string, maxSnapshotCount int32) error

func (CPv1) UnCordonNode

func (cp CPv1) UnCordonNode(nodeName string, cordonLabel string) error

func (CPv1) UpdateNodeLabel

func (cp CPv1) UpdateNodeLabel(nodeName string, labelKey, labelValue string) error

UpdateNodeLabel adds or remove labels from nodes

func (CPv1) Upgrade

func (cp CPv1) Upgrade(isUpgradingToUnstableBranch, isPartialRebuildDisableNeeded bool) (string, error)

This function is to fire upgrade command with kubectl mayastor plugin Syntax is: `kubectl-mayastor upgrade` this function takes one boolean parameter, `isUpgradingToUnstableBranch` this parameters is passed as true if we want to test upgrade to unstable main branch and uses --allow-unstable flag with upgrade command.

func (CPv1) UpgradeWithSkipCordonNodeValidation

func (cp CPv1) UpgradeWithSkipCordonNodeValidation(isUpgradingToUnstableBranch, isPartialRebuildDisableNeeded bool) error

this function takes one boolean parameter, `isUpgradingToUnstableBranch` this parameters is passed as true if we want to test upgrade to unstable main branch and uses --allow-unstable flag with upgrade command.

func (CPv1) UpgradeWithSkipDataPlaneRestart

func (cp CPv1) UpgradeWithSkipDataPlaneRestart(isUpgradingToUnstableBranch, isPartialRebuildDisableNeeded bool) error

This function is for starting upgrade with a flag to skip data plane restart User can manually restart data plane later. During upgrade images will be upgraded but pod restart will be manual process when used this flag. Syntax is: `kubectl-mayastor upgrade --skip-data-plane-restart` this function takes one boolean parameter, `isUpgradingToUnstableBranch` this parameters is passed as true if we want to test upgrade to unstable main branch and uses --allow-unstable flag with upgrade command.

func (CPv1) UpgradeWithSkipReplicaRebuild

func (cp CPv1) UpgradeWithSkipReplicaRebuild(isUpgradingToUnstableBranch, isPartialRebuildDisableNeeded bool) error

This function is to fire upgrade command with kubectl mayastor plugin with --skip-replica-rebuild flag Syntax is: `kubectl-mayastor upgrade --skip-replica-rebuild` this function takes one boolean parameter, `isUpgradingToUnstableBranch` this parameters is passed as true if we want to test upgrade to unstable main branch and uses --allow-unstable flag with upgrade command.

func (CPv1) UpgradeWithSkipSingleReplicaValidation

func (cp CPv1) UpgradeWithSkipSingleReplicaValidation(isUpgradingToUnstableBranch, isPartialRebuildDisableNeeded bool) error

This function is to fire upgrade command with skip single replica volume validation flag Syntax is: `kubectl-mayastor upgrade --skip-single-replica-volume-validation` this function takes one boolean parameter, `isUpgradingToUnstableBranch` this parameters is passed as true if we want to test upgrade to unstable main branch and uses --allow-unstable flag with upgrade command.

func (CPv1) Version

func (cp CPv1) Version() string

func (CPv1) VolStateDegraded

func (cp CPv1) VolStateDegraded() string

func (CPv1) VolStateFaulted

func (cp CPv1) VolStateFaulted() string

func (CPv1) VolStateHealthy

func (cp CPv1) VolStateHealthy() string

func (CPv1) VolStateUnknown

func (cp CPv1) VolStateUnknown() string

type CordonDrainState

type CordonDrainState struct {
	CordonedState *CordonedState `json:"cordonedstate,omitempty"`
	DrainingState *DrainingState `json:"drainingstate,omitempty"`
	DrainedState  *DrainedState  `json:"drainedstate,omitempty"`
}

type CordonedState

type CordonedState struct {
	CordonLabels []string `json:"cordonlabels"`
}

type DrainedState

type DrainedState struct {
	CordonLabels []string `json:"cordonlabels"`
	DrainLabels  []string `json:"drainlabels"`
}

type DrainingState

type DrainingState struct {
	CordonLabels []string `json:"cordonlabels"`
	DrainLabels  []string `json:"drainlabels"`
}

type MayastorCpNode

type MayastorCpNode struct {
	Spec  msnSpec  `json:"spec"`
	State msnState `json:"state"`
}

func GetMayastorCpNode

func GetMayastorCpNode(nodeName string) (*MayastorCpNode, error)

func ListMayastorCpNodes

func ListMayastorCpNodes() ([]MayastorCpNode, error)

type MayastorCpPool

type MayastorCpPool struct {
	Id    string   `json:"id"`
	Spec  mspSpec  `json:"spec"`
	State mspState `json:"state"`
}

func GetMayastorCpPool

func GetMayastorCpPool(name string) (*MayastorCpPool, error)

func ListMayastorCpPools

func ListMayastorCpPools() ([]MayastorCpPool, error)

type NodeCordonLabelsInfo

type NodeCordonLabelsInfo struct {
	Id    string          `json:"id"`
	Spec  NodeCordonSpec  `json:"spec"`
	State NodeCordonState `json:"state"`
}

type NodeCordonSpec

type NodeCordonSpec struct {
	GrpcEndpoint     string            `json:"grpcEndpoint"`
	Id               string            `json:"id"`
	CordonDrainState *CordonDrainState `json:"cordondrainstate,omitempty"`
}

type NodeCordonState

type NodeCordonState struct {
	GrpcEndpoint string `json:"grpcEndpoint"`
	Id           string `json:"id"`
	Status       string `json:"status"`
}

Jump to

Keyboard shortcuts

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