Documentation ¶
Index ¶
- Constants
- func GetNodeFromLabelSelector(labels map[string]string) (string, error)
- func ValidatePoolSpec(pool *apis.PoolSpec) bool
- type Builder
- type Config
- func (ac *Config) ClaimBD(bdObj *ndmapis.BlockDevice) error
- func (ac *Config) ClaimBDsForNode(BD []string) error
- func (ac *Config) GetBDListForNode(pool *apis.PoolSpec) []string
- func (c *Config) GetCSPIWithoutDeployment() ([]apis.CStorPoolInstance, error)
- func (ac *Config) GetCSPSpec() (*apis.CStorPoolInstance, error)
- func (c *Config) GetCurrentPoolCount() (int, error)
- func (c *Config) GetPendingPoolCount() (int, error)
- func (ac *Config) GetUsedNode() (map[string]bool, error)
- func (ac *Config) IsClaimedBDUsable(bdAPIObj *ndmapis.BlockDevice) (bool, error)
- func (c *Config) IsPoolPending() bool
- func (ac *Config) SelectNode() (*apis.PoolSpec, string, error)
Constants ¶
const (
// CasTypeCStor is the key for cas type cStor
CasTypeCStor = "cstor"
)
const (
// HostName holds the hostname key for kubernetes node.
HostName = "kubernetes.io/hostname"
)
Variables ¶
This section is empty.
Functions ¶
func GetNodeFromLabelSelector ¶
GetNodeFromLabelSelector returns the node name selected by provided labels TODO : Move it to node package
func ValidatePoolSpec ¶
ValidatePoolSpec validates the pool spec. TODO: Fix following function -- (Current is mock only )
Types ¶
type Builder ¶
type Builder struct { ConfigObj *Config // contains filtered or unexported fields }
Builder embeds the Config object.
func (*Builder) WithCSPC ¶
func (b *Builder) WithCSPC(cspc *apis.CStorPoolCluster) *Builder
WithCSPC sets the CSPC field of the config object with the 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 *apis.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 }
Config embeds CSPC object and namespace where openebs is installed.
func (*Config) ClaimBD ¶
func (ac *Config) ClaimBD(bdObj *ndmapis.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) GetBDListForNode ¶
GetBDListForNode returns a list of BD from the pool spec. TODO : Move it to CStorPoolCluster packgage
func (*Config) GetCSPIWithoutDeployment ¶
func (c *Config) GetCSPIWithoutDeployment() ([]apis.CStorPoolInstance, error)
GetCSPIWithoutDeployment gets the CSPIs for whom the pool deployment does not exists.
func (*Config) GetCSPSpec ¶
func (ac *Config) GetCSPSpec() (*apis.CStorPoolInstance, error)
GetCSPSpec returns a CSPI spec that should be created and claims all the block device present in the CSPI spec
func (*Config) GetCurrentPoolCount ¶
GetCurrentPoolCount give the current pool count for the given CStorPoolCluster.
func (*Config) GetPendingPoolCount ¶
GetPendingPoolCount returns the pending pool count that should be created for the given CStorPoolCluster.
func (*Config) GetUsedNode ¶
GetUsedNode returns a map of node for which pool has already been created. Note : Filter function is not used from node builder package as it needs CSP builder package which cam cause import loops.
func (*Config) IsClaimedBDUsable ¶
func (ac *Config) IsClaimedBDUsable(bdAPIObj *ndmapis.BlockDevice) (bool, error)
IsClaimedBDUsable returns true if the passed BD is already claimed and can be used for provisioning
func (*Config) IsPoolPending ¶
IsPoolPending returns true if pool is pending for creation.