cstorvolumeconfig

package
v1.12.1 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2020 License: Apache-2.0 Imports: 50 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SuccessSynced is used as part of the Event 'reason' when a
	// cstorvolumeconfig is synced
	SuccessSynced = "Synced"
	// Provisioning is used as part of the Event 'reason' when a
	// cstorvolumeconfig is in provisioning stage
	Provisioning = "Provisioning"
	// ErrResourceExists is used as part of the Event 'reason' when a
	// cstorvolumeconfig fails to sync due to a cstorvolumeconfig of the same
	// name already existing.
	ErrResourceExists = "ErrResourceExists"
	// MessageResourceExists is the message used for Events when a resource
	// fails to sync due to a cstorvolumeconfig already existing
	MessageResourceExists = "Resource %q already exists and is not managed by CVC"
	// MessageResourceSynced is the message used for an Event fired when a
	// cstorvolumeconfig is synced successfully
	MessageResourceSynced = "cstorvolumeconfig synced successfully"
	// MessageResourceCreated msg used for cstor volume provisioning success event
	MessageResourceCreated = "cstorvolumeconfig created successfully"
	// MessageCVCPublished msg used for cstor volume provisioning publish events
	MessageCVCPublished = "cstorvolumeconfig %q must be published/attached on node"
	// CStorVolumeConfigFinalizer name of finalizer on CStorVolumeConfig that
	// are bound by CStorVolume
	CStorVolumeConfigFinalizer = "cvc.openebs.io/finalizer"
	// DeProvisioning is used as part of the event 'reason' during
	// cstorvolumeconfig deprovisioning stage
	DeProvisioning = "DeProvisioning"
)
View Source
const (

	// ReplicaCount represents replica count value
	ReplicaCount = "replicaCount"
)

Variables

View Source
var (

	// TargetContainerName is the name of cstor target container name
	TargetContainerName = "cstor-istgt"
	// MonitorContainerName is the name of monitor container name
	MonitorContainerName = "maya-volume-exporter"
	// MgmtContainerName is the container name of cstor volume mgmt side car
	MgmtContainerName = "cstor-volume-mgmt"
)

Functions

func BaseLabels

func BaseLabels(cvc *apis.CStorVolumeConfig) map[string]string

BaseLabels returns the base labels we apply to cstorvolumereplicas created

func GetCVRList

func GetCVRList(clientset clientset.Interface, pvName, namespace string) (*apis.CStorVolumeReplicaList, error)

GetCVRList returns list of volume replicas related to provided volume

func GetPDBLabelSelector

func GetPDBLabelSelector(poolNames []string) string

GetPDBLabelSelector returns the labelSelector to list the PDB

func GetPDBLabels

func GetPDBLabels(poolNames []string, cspcName string) map[string]string

GetPDBLabels returns the labels required for building PDB based on arguments

func GetPDBPoolLabels

func GetPDBPoolLabels(poolNames []string) map[string]string

GetPDBPoolLabels returns the pool labels from poolNames

func GetVolumeReplicaPoolNames

func GetVolumeReplicaPoolNames(clientset clientset.Interface, pvName, namespace string) ([]string, error)

GetVolumeReplicaPoolNames return list of replicas pool names by taking pvName and namespace(where pool is installed) as a input and return error(if any error occured)

func MergeResizeConditionsOfCVC

func MergeResizeConditionsOfCVC(oldConditions, resizeConditions []apis.CStorVolumeConfigCondition) []apis.CStorVolumeConfigCondition

MergeResizeConditionsOfCVC updates cvc with desired resize conditions leaving other conditions untouched.

func Start

func Start() error

Start starts the cstorvolumeclaim controller.

Types

type CVCController

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

CVCController is the controller implementation for CVC resources

func (*CVCController) BuildTargetDeployment

func (c *CVCController) BuildTargetDeployment(
	vol *apis.CStorVolume,
	policySpec *apis.CStorVolumePolicySpec,
) (*appsv1.Deployment, error)

BuildTargetDeployment builds the target deploytment object for a given volume and policy

func (*CVCController) IsCVRPending

func (c *CVCController) IsCVRPending(cvc *apis.CStorVolumeConfig) (bool, error)

IsCVRPending look for pending cstorvolume replicas compared to desired replica count. returns true if count doesn't matches.

func (*CVCController) PatchCVCStatus

func (c *CVCController) PatchCVCStatus(oldCVC,
	newCVC *apis.CStorVolumeConfig,
) (*apis.CStorVolumeConfig, error)

PatchCVCStatus updates CVC status using patch api

func (*CVCController) Run

func (c *CVCController) Run(threadiness int, stopCh <-chan struct{})

Run will set up the event handlers for types we are interested in, as well as syncing informer caches and starting workers. It will block until stopCh is closed, at which point it will shutdown the workqueue and wait for workers to finish processing their current work items.

func (*CVCController) ShouldReconcile

func (c *CVCController) ShouldReconcile(cvc *apis.CStorVolumeConfig) (bool, string)

type CVCControllerBuilder

type CVCControllerBuilder struct {
	CVCController *CVCController
}

CVCControllerBuilder is the builder object for controller.

func NewCVCControllerBuilder

func NewCVCControllerBuilder() *CVCControllerBuilder

NewCVCControllerBuilder returns an empty instance of controller builder.

func (*CVCControllerBuilder) Build

func (cb *CVCControllerBuilder) Build() (*CVCController, error)

Build returns a controller instance.

type Patch

type Patch struct {
	Op    string `json:"op"`
	Path  string `json:"path"`
	Value string `json:"value"`
}

Patch struct represent the struct used to patch the cstorvolumeconfig object

type ServerOptions added in v1.11.0

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

ServerOptions holds information to start the CVC server

Jump to

Keyboard shortcuts

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