Documentation ¶
Index ¶
- Constants
- func APIResourceAsEnvVars(endpoint string, resource *shared.LinstorClientConfig) []corev1.EnvVar
- func DefaultControllerServiceEndpoint(serviceName types.NamespacedName, useHTTPS bool) string
- func Logr(l logr.Logger) lapi.Option
- type GlobalLinstorClientConfig
- type HighLevelClient
- func (c *HighLevelClient) ControllerReachable(ctx context.Context) bool
- func (c *HighLevelClient) GetAllResourcesOnNode(ctx context.Context, nodeName string) ([]lapi.ResourceWithVolumes, error)
- func (c *HighLevelClient) GetAllStorageNodes(ctx context.Context) ([]StorageNode, error)
- func (c *HighLevelClient) GetNodeOrCreate(ctx context.Context, node lapi.Node) (*lapi.Node, error)
- type LinstorClientConfig
- type SecretFetcher
- type StorageNode
Constants ¶
const ( Controller = "CONTROLLER" Satellite = "SATELLITE" Online = "ONLINE" Offline = "OFFLINE" DefaultHTTPPort = 3370 DefaultHTTPSPort = 3371 ControllerReachableTimeout = 10 * time.Second )
Various lapi consts yet to be defined in golinstor.
const ( SecretCARootName = "ca.crt" SecretKeyName = "tls.key" SecretCertName = "tls.crt" )
Consts for extracting TLS certificates from api resources
Variables ¶
This section is empty.
Functions ¶
func APIResourceAsEnvVars ¶ added in v0.4.0
func APIResourceAsEnvVars(endpoint string, resource *shared.LinstorClientConfig) []corev1.EnvVar
Convert a LinstorClientConfig into env variables understood by the CSI plugins and golinstor client See also: https://pkg.go.dev/github.com/LINBIT/golinstor/client?tab=doc#NewClient
func DefaultControllerServiceEndpoint ¶ added in v0.4.0
func DefaultControllerServiceEndpoint(serviceName types.NamespacedName, useHTTPS bool) string
Types ¶
type GlobalLinstorClientConfig ¶ added in v0.4.0
type GlobalLinstorClientConfig struct { // Comma separated list of of LINSTOR REST API endpoints Controllers []string `ini:"controllers" delim:"|"` // Path to the PEM encoded root certificates used for HTTPS connections CAFile string `ini:"cafile,omitempty"` // Path to the PEM encoded certificate to present when TLS authentication is required Certfile string `ini:"certfile,omitempty"` // Path to the PEM encoded private key used when TLS authentication is required Keyfile string `ini:"keyfile,omitempty"` }
Global linstor client configuration, like controllers and connection settings
type HighLevelClient ¶
HighLevelClient is a golinstor client with convience functions.
func NewHighLevelClient ¶
func NewHighLevelClient(options ...lapi.Option) (*HighLevelClient, error)
NewHighLevelClient returns a pointer to a golinstor client with convience.
func NewHighLevelLinstorClientFromConfig ¶ added in v0.4.0
func NewHighLevelLinstorClientFromConfig(endpoint string, config *shared.LinstorClientConfig, secretFetcher SecretFetcher, log logr.Logger) (*HighLevelClient, error)
NewHighLevelLinstorClientFromConfig configures a HighLevelClient with an in-cluster url based on service naming convention.
func (*HighLevelClient) ControllerReachable ¶ added in v1.7.0
func (c *HighLevelClient) ControllerReachable(ctx context.Context) bool
ControllerReachable returns true if the LINSTOR controller is up.
func (*HighLevelClient) GetAllResourcesOnNode ¶
func (c *HighLevelClient) GetAllResourcesOnNode(ctx context.Context, nodeName string) ([]lapi.ResourceWithVolumes, error)
GetAllResourcesOnNode returns a list of all resources on the specified node.
func (*HighLevelClient) GetAllStorageNodes ¶
func (c *HighLevelClient) GetAllStorageNodes(ctx context.Context) ([]StorageNode, error)
GetAllStorageNodes returns a list of all Satellite nodes with a list of their storage pools.
func (*HighLevelClient) GetNodeOrCreate ¶
GetNodeOrCreate gets a linstor node, creating it if it is not already present.
type LinstorClientConfig ¶ added in v0.4.0
type LinstorClientConfig struct {
Global GlobalLinstorClientConfig `ini:"global"`
}
LinstorClientConfig is the go representation of `/etc/linstor/linstor-client.conf`.
func NewClientConfigForAPIResource ¶ added in v0.4.0
func NewClientConfigForAPIResource(endpoint string, resource *shared.LinstorClientConfig) *LinstorClientConfig
Create a client config from an API resource.
func (*LinstorClientConfig) ToConfigFile ¶ added in v0.4.0
func (clientConfig *LinstorClientConfig) ToConfigFile() (string, error)
type SecretFetcher ¶ added in v0.4.0
func NamedSecret ¶ added in v1.7.0
NamedSecret returns a SecretFetcher for the named secret.
type StorageNode ¶
type StorageNode struct { lapi.Node StoragePools []lapi.StoragePool }
StorageNode is a linstor node with its respective storage pools.