linstorhelper

package
v2.7.1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LastApplyProperty = linstor.NamespcAuxiliary + "/" + vars.ApplyAnnotation
	ManagedByProperty = linstor.NamespcAuxiliary + "/" + vars.ManagedByLabel
)

Variables

View Source
var (
	NodeInterfaceProperty = linstor.NamespcAuxiliary + "/" + vars.NodeInterfaceAnnotation
)

Functions

func Logr

func Logr(l logr.Logger) lapi.Option

func MakePropertiesModification

func MakePropertiesModification(current, expected map[string]string) *lclient.GenericPropsModify

MakePropertiesModification returns the modification that need to be applied to update the current properties.

func PerClusterNodeCache added in v2.5.1

func PerClusterNodeCache(timeout time.Duration) lapi.Option

PerClusterNodeCache creates a node cache for each distinct cluster.

Client(s) pointing to the same URL will share a cache.

func PerClusterRateLimiter added in v2.5.1

func PerClusterRateLimiter(r rate.Limit, b int) lapi.Option

PerClusterRateLimiter creates a rate limiter for each distinct cluster.

Client(s) pointing to the same URL will share a rate limiter.

func UpdateLastApplyProperty

func UpdateLastApplyProperty(props map[string]string) map[string]string

UpdateLastApplyProperty ensures the LastApplyProperty is up-to-date.

Types

type Client

type Client struct {
	lapi.Client
}

Client is a LINSTOR client with convenience functions.

func NewClientForCluster

func NewClientForCluster(ctx context.Context, cl client.Client, namespace, clusterName, clientSecretName string, caRef *piraeusv1.CAReference, externalCluster *piraeusv1.LinstorExternalControllerRef, options ...lapi.Option) (*Client, error)

NewClientForCluster returns a LINSTOR client for a LINSTOR Controller managed by the operator.

func (*Client) CreateOrUpdateNode

func (c *Client) CreateOrUpdateNode(ctx context.Context, node lapi.Node) (*lapi.Node, error)

CreateOrUpdateNode ensures a node in LINSTOR matches the given node object.

Jump to

Keyboard shortcuts

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