Documentation ¶
Index ¶
- Constants
- func BDCHasLabel(labelKey, labelValue string, bdc openebsio.BlockDeviceClaim) bool
- func ByteCount(b uint64) string
- func GetBDListForNode(pool cstor.PoolSpec) []string
- func GetCSPCOwnerReference(cspc *cstor.CStorPoolCluster) metav1.OwnerReference
- func GetCapacity(capacity string) (resource.Quantity, error)
- func IsBlockDeviceClaimed(bd openebsio.BlockDevice) bool
- type Builder
- type Config
- func (ac *Config) ClaimBD(bdObj openebsio.BlockDevice) error
- func (ac *Config) ClaimBDsForNode(BD []string) error
- func (ac *Config) GetCSPISpec() (*cstor.CStorPoolInstance, error)
- func (ac *Config) GetNodeFromLabelSelector(labels map[string]string) (string, error)
- func (c *Config) GetPoolDeploySpec(cspi *cstor.CStorPoolInstance) *appsv1.Deployment
- func (ac *Config) GetStoredCStorVersionClient() cstorstoredversion.CstorV1Interface
- func (ac *Config) GetStoredOpenEBSVersionClient() openebsstoredversion.OpenebsV1alpha1Interface
- func (ac *Config) GetUsedNodes() (map[string]bool, error)
- func (ac *Config) IsClaimedBDUsable(bd openebsio.BlockDevice) (bool, error)
- func (ac *Config) SelectNode() (*cstor.PoolSpec, string, error)
Constants ¶
const ( // StoragePoolKindCSPC holds the value of CStorPoolCluster StoragePoolKindCSPC = "CStorPoolCluster" ApiVersion = "cstor.openebs.io/v1" )
const ( // PoolMgmtContainerName is the name of cstor target container name PoolMgmtContainerName = "cstor-pool-mgmt" // PoolContainerName is the name of cstor target container name PoolContainerName = "cstor-pool" // PoolExporterContainerName is the name of cstor target container name PoolExporterContainerName = "maya-exporter" )
Variables ¶
This section is empty.
Functions ¶
func BDCHasLabel ¶
func BDCHasLabel(labelKey, labelValue string, bdc openebsio.BlockDeviceClaim) bool
BDCHasLabel returns true if the provided key,value exists as label on block device claim.
func GetBDListForNode ¶
GetBDListForNode returns a list of BD from the pool spec.
func GetCSPCOwnerReference ¶
func GetCSPCOwnerReference(cspc *cstor.CStorPoolCluster) metav1.OwnerReference
func IsBlockDeviceClaimed ¶
func IsBlockDeviceClaimed(bd openebsio.BlockDevice) bool
IsBlockDeviceClaimed returns true if the provided block devie is claimed.
Types ¶
type Builder ¶
type Builder struct { ConfigObj *Config // contains filtered or unexported fields }
Builder embeds the Config object.
func NewBuilder ¶
func NewBuilder() *Builder
NewBuilder returns an empty instance of Builder object ToDo: Add openebs and kube client set
func (*Builder) WithCSPC ¶
func (b *Builder) WithCSPC(cspc *cstor.CStorPoolCluster) *Builder
WithCSPC sets the CSPC field of the config object with the provided value.
func (*Builder) WithKubeClient ¶
func (b *Builder) WithKubeClient(kc kubernetes.Interface) *Builder
WithKubeClient sets the kubeclientset field of config object with provided value.
func (*Builder) WithNameSpace ¶
WithNameSpace sets the Namespace field of config object with provided value.
type Config ¶
type Config struct { // CSPC is the CStorPoolCluster object. CSPC *cstor.CStorPoolCluster // Namespace is the namespace where openebs is installed. Namespace string // VisitedNodes is a map which contains the node names which has already been // processed for pool provisioning VisitedNodes map[string]bool // GetSpec returns the CSPI spec. Useful in unit testing. GetSpec func() (*cstor.CStorPoolInstance, error) // Select selects a node for CSPI. Useful in unit testing. Select func() (*cstor.PoolSpec, string, error) // contains filtered or unexported fields }
Config embeds CSPC object and namespace where openebs is installed.
func (*Config) ClaimBD ¶
func (ac *Config) ClaimBD(bdObj openebsio.BlockDevice) error
ClaimBD claims a given BlockDevice
func (*Config) ClaimBDsForNode ¶
ClaimBDsForNode claims a given BlockDevice for node If the block device(s) is/are already claimed for any other CSPC it returns error. If the block device(s) is/are already calimed for the same CSPC -- it is left as it is and can be used for pool provisioning. If the block device(s) is/are unclaimed, then those are claimed.
func (*Config) GetCSPISpec ¶
func (ac *Config) GetCSPISpec() (*cstor.CStorPoolInstance, error)
GetCSPSpec returns a CSPI spec that should be created and claims all the block device present in the CSPI spec
func (*Config) GetNodeFromLabelSelector ¶
GetNodeFromLabelSelector returns the node name selected by provided labels
func (*Config) GetPoolDeploySpec ¶
func (c *Config) GetPoolDeploySpec(cspi *cstor.CStorPoolInstance) *appsv1.Deployment
GetPoolDeploySpec returns the pool deployment spec.
func (*Config) GetStoredCStorVersionClient ¶
func (ac *Config) GetStoredCStorVersionClient() cstorstoredversion.CstorV1Interface
func (*Config) GetStoredOpenEBSVersionClient ¶
func (ac *Config) GetStoredOpenEBSVersionClient() openebsstoredversion.OpenebsV1alpha1Interface
func (*Config) GetUsedNodes ¶
GetUsedNode returns a map of node for which pool has already been created.
func (*Config) IsClaimedBDUsable ¶
func (ac *Config) IsClaimedBDUsable(bd openebsio.BlockDevice) (bool, error)
IsClaimedBDUsable returns true if the passed BD is already claimed and can be used for provisioning