datastore

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2021 License: Apache-2.0 Imports: 44 Imported by: 4

Documentation

Index

Constants

View Source
const (
	// KubeStatusPollCount is the number of retry to validate The KubernetesStatus
	KubeStatusPollCount = 5
	// KubeStatusPollInterval is the waiting time between each KubeStatusPollCount
	KubeStatusPollInterval = 1 * time.Second

	PodProbeInitialDelay             = 3
	PodProbeTimeoutSeconds           = PodProbePeriodSeconds - 1
	PodProbePeriodSeconds            = 5
	PodLivenessProbeFailureThreshold = 3
)
View Source
const (
	// NameMaximumLength restricted the length due to Kubernetes name limitation
	NameMaximumLength = 40

	MaxRecurringJobRetain = 50
)

Variables

View Source
var (

	// VerificationRetryInterval is the wait time for each verification retries
	VerificationRetryInterval = 100 * time.Millisecond
	// VerificationRetryCounts is the number of times to retry for verification
	VerificationRetryCounts = 20
)
View Source
var (
	// SkipListerCheck bypass the created longhorn resource validation
	SkipListerCheck = false
)

Functions

func CheckInstanceManagerType added in v0.6.0

func CheckInstanceManagerType(im *longhorn.InstanceManager) (types.InstanceManagerType, error)

CheckInstanceManagerType checks and returns InstanceManager labels type Returns error if the InstanceManager type is not engine or replica

func ErrorIsConflict added in v0.5.0

func ErrorIsConflict(err error) bool

ErrorIsConflict checks if given error match metav1.StatusReasonConflict

func ErrorIsNotFound added in v0.3.1

func ErrorIsNotFound(err error) bool

ErrorIsNotFound checks if given error match metav1.StatusReasonNotFound

func FixupRecurringJob added in v1.2.0

func FixupRecurringJob(v *longhorn.Volume) error

func GetOwnerReferencesForBackingImage added in v1.2.0

func GetOwnerReferencesForBackingImage(backingImage *longhorn.BackingImage) []metav1.OwnerReference

GetOwnerReferencesForBackingImage returns OwnerReference for the given backing image name and UID

func GetOwnerReferencesForBackingImageDataSource added in v1.2.0

func GetOwnerReferencesForBackingImageDataSource(backingImageDataSource *longhorn.BackingImageDataSource) []metav1.OwnerReference

GetOwnerReferencesForBackingImageDataSource returns OwnerReference for the given backing image data source name and UID

func GetOwnerReferencesForBackingImageManager added in v1.1.1

func GetOwnerReferencesForBackingImageManager(backingImageManager *longhorn.BackingImageManager) []metav1.OwnerReference

GetOwnerReferencesForBackingImageManager returns OwnerReference for the given // backing image manager name and UID

func GetOwnerReferencesForEngineImage added in v0.7.0

func GetOwnerReferencesForEngineImage(ei *longhorn.EngineImage) []metav1.OwnerReference

GetOwnerReferencesForEngineImage returns OwnerReference for the given Longhorn EngineImage name and UID

func GetOwnerReferencesForInstanceManager added in v0.7.0

func GetOwnerReferencesForInstanceManager(im *longhorn.InstanceManager) []metav1.OwnerReference

GetOwnerReferencesForInstanceManager returns OwnerReference for the given instance Manager name and UID

func GetOwnerReferencesForNode added in v0.8.0

func GetOwnerReferencesForNode(node *longhorn.Node) []metav1.OwnerReference

GetOwnerReferencesForNode returns a list contains a single OwnerReference for the given Node ID and name

func GetOwnerReferencesForRecurringJob added in v1.2.0

func GetOwnerReferencesForRecurringJob(recurringJob *longhorn.RecurringJob) []metav1.OwnerReference

GetOwnerReferencesForRecurringJob returns a list contains single OwnerReference for the given recurringJob name

func GetOwnerReferencesForShareManager added in v1.1.0

func GetOwnerReferencesForShareManager(sm *longhorn.ShareManager, isController bool) []metav1.OwnerReference

GetOwnerReferencesForShareManager returns OwnerReference for the given share manager name and UID

func GetOwnerReferencesForVolume added in v0.7.0

func GetOwnerReferencesForVolume(v *longhorn.Volume) []metav1.OwnerReference

GetOwnerReferencesForVolume returns a list contains single OwnerReference for the given volume UID and name

func NewPVCManifest added in v0.8.1

func NewPVCManifest(size int64, pvName, ns, pvcName, storageClassName string, accessMode corev1.PersistentVolumeAccessMode) *corev1.PersistentVolumeClaim

NewPVCManifest returns a new PersistentVolumeClaim object

func NewPVCManifestForVolume added in v1.1.0

func NewPVCManifestForVolume(v *longhorn.Volume, pvName, ns, pvcName, storageClassName string) *corev1.PersistentVolumeClaim

NewPVCManifestForVolume returns a new PersistentVolumeClaim object for a longhorn volume

func NewPVManifest added in v0.8.1

func NewPVManifest(size int64, pvName, volumeName, storageClassName, fsType string, volAttributes map[string]string, accessMode corev1.PersistentVolumeAccessMode) *corev1.PersistentVolume

NewPVManifest returns a new PersistentVolume object

func NewPVManifestForVolume added in v1.1.0

func NewPVManifestForVolume(v *longhorn.Volume, pvName, storageClassName, fsType string) *corev1.PersistentVolume

NewPVManifestForVolume returns a new PersistentVolume object for a longhorn volume

func ReplicaAddressToReplicaName added in v1.0.0

func ReplicaAddressToReplicaName(address string, rs []*longhorn.Replica) string

ReplicaAddressToReplicaName will directly return the address if the format is invalid or the replica is not found.

func ValidateRecurringJob added in v1.2.0

func ValidateRecurringJob(job types.RecurringJobSpec) error

func ValidateRecurringJobs added in v1.2.0

func ValidateRecurringJobs(jobs []types.RecurringJobSpec) error

Types

type DataStore

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

DataStore object

func NewDataStore

func NewDataStore(
	volumeInformer lhinformers.VolumeInformer,
	engineInformer lhinformers.EngineInformer,
	replicaInformer lhinformers.ReplicaInformer,
	engineImageInformer lhinformers.EngineImageInformer,
	nodeInformer lhinformers.NodeInformer,
	settingInformer lhinformers.SettingInformer,
	imInformer lhinformers.InstanceManagerInformer,
	smInformer lhinformers.ShareManagerInformer,
	biInformer lhinformers.BackingImageInformer,
	bimInformer lhinformers.BackingImageManagerInformer,
	bidsInformer lhinformers.BackingImageDataSourceInformer,
	btInformer lhinformers.BackupTargetInformer,
	bvInformer lhinformers.BackupVolumeInformer,
	bInformer lhinformers.BackupInformer,
	rjInformer lhinformers.RecurringJobInformer,
	lhClient lhclientset.Interface,

	podInformer coreinformers.PodInformer,
	cronJobInformer batchinformers_v1beta1.CronJobInformer,
	daemonSetInformer appsinformers.DaemonSetInformer,
	deploymentInformer appsinformers.DeploymentInformer,
	persistentVolumeInformer coreinformers.PersistentVolumeInformer,
	persistentVolumeClaimInformer coreinformers.PersistentVolumeClaimInformer,
	configMapInformer coreinformers.ConfigMapInformer,
	secretInformer coreinformers.SecretInformer,
	kubeNodeInformer coreinformers.NodeInformer,
	priorityClassInformer schedulinginformers.PriorityClassInformer,
	csiDriverInformer storageinformers_v1.CSIDriverInformer,
	storageclassInformer storageinformers_v1.StorageClassInformer,
	pdbInformer policyinformers.PodDisruptionBudgetInformer,
	serviceInformer coreinformers.ServiceInformer,

	kubeClient clientset.Interface,
	namespace string) *DataStore

NewDataStore creates new DataStore object

func (*DataStore) CheckEngineImageReadiness added in v1.1.1

func (s *DataStore) CheckEngineImageReadiness(image string, nodes ...string) (isReady bool, err error)

CheckEngineImageReadiness return true if the engine IMAGE is deployed on all nodes in the NODES list

func (*DataStore) CheckEngineImageReadyOnAllVolumeReplicas added in v1.1.1

func (s *DataStore) CheckEngineImageReadyOnAllVolumeReplicas(image, volumeName, nodeID string) (bool, error)

CheckEngineImageReadyOnAllVolumeReplicas checks if the IMAGE is deployed on the NODEID as well as all the volume's replicas

func (*DataStore) CheckEngineImageReadyOnAtLeastOneVolumeReplica added in v1.1.1

func (s *DataStore) CheckEngineImageReadyOnAtLeastOneVolumeReplica(image, volumeName, nodeID string) (bool, error)

CheckEngineImageReadyOnAtLeastOneVolumeReplica checks if the IMAGE is deployed on the NODEID and on at least one of the the volume's replicas

func (*DataStore) CreateBackingImage added in v1.1.1

func (s *DataStore) CreateBackingImage(backingImage *longhorn.BackingImage) (*longhorn.BackingImage, error)

CreateBackingImage creates a Longhorn BackingImage resource and verifies creation

func (*DataStore) CreateBackingImageDataSource added in v1.2.0

func (s *DataStore) CreateBackingImageDataSource(backingImageDataSource *longhorn.BackingImageDataSource) (*longhorn.BackingImageDataSource, error)

CreateBackingImageDataSource creates a Longhorn BackingImageDataSource resource and verifies creation

func (*DataStore) CreateBackingImageManager added in v1.1.1

func (s *DataStore) CreateBackingImageManager(backingImageManager *longhorn.BackingImageManager) (*longhorn.BackingImageManager, error)

CreateBackingImageManager creates a Longhorn BackingImageManager resource and verifies creation

func (*DataStore) CreateBackup added in v1.2.0

func (s *DataStore) CreateBackup(backup *longhorn.Backup, backupVolumeName string) (*longhorn.Backup, error)

CreateBackup creates a Longhorn Backup CR and verifies creation

func (*DataStore) CreateBackupTarget added in v1.2.0

func (s *DataStore) CreateBackupTarget(backupTarget *longhorn.BackupTarget) (*longhorn.BackupTarget, error)

CreateBackupTarget creates a Longhorn BackupTargets CR and verifies creation

func (*DataStore) CreateBackupVolume added in v1.2.0

func (s *DataStore) CreateBackupVolume(backupVolume *longhorn.BackupVolume) (*longhorn.BackupVolume, error)

CreateBackupVolume creates a Longhorn BackupVolumes CR and verifies creation

func (*DataStore) CreateCronJob added in v1.2.0

func (s *DataStore) CreateCronJob(cronJob *batchv1beta1.CronJob) (*batchv1beta1.CronJob, error)

CreateCronJob creates a CronJob resource

func (*DataStore) CreateDefaultNode

func (s *DataStore) CreateDefaultNode(name string) (*longhorn.Node, error)

CreateDefaultNode will create the default Disk at the value of the DefaultDataPath Setting only if Create Default Disk on Labeled Nodes has been disabled.

func (*DataStore) CreateEngine

func (s *DataStore) CreateEngine(e *longhorn.Engine) (*longhorn.Engine, error)

CreateEngine creates a Longhorn Engine resource and verifies creation

func (*DataStore) CreateEngineImage

func (s *DataStore) CreateEngineImage(img *longhorn.EngineImage) (*longhorn.EngineImage, error)

CreateEngineImage creates a Longhorn EngineImage resource and verifies creation

func (*DataStore) CreateEngineImageDaemonSet

func (s *DataStore) CreateEngineImageDaemonSet(ds *appsv1.DaemonSet) error

CreateEngineImageDaemonSet sets EngineImage labels in DaemonSet label and creates a DaemonSet resource in the given namespace

func (*DataStore) CreateInstanceManager added in v0.6.0

func (s *DataStore) CreateInstanceManager(im *longhorn.InstanceManager) (*longhorn.InstanceManager, error)

CreateInstanceManager creates a Longhorn InstanceManager resource and verifies creation

func (*DataStore) CreateNode

func (s *DataStore) CreateNode(node *longhorn.Node) (*longhorn.Node, error)

CreateNode creates a Longhorn Node resource and verifies creation

func (*DataStore) CreatePDB added in v1.1.0

CreatePDB creates a PodDisruptionBudget resource for the given PDB object and namespace

func (*DataStore) CreatePersistentVolume added in v1.1.2

func (s *DataStore) CreatePersistentVolume(pv *corev1.PersistentVolume) (*corev1.PersistentVolume, error)

CreatePersistentVolume creates a PersistentVolume resource for the given PersistentVolume object

func (*DataStore) CreatePersistentVolumeClaim added in v1.1.2

func (s *DataStore) CreatePersistentVolumeClaim(ns string, pvc *corev1.PersistentVolumeClaim) (*corev1.PersistentVolumeClaim, error)

CreatePersistentVolumeClaim creates a PersistentVolumeClaim resource for the given PersistentVolumeclaim object and namespace

func (*DataStore) CreatePod added in v0.6.0

func (s *DataStore) CreatePod(pod *corev1.Pod) (*corev1.Pod, error)

CreatePod creates a Pod resource for the given pod object and namespace

func (*DataStore) CreateRecurringJob added in v1.2.0

func (s *DataStore) CreateRecurringJob(recurringJob *longhorn.RecurringJob) (*longhorn.RecurringJob, error)

CreateRecurringJob creates a Longhorn RecurringJob resource and verifies creation

func (*DataStore) CreateReplica

func (s *DataStore) CreateReplica(r *longhorn.Replica) (*longhorn.Replica, error)

CreateReplica creates a Longhorn Replica resource and verifies creation

func (*DataStore) CreateService added in v1.1.0

func (s *DataStore) CreateService(ns string, service *corev1.Service) (*corev1.Service, error)

CreateService creates a Service resource for the given CreateService object and namespace

func (*DataStore) CreateSetting

func (s *DataStore) CreateSetting(setting *longhorn.Setting) (*longhorn.Setting, error)

CreateSetting create a Longhorn Settings resource for the given setting and namespace

func (*DataStore) CreateShareManager added in v1.1.0

func (s *DataStore) CreateShareManager(sm *longhorn.ShareManager) (*longhorn.ShareManager, error)

CreateShareManager creates a Longhorn ShareManager resource and verifies creation

func (*DataStore) CreateStorageClass added in v1.1.0

func (s *DataStore) CreateStorageClass(sc *storagev1.StorageClass) (*storagev1.StorageClass, error)

CreateStorageClass creates StorageClass with the given object

func (*DataStore) CreateVolume

func (s *DataStore) CreateVolume(v *longhorn.Volume) (*longhorn.Volume, error)

CreateVolume creates a Longhorn Volume resource and verifies creation

func (*DataStore) DeleteAllBackupsForBackupVolume added in v1.2.0

func (s *DataStore) DeleteAllBackupsForBackupVolume(backupVolumeName string) error

DeleteAllBackupsForBackupVolume won't result in immediately deletion since finalizer was set by default

func (*DataStore) DeleteBackingImage added in v1.1.1

func (s *DataStore) DeleteBackingImage(name string) error

DeleteBackingImage won't result in immediately deletion since finalizer was set by default

func (*DataStore) DeleteBackingImageDataSource added in v1.2.0

func (s *DataStore) DeleteBackingImageDataSource(name string) error

DeleteBackingImageDataSource won't result in immediately deletion since finalizer was set by default

func (*DataStore) DeleteBackingImageManager added in v1.1.1

func (s *DataStore) DeleteBackingImageManager(name string) error

DeleteBackingImageManager won't result in immediately deletion since finalizer was set by default

func (*DataStore) DeleteBackup added in v1.2.0

func (s *DataStore) DeleteBackup(backupName string) error

DeleteBackup won't result in immediately deletion since finalizer was set by default

func (*DataStore) DeleteBackupTarget added in v1.2.0

func (s *DataStore) DeleteBackupTarget(backupTargetName string) error

DeleteBackupTarget won't result in immediately deletion since finalizer was set by default

func (*DataStore) DeleteBackupVolume added in v1.2.0

func (s *DataStore) DeleteBackupVolume(backupVolumeName string) error

DeleteBackupVolume won't result in immediately deletion since finalizer was set by default

func (*DataStore) DeleteCSIDriver added in v0.7.0

func (s *DataStore) DeleteCSIDriver(name string) error

DeleteCSIDriver deletes CSIDriver for the given name and namespace

func (*DataStore) DeleteCronJob

func (s *DataStore) DeleteCronJob(cronJobName string) error

DeleteCronJob delete CronJob for the given name and namespace. The dependents will be deleted in the background

func (*DataStore) DeleteDaemonSet added in v0.3.2

func (s *DataStore) DeleteDaemonSet(name string) error

DeleteDaemonSet deletes DaemonSet for the given name and namespace. The dependents will be deleted in the foreground

func (*DataStore) DeleteDeployment added in v0.4.0

func (s *DataStore) DeleteDeployment(name string) error

DeleteDeployment deletes Deployment for the given name and namespace. The dependents will be deleted in the foreground

func (*DataStore) DeleteEngine

func (s *DataStore) DeleteEngine(name string) error

DeleteEngine won't result in immediately deletion since finalizer was set by default

func (*DataStore) DeleteEngineImage

func (s *DataStore) DeleteEngineImage(name string) error

DeleteEngineImage won't result in immediately deletion since finalizer was set by default

func (*DataStore) DeleteInstanceManager added in v0.6.0

func (s *DataStore) DeleteInstanceManager(name string) error

DeleteInstanceManager deletes the InstanceManager. The dependents will be deleted in the foreground

func (*DataStore) DeleteLease added in v1.1.0

func (s *DataStore) DeleteLease(name string) error

DeleteLease deletes Lease with the given name in s.namespace

func (*DataStore) DeleteNode added in v0.3.1

func (s *DataStore) DeleteNode(name string) error

DeleteNode deletes Node for the given name and namespace

func (*DataStore) DeletePDB added in v1.1.0

func (s *DataStore) DeletePDB(name string) error

DeletePDB deletes PodDisruptionBudget for the given name and namespace

func (*DataStore) DeletePersistentVolume added in v1.1.2

func (s *DataStore) DeletePersistentVolume(pvName string) error

DeletePersistentVolume deletes the PersistentVolume for the given PersistentVolume name

func (*DataStore) DeletePersistentVolumeClaim added in v1.1.2

func (s *DataStore) DeletePersistentVolumeClaim(ns, pvcName string) error

DeletePersistentVolumeClaim deletes the PersistentVolumeClaim for the given name and namespace

func (*DataStore) DeletePod added in v0.6.0

func (s *DataStore) DeletePod(name string) error

DeletePod deletes Pod for the given name and namespace

func (*DataStore) DeleteRecurringJob added in v1.2.0

func (s *DataStore) DeleteRecurringJob(name string) error

DeleteRecurringJob deletes the RecurringJob. The dependents will be deleted in the foreground

func (*DataStore) DeleteReplica

func (s *DataStore) DeleteReplica(name string) error

DeleteReplica won't result in immediately deletion since finalizer was set by default

func (*DataStore) DeleteService added in v1.1.0

func (s *DataStore) DeleteService(namespace, name string) error

DeleteService deletes the Service for the given name and namespace

func (*DataStore) DeleteShareManager added in v1.1.0

func (s *DataStore) DeleteShareManager(name string) error

DeleteShareManager won't result in immediately deletion since finalizer was set by default

func (*DataStore) DeleteStorageClass added in v1.1.0

func (s *DataStore) DeleteStorageClass(scName string) error

DeleteStorageClass deletes StorageClass with the given name

func (*DataStore) DeleteVolume

func (s *DataStore) DeleteVolume(name string) error

DeleteVolume won't result in immediately deletion since finalizer was set by default

func (*DataStore) GetAllConfigMaps added in v0.6.2

func (s *DataStore) GetAllConfigMaps() (runtime.Object, error)

GetAllConfigMaps returns an uncached list of configmaps for the given namespace directly from the API server. Using cached informers should be preferred but current lister doesn't have a field selector. Direct retrieval from the API server should only be used for one-shot tasks. For example, support bundle creation

func (*DataStore) GetAllCronJobsList added in v0.4.0

func (s *DataStore) GetAllCronJobsList() (runtime.Object, error)

GetAllCronJobsList returns an uncached list of cronjobs for the given namespace directly from the API server. Using cached informers should be preferred but current lister doesn't have a field selector. Direct retrieval from the API server should only be used for one-shot tasks. For example, support bundle creation

func (*DataStore) GetAllDaemonSetsList added in v0.4.0

func (s *DataStore) GetAllDaemonSetsList() (runtime.Object, error)

GetAllDaemonSetsList returns an uncached list of daemonsets for the given namespace directly from the API server. Using cached informers should be preferred but current lister doesn't have a field selector. Direct retrieval from the API server should only be used for one-shot tasks. For example, support bundle creation

func (*DataStore) GetAllDeploymentsList added in v0.4.0

func (s *DataStore) GetAllDeploymentsList() (runtime.Object, error)

GetAllDeploymentsList returns an uncached list of deployments for the given namespace directly from the API server. Using cached informers should be preferred but current lister doesn't have a field selector. Direct retrieval from the API server should only be used for one-shot tasks. For example, support bundle creation

func (*DataStore) GetAllEventsList added in v0.4.0

func (s *DataStore) GetAllEventsList() (runtime.Object, error)

GetAllEventsList returns an uncached list of events for the given namespace directly from the API server. Using cached informers should be preferred but current lister doesn't have a field selector. Direct retrieval from the API server should only be used for one-shot tasks. For example, support bundle creation

func (*DataStore) GetAllJobsList added in v0.4.0

func (s *DataStore) GetAllJobsList() (runtime.Object, error)

GetAllJobsList returns an uncached list of jobs for the given namespace directly from the API server. Using cached informers should be preferred but current lister doesn't have a field selector. Direct retrieval from the API server should only be used for one-shot tasks. For example, support bundle creation

func (*DataStore) GetAllNodesList added in v0.5.0

func (s *DataStore) GetAllNodesList() (runtime.Object, error)

GetAllNodesList returns an uncached list of nodes for the given namespace directly from the API server. Using cached informers should be preferred but current lister doesn't have a field selector. Direct retrieval from the API server should only be used for one-shot tasks. For example, support bundle creation

func (*DataStore) GetAllPodsList added in v0.4.0

func (s *DataStore) GetAllPodsList() (runtime.Object, error)

GetAllPodsList returns an uncached list of pods for the given namespace directly from the API server. Using cached informers should be preferred but current lister doesn't have a field selector. Direct retrieval from the API server should only be used for one-shot tasks. For example, support bundle creation

func (*DataStore) GetAllServicesList added in v0.4.0

func (s *DataStore) GetAllServicesList() (runtime.Object, error)

GetAllServicesList returns an uncached list of services for the given namespace directly from the API server. Using cached informers should be preferred but current lister doesn't have a field selector. Direct retrieval from the API server should only be used for one-shot tasks. For example, support bundle creation

func (*DataStore) GetAllStatefulSetsList added in v0.4.0

func (s *DataStore) GetAllStatefulSetsList() (runtime.Object, error)

GetAllStatefulSetsList returns an uncached list of statefulsets for the given namespace directly from the API server. Using cached informers should be preferred but current lister doesn't have a field selector. Direct retrieval from the API server should only be used for one-shot tasks. For example, support bundle creation

func (*DataStore) GetAllVolumeAttachments added in v1.0.0

func (s *DataStore) GetAllVolumeAttachments() (runtime.Object, error)

GetAllVolumeAttachments returns an uncached list of volumeattachments for the given namespace directly from the API server. Using cached informers should be preferred but current lister doesn't have a field selector. Direct retrieval from the API server should only be used for one-shot tasks. For example, support bundle creation

func (*DataStore) GetBackingImage added in v1.1.1

func (s *DataStore) GetBackingImage(name string) (*longhorn.BackingImage, error)

GetBackingImage returns a new BackingImage object for the given name and namespace

func (*DataStore) GetBackingImageDataSource added in v1.2.0

func (s *DataStore) GetBackingImageDataSource(name string) (*longhorn.BackingImageDataSource, error)

GetBackingImageDataSource returns a new BackingImageDataSource object for the given name and namespace

func (*DataStore) GetBackingImageManager added in v1.1.1

func (s *DataStore) GetBackingImageManager(name string) (*longhorn.BackingImageManager, error)

GetBackingImageManager returns a new BackingImageManager object for the given name and namespace

func (*DataStore) GetBackup added in v1.2.0

func (s *DataStore) GetBackup(name string) (*longhorn.Backup, error)

GetBackup returns a copy of Backup with the given backup name in the cluster

func (*DataStore) GetBackupRO added in v1.2.0

func (s *DataStore) GetBackupRO(backupName string) (*longhorn.Backup, error)

GetBackupRO returns the Backup with the given backup name in the cluster

func (*DataStore) GetBackupTarget added in v1.2.0

func (s *DataStore) GetBackupTarget(name string) (*longhorn.BackupTarget, error)

GetBackupTarget returns a copy of BackupTarget with the given backup target name in the cluster

func (*DataStore) GetBackupTargetRO added in v1.2.0

func (s *DataStore) GetBackupTargetRO(backupTargetName string) (*longhorn.BackupTarget, error)

GetBackupTargetRO returns the BackupTarget with the given backup target name in the cluster

func (*DataStore) GetBackupVolume added in v1.2.0

func (s *DataStore) GetBackupVolume(name string) (*longhorn.BackupVolume, error)

GetBackupVolume returns a copy of BackupVolume with the given backup volume name in the cluster

func (*DataStore) GetBackupVolumeRO added in v1.2.0

func (s *DataStore) GetBackupVolumeRO(backupVolumeName string) (*longhorn.BackupVolume, error)

GetBackupVolumeRO returns the BackupVolume with the given backup volume name in the cluster

func (*DataStore) GetConfigMap added in v1.1.0

func (s *DataStore) GetConfigMap(namespace, name string) (*corev1.ConfigMap, error)

GetConfigMap return a new ConfigMap object for the given namespace and name

func (*DataStore) GetConfigMapRO added in v1.1.0

func (s *DataStore) GetConfigMapRO(namespace, name string) (*corev1.ConfigMap, error)

GetConfigMapRO gets ConfigMap with the given name in s.namespace This function returns direct reference to the internal cache object and should not be mutated. Consider using this function when you can guarantee read only access and don't want the overhead of deep copies

func (*DataStore) GetCredentialFromSecret

func (s *DataStore) GetCredentialFromSecret(secretName string) (map[string]string, error)

GetCredentialFromSecret gets the Secret of the given name and namespace Returns a new credential object or error

func (*DataStore) GetCronJobROByRecurringJob added in v1.2.0

func (s *DataStore) GetCronJobROByRecurringJob(recurringJob *longhorn.RecurringJob) (*batchv1beta1.CronJob, error)

GetCronJobROByRecurringJob returns read-only CronJob for the recurring job

func (*DataStore) GetDaemonSet added in v0.3.2

func (s *DataStore) GetDaemonSet(name string) (*appsv1.DaemonSet, error)

GetDaemonSet gets the DaemonSet for the given name and namespace

func (*DataStore) GetDeployment added in v0.4.0

func (s *DataStore) GetDeployment(name string) (*appsv1.Deployment, error)

GetDeployment gets the Deployment for the given name and namespace

func (*DataStore) GetEngine

func (s *DataStore) GetEngine(name string) (*longhorn.Engine, error)

GetEngine returns the Engine for the given name and namespace

func (*DataStore) GetEngineImage

func (s *DataStore) GetEngineImage(name string) (*longhorn.EngineImage, error)

GetEngineImage returns a new EngineImage object for the given name and namespace

func (*DataStore) GetEngineImageCLIAPIVersion added in v1.1.0

func (s *DataStore) GetEngineImageCLIAPIVersion(imageName string) (int, error)

GetEngineImageCLIAPIVersion get engine image for the given name and returns the CLIAPIVersion

func (*DataStore) GetEngineImageDaemonSet

func (s *DataStore) GetEngineImageDaemonSet(name string) (*appsv1.DaemonSet, error)

GetEngineImageDaemonSet get DaemonSet for the given name and namspace, and returns a new DaemonSet object

func (*DataStore) GetInstanceManager added in v0.6.0

func (s *DataStore) GetInstanceManager(name string) (*longhorn.InstanceManager, error)

GetInstanceManager gets the InstanceManager for the given name and namespace. Returns new InstanceManager object

func (*DataStore) GetInstanceManagerByInstance added in v0.6.0

func (s *DataStore) GetInstanceManagerByInstance(obj interface{}) (*longhorn.InstanceManager, error)

GetInstanceManagerByInstance gets a list of InstanceManager for the given object. Returns error if more than one InstanceManager is found

func (*DataStore) GetKubernetesNode added in v0.3.1

func (s *DataStore) GetKubernetesNode(name string) (*corev1.Node, error)

GetKubernetesNode gets the Node from the index for the given name

func (*DataStore) GetKubernetesVersion added in v0.4.0

func (s *DataStore) GetKubernetesVersion() (*version.Info, error)

GetKubernetesVersion returns the server version

func (*DataStore) GetLonghornEventList added in v0.4.0

func (s *DataStore) GetLonghornEventList() (*corev1.EventList, error)

GetLonghornEventList returns an uncached list of longhorn events for the given namespace directly from the API server. Using cached informers should be preferred but current lister doesn't have a field selector. Direct retrieval from the API server should only be used for one-shot tasks. For example, support bundle creation

func (*DataStore) GetLonghornNamespace added in v0.4.0

func (s *DataStore) GetLonghornNamespace() (*corev1.Namespace, error)

GetLonghornNamespace returns an uncached namespace object for the given namespace directly from the API server. Using cached informers should be preferred but current lister doesn't have a field selector. Direct retrieval from the API server should only be used for one-shot tasks. For example, support bundle creation

func (*DataStore) GetManagerNodeIPMap

func (s *DataStore) GetManagerNodeIPMap() (map[string]string, error)

GetManagerNodeIPMap returns an object contains podIPs from list of running pods with app=longhorn-manager

func (*DataStore) GetNode

func (s *DataStore) GetNode(name string) (*longhorn.Node, error)

GetNode gets Longhorn Node for the given name and namespace Returns a new Node object

func (*DataStore) GetNodeRO added in v0.3.2

func (s *DataStore) GetNodeRO(name string) (*longhorn.Node, error)

func (*DataStore) GetPDBRO added in v1.1.0

func (s *DataStore) GetPDBRO(name string) (*policyv1beta1.PodDisruptionBudget, error)

GetPDBRO gets PDB for the given name and namespace. This function returns direct reference to the internal cache object and should not be mutated. Consider using this function when you can guarantee read only access and don't want the overhead of deep copies

func (*DataStore) GetPersistentVolume added in v1.1.2

func (s *DataStore) GetPersistentVolume(pvName string) (*corev1.PersistentVolume, error)

GetPersistentVolume gets a mutable PersistentVolume for the given name

func (*DataStore) GetPersistentVolumeClaim added in v1.1.2

func (s *DataStore) GetPersistentVolumeClaim(namespace, pvcName string) (*corev1.PersistentVolumeClaim, error)

GetPersistentVolumeClaim gets a mutable PersistentVolumeClaim for the given name and namespace

func (*DataStore) GetPersistentVolumeClaimRO added in v1.1.2

func (s *DataStore) GetPersistentVolumeClaimRO(namespace, pvcName string) (*corev1.PersistentVolumeClaim, error)

GetPersistentVolumeClaimRO gets the PersistentVolumeClaim from the index for the given name and namespace This function returns direct reference to the internal cache object and should not be mutated. Consider using this function when you can guarantee read only access and don't want the overhead of deep copies

func (*DataStore) GetPersistentVolumeRO added in v1.1.2

func (s *DataStore) GetPersistentVolumeRO(pvName string) (*corev1.PersistentVolume, error)

GetPersistentVolumeRO gets the PersistentVolume from the index for the given name This function returns direct reference to the internal cache object and should not be mutated. Consider using this function when you can guarantee read only access and don't want the overhead of deep copies

func (*DataStore) GetPod added in v1.1.0

func (s *DataStore) GetPod(name string) (*corev1.Pod, error)

GetPod returns a mutable Pod object for the given name and namspace

func (*DataStore) GetPodContainerLog added in v1.2.0

func (s *DataStore) GetPodContainerLog(podName, containerName string) ([]byte, error)

GetPodContainerLog dumps the log of a container in a Pod object for the given name and namespace. Be careful that this function will directly talk with the API server.

func (*DataStore) GetPodContainerLogRequest added in v0.4.0

func (s *DataStore) GetPodContainerLogRequest(podName, containerName string) *rest.Request

GetPodContainerLogRequest returns the Pod log for the given pod name, container name and namespace

func (*DataStore) GetPriorityClass added in v1.0.1

func (s *DataStore) GetPriorityClass(pcName string) (*schedulingv1.PriorityClass, error)

GetPriorityClass gets the PriorityClass from the index for the given name

func (*DataStore) GetRandomReadyNode added in v0.6.0

func (s *DataStore) GetRandomReadyNode() (*longhorn.Node, error)

GetRandomReadyNode gets a list of all Node in the given namespace and returns the first Node marked with condition ready and allow scheduling

func (*DataStore) GetReadyDiskNode added in v1.1.1

func (s *DataStore) GetReadyDiskNode(diskUUID string) (*longhorn.Node, string, error)

GetReadyDiskNode find the corresponding ready Longhorn Node for a given disk Returns a Node object and the disk name

func (*DataStore) GetRecurringJob added in v1.2.0

func (s *DataStore) GetRecurringJob(name string) (*longhorn.RecurringJob, error)

GetRecurringJob gets the RecurringJob for the given name and namespace. Returns a mutable RecurringJob object

func (*DataStore) GetReplica

func (s *DataStore) GetReplica(name string) (*longhorn.Replica, error)

GetReplica gets Replica for the given name and namespace and returns a new Replica object

func (*DataStore) GetSecret added in v1.1.1

func (s *DataStore) GetSecret(namespace, name string) (*corev1.Secret, error)

GetSecret return a new Secret object with the given namespace and name

func (*DataStore) GetSecretRO added in v1.1.1

func (s *DataStore) GetSecretRO(namespace, name string) (*corev1.Secret, error)

GetSecretRO gets Secret with the given namespace and name This function returns direct reference to the internal cache object and should not be mutated. Consider using this function when you can guarantee read only access and don't want the overhead of deep copies

func (*DataStore) GetService added in v1.1.0

func (s *DataStore) GetService(namespace, name string) (*corev1.Service, error)

GetService gets the Service for the given name and namespace

func (*DataStore) GetSetting

func (s *DataStore) GetSetting(sName types.SettingName) (*longhorn.Setting, error)

GetSetting will automatically fill the non-existing setting if it's a valid setting name. The function will not return nil for *longhorn.Setting when error is nil

func (*DataStore) GetSettingAsBool added in v0.3.2

func (s *DataStore) GetSettingAsBool(settingName types.SettingName) (bool, error)

GetSettingAsBool gets the setting for the given name, returns as boolean Returns error if the definition type is not boolean

func (*DataStore) GetSettingAsInt

func (s *DataStore) GetSettingAsInt(settingName types.SettingName) (int64, error)

GetSettingAsInt gets the setting for the given name, returns as integer Returns error if the definition type is not integer

func (*DataStore) GetSettingImagePullPolicy added in v1.1.0

func (s *DataStore) GetSettingImagePullPolicy() (corev1.PullPolicy, error)

GetSettingImagePullPolicy get the setting and return one of Kubernetes ImagePullPolicy definition Returns error if the ImagePullPolicy is invalid

func (*DataStore) GetSettingSystemManagedComponentsNodeSelector added in v1.1.1

func (s *DataStore) GetSettingSystemManagedComponentsNodeSelector() (map[string]string, error)

func (*DataStore) GetSettingTaintToleration added in v1.1.0

func (s *DataStore) GetSettingTaintToleration() ([]corev1.Toleration, error)

func (*DataStore) GetSettingValueExisted added in v0.5.0

func (s *DataStore) GetSettingValueExisted(sName types.SettingName) (string, error)

GetSettingValueExisted returns the value of the given setting name. Returns error if the setting does not exist or value is empty

func (*DataStore) GetShareManager added in v1.1.0

func (s *DataStore) GetShareManager(name string) (*longhorn.ShareManager, error)

GetShareManager gets the ShareManager for the given name and namespace. Returns a mutable ShareManager object

func (*DataStore) GetStorageClassRO added in v1.1.0

func (s *DataStore) GetStorageClassRO(scName string) (*storagev1.StorageClass, error)

GetStorageClassRO gets StorageClass with the given name This function returns direct reference to the internal cache object and should not be mutated. Consider using this function when you can guarantee read only access and don't want the overhead of deep copies

func (*DataStore) GetVolume

func (s *DataStore) GetVolume(name string) (*longhorn.Volume, error)

GetVolume returns a new volume object for the given namespace and name

func (*DataStore) GetVolumeCurrentEngine added in v1.2.0

func (s *DataStore) GetVolumeCurrentEngine(volumeName string) (*longhorn.Engine, error)

GetVolumeCurrentEngine returns the Engine for a volume with the given namespace

func (*DataStore) InitSettings added in v0.3.2

func (s *DataStore) InitSettings() error

InitSettings creates all Settings in SettingNameList if not already exist

func (*DataStore) IsEngineImageCLIAPIVersionOne added in v0.6.0

func (s *DataStore) IsEngineImageCLIAPIVersionOne(imageName string) (bool, error)

IsEngineImageCLIAPIVersionOne get engine image CLIAPIVersion for the given name. Returns true if CLIAPIVersion is 1

func (*DataStore) IsNodeDownOrDeleted added in v0.3.2

func (s *DataStore) IsNodeDownOrDeleted(name string) (bool, error)

IsNodeDownOrDeleted gets Node for the given name and namespace and checks if the Node condition is gone or not ready

func (*DataStore) IsNodeDownOrDeletedOrMissingManager added in v1.1.1

func (s *DataStore) IsNodeDownOrDeletedOrMissingManager(name string) (bool, error)

func (*DataStore) IsNodeSchedulable added in v1.1.1

func (s *DataStore) IsNodeSchedulable(name string) bool

func (*DataStore) ListBackingImageDataSources added in v1.2.0

func (s *DataStore) ListBackingImageDataSources() (map[string]*longhorn.BackingImageDataSource, error)

ListBackingImageDataSources returns object includes all BackingImageDataSource in namespace

func (*DataStore) ListBackingImageDataSourcesByNode added in v1.2.0

func (s *DataStore) ListBackingImageDataSourcesByNode(nodeName string) (map[string]*longhorn.BackingImageDataSource, error)

ListBackingImageDataSourcesByNode returns object includes all BackingImageDataSource in namespace

func (*DataStore) ListBackingImageDataSourcesExportingFromVolume added in v1.2.0

func (s *DataStore) ListBackingImageDataSourcesExportingFromVolume(volumeName string) (map[string]*longhorn.BackingImageDataSource, error)

ListBackingImageDataSourcesExportingFromVolume returns object includes all BackingImageDataSource in namespace

func (*DataStore) ListBackingImageManagerPods added in v1.1.1

func (s *DataStore) ListBackingImageManagerPods() ([]*corev1.Pod, error)

func (*DataStore) ListBackingImageManagers added in v1.1.1

func (s *DataStore) ListBackingImageManagers() (map[string]*longhorn.BackingImageManager, error)

ListBackingImageManagers returns object includes all BackingImageManager in namespace

func (*DataStore) ListBackingImageManagersByDiskUUID added in v1.1.1

func (s *DataStore) ListBackingImageManagersByDiskUUID(diskUUID string) (map[string]*longhorn.BackingImageManager, error)

ListBackingImageManagersByDiskUUID gets a list of BackingImageManager in a specific disk with the given namespace.

func (*DataStore) ListBackingImageManagersByNode added in v1.1.1

func (s *DataStore) ListBackingImageManagersByNode(nodeName string) (map[string]*longhorn.BackingImageManager, error)

ListBackingImageManagersByNode gets a list of BackingImageManager on a specific node with the given namespace.

func (*DataStore) ListBackingImages added in v1.1.1

func (s *DataStore) ListBackingImages() (map[string]*longhorn.BackingImage, error)

ListBackingImages returns object includes all BackingImage in namespace

func (*DataStore) ListBackupTargets added in v1.2.0

func (s *DataStore) ListBackupTargets() (map[string]*longhorn.BackupTarget, error)

ListBackupTargets returns an object contains all backup targets in the cluster BackupTargets CR

func (*DataStore) ListBackupVolumes added in v1.2.0

func (s *DataStore) ListBackupVolumes() (map[string]*longhorn.BackupVolume, error)

ListBackupVolumes returns an object contains all backup volumes in the cluster BackupVolumes CR

func (*DataStore) ListBackups added in v1.2.0

func (s *DataStore) ListBackups() (map[string]*longhorn.Backup, error)

ListBackups returns an object contains all backups in the cluster Backups CR

func (*DataStore) ListBackupsWithBackupVolumeName added in v1.2.0

func (s *DataStore) ListBackupsWithBackupVolumeName(backupVolumeName string) (map[string]*longhorn.Backup, error)

ListBackupsWithBackupVolumeName returns an object contains all backups in the cluster Backups CR of the given backup volume name

func (*DataStore) ListDRVolumesRO added in v1.2.0

func (s *DataStore) ListDRVolumesRO() (map[string]*longhorn.Volume, error)

ListDRVolumesRO returns a single object contains all DR Volumes

func (*DataStore) ListDRVolumesROWithBackupVolumeName added in v1.2.0

func (s *DataStore) ListDRVolumesROWithBackupVolumeName(backupVolumeName string) (map[string]*longhorn.Volume, error)

ListDRVolumesROWithBackupVolumeName returns a single object contains the DR volumes matches to the backup volume name

func (*DataStore) ListDaemonSet added in v0.6.0

func (s *DataStore) ListDaemonSet() ([]*appsv1.DaemonSet, error)

ListDaemonSet gets a list of all DaemonSet for the given namespace

func (*DataStore) ListDaemonSetWithLabels added in v1.1.1

func (s *DataStore) ListDaemonSetWithLabels(labels map[string]string) ([]*appsv1.DaemonSet, error)

func (*DataStore) ListDefaultBackingImageManagers added in v1.1.1

func (s *DataStore) ListDefaultBackingImageManagers() (map[string]*longhorn.BackingImageManager, error)

ListDefaultBackingImageManagers gets a list of BackingImageManager using default image with the given namespace.

func (*DataStore) ListDeployment added in v0.6.0

func (s *DataStore) ListDeployment() ([]*appsv1.Deployment, error)

ListDeployment gets a list of all Deployment for the given namespace

func (*DataStore) ListDeploymentWithLabels added in v1.1.1

func (s *DataStore) ListDeploymentWithLabels(labels map[string]string) ([]*appsv1.Deployment, error)

func (*DataStore) ListEngineImageDaemonSetPodsFromEngineImageName added in v1.1.1

func (s *DataStore) ListEngineImageDaemonSetPodsFromEngineImageName(EIName string) ([]*corev1.Pod, error)

func (*DataStore) ListEngineImages

func (s *DataStore) ListEngineImages() (map[string]*longhorn.EngineImage, error)

ListEngineImages returns object includes all EngineImage in namespace

func (*DataStore) ListEngines added in v0.3.2

func (s *DataStore) ListEngines() (map[string]*longhorn.Engine, error)

ListEngines returns an object contains all Engine for the given namespace

func (*DataStore) ListEnginesByNodeRO added in v1.1.2

func (s *DataStore) ListEnginesByNodeRO(name string) ([]*longhorn.Engine, error)

ListEnginesByNodeRO returns a list of all Engines on node Name for the given namespace, the list contains direct references to the internal cache objects and should not be mutated. Consider using this function when you can guarantee read only access and don't want the overhead of deep copies

func (*DataStore) ListEnginesRO added in v0.7.0

func (s *DataStore) ListEnginesRO() ([]*longhorn.Engine, error)

ListEnginesRO returns a list of all Engine for the given namespace

func (*DataStore) ListInstanceManagerPods added in v0.6.0

func (s *DataStore) ListInstanceManagerPods() ([]*corev1.Pod, error)

ListInstanceManagerPods returns a list of Pod marked with component=instance-manager

func (*DataStore) ListInstanceManagerPodsBy added in v1.1.2

func (s *DataStore) ListInstanceManagerPodsBy(node string, image string, imType types.InstanceManagerType) ([]*corev1.Pod, error)

ListInstanceManagerPodsBy returns a list of instance manager pods that fullfill the below conditions

func (*DataStore) ListInstanceManagers added in v0.6.0

func (s *DataStore) ListInstanceManagers() (map[string]*longhorn.InstanceManager, error)

ListInstanceManagers gets a list of InstanceManagers for the given namespace. Returns a new InstanceManager object

func (*DataStore) ListInstanceManagersByNode added in v0.8.0

func (s *DataStore) ListInstanceManagersByNode(node string, imType types.InstanceManagerType) (map[string]*longhorn.InstanceManager, error)

ListInstanceManagersByNode returns ListInstanceManagersBySelector

func (*DataStore) ListInstanceManagersBySelector added in v0.8.0

func (s *DataStore) ListInstanceManagersBySelector(node, instanceManagerImage string, managerType types.InstanceManagerType) (map[string]*longhorn.InstanceManager, error)

ListInstanceManagersBySelector gets a list of InstanceManager by labels for the given namespace. Returns an object contains all InstanceManager

func (*DataStore) ListKubeNodesRO added in v1.1.0

func (s *DataStore) ListKubeNodesRO() ([]*corev1.Node, error)

ListKubeNodesRO returns a list of all Kubernetes Nodes for the given namespace, the list contains direct references to the internal cache objects and should not be mutated. Consider using this function when you can guarantee read only access and don't want the overhead of deep copies

func (*DataStore) ListManagerPods

func (s *DataStore) ListManagerPods() ([]*corev1.Pod, error)

ListManagerPods returns a list of Pods marked with app=longhorn-manager

func (*DataStore) ListNodes

func (s *DataStore) ListNodes() (map[string]*longhorn.Node, error)

ListNodes returns an object contains all Node for the namespace

func (*DataStore) ListNodesRO added in v1.1.0

func (s *DataStore) ListNodesRO() ([]*longhorn.Node, error)

ListNodesRO returns a list of all Nodes for the given namespace, the list contains direct references to the internal cache objects and should not be mutated. Consider using this function when you can guarantee read only access and don't want the overhead of deep copies

func (*DataStore) ListNodesWithEngineImage added in v1.1.1

func (s *DataStore) ListNodesWithEngineImage(ei *longhorn.EngineImage) (map[string]*longhorn.Node, error)

func (*DataStore) ListPDBs added in v1.1.0

func (s *DataStore) ListPDBs() (map[string]*policyv1beta1.PodDisruptionBudget, error)

ListPDBs gets a map of PDB in s.namespace

func (*DataStore) ListPodsBySelector added in v1.1.0

func (s *DataStore) ListPodsBySelector(selector labels.Selector) ([]*corev1.Pod, error)

func (*DataStore) ListPodsRO added in v1.1.0

func (s *DataStore) ListPodsRO() ([]*corev1.Pod, error)

ListPodsRO returns a list of all Pods for the given namespace, the list contains direct references to the internal cache objects and should not be mutated. Consider using this function when you can guarantee read only access and don't want the overhead of deep copies

func (*DataStore) ListReadyAndSchedulableNodes added in v1.1.1

func (s *DataStore) ListReadyAndSchedulableNodes() (map[string]*longhorn.Node, error)

func (*DataStore) ListReadyNodes added in v1.1.1

func (s *DataStore) ListReadyNodes() (map[string]*longhorn.Node, error)

func (*DataStore) ListReadyNodesWithEngineImage added in v1.1.1

func (s *DataStore) ListReadyNodesWithEngineImage(image string) (map[string]*longhorn.Node, error)

ListReadyNodesWithEngineImage returns list of ready nodes that have the corresponding engine image deploying or deployed

func (*DataStore) ListReadyNodesWithReadyEngineImage added in v1.2.1

func (s *DataStore) ListReadyNodesWithReadyEngineImage(image string) (map[string]*longhorn.Node, error)

ListReadyNodesWithReadyEngineImage returns list of ready nodes that have the corresponding engine image deployed

func (*DataStore) ListRecurringJobs added in v1.2.0

func (s *DataStore) ListRecurringJobs() (map[string]*longhorn.RecurringJob, error)

ListRecurringJobs returns a map of RecurringJobPolicies indexed by name

func (*DataStore) ListReplicas added in v0.3.2

func (s *DataStore) ListReplicas() (map[string]*longhorn.Replica, error)

ListReplicas returns an object contains all Replicas for the given namespace

func (*DataStore) ListReplicasByBackingImage added in v1.1.1

func (s *DataStore) ListReplicasByBackingImage(backingImageName string) ([]*longhorn.Replica, error)

ListReplicasByBackingImage gets a list of Replicas using a specific backing image the given namespace.

func (*DataStore) ListReplicasByDiskUUID added in v1.1.0

func (s *DataStore) ListReplicasByDiskUUID(uuid string) (map[string]*longhorn.Replica, error)

ListReplicasByDiskUUID gets a list of Replicas on a specific disk the given namespace.

func (*DataStore) ListReplicasByNode

func (s *DataStore) ListReplicasByNode(name string) (map[string]*longhorn.Replica, error)

ListReplicasByNode gets a map of Replicas on the node Name for the given namespace.

func (*DataStore) ListReplicasByNodeRO added in v1.1.0

func (s *DataStore) ListReplicasByNodeRO(name string) ([]*longhorn.Replica, error)

ListReplicasByNodeRO returns a list of all Replicas on node Name for the given namespace, the list contains direct references to the internal cache objects and should not be mutated. Consider using this function when you can guarantee read only access and don't want the overhead of deep copies

func (*DataStore) ListSettings

func (s *DataStore) ListSettings() (map[types.SettingName]*longhorn.Setting, error)

ListSettings lists all Settings in the namespace, and fill with default values of any missing entry

func (*DataStore) ListShareManagerPods added in v1.1.0

func (s *DataStore) ListShareManagerPods() ([]*corev1.Pod, error)

func (*DataStore) ListShareManagers added in v1.1.0

func (s *DataStore) ListShareManagers() (map[string]*longhorn.ShareManager, error)

ListShareManagers returns a map of ShareManagers indexed by name

func (*DataStore) ListVolumeEngines

func (s *DataStore) ListVolumeEngines(volumeName string) (map[string]*longhorn.Engine, error)

ListVolumeEngines returns an object contains all Engines with the given LonghornLabelVolume name and namespace

func (*DataStore) ListVolumeReplicas

func (s *DataStore) ListVolumeReplicas(volumeName string) (map[string]*longhorn.Replica, error)

ListVolumeReplicas returns an object contains all Replica with the given LonghornLabelVolume name and namespace

func (*DataStore) ListVolumes

func (s *DataStore) ListVolumes() (map[string]*longhorn.Volume, error)

ListVolumes returns an object contains all Volume

func (*DataStore) ListVolumesByLabelSelector added in v1.2.0

func (s *DataStore) ListVolumesByLabelSelector(selector labels.Selector) (map[string]*longhorn.Volume, error)

ListVolumesByLabelSelector returns an object contains all Volume

func (*DataStore) ListVolumesBySelectorRO added in v1.2.0

func (s *DataStore) ListVolumesBySelectorRO(selector labels.Selector) ([]*longhorn.Volume, error)

ListVolumesBySelectorRO returns a list of all Volumes for the given namespace

func (*DataStore) ListVolumesRO added in v0.3.2

func (s *DataStore) ListVolumesRO() ([]*longhorn.Volume, error)

ListVolumesRO returns a list of all Volumes for the given namespace

func (*DataStore) ListVolumesROWithBackupVolumeName added in v1.2.0

func (s *DataStore) ListVolumesROWithBackupVolumeName(backupVolumeName string) ([]*longhorn.Volume, error)

ListVolumesROWithBackupVolumeName returns a single object contains all volumes with the given backup volume name

func (*DataStore) PickVolumeCurrentEngine added in v1.2.0

func (s *DataStore) PickVolumeCurrentEngine(v *longhorn.Volume, es map[string]*longhorn.Engine) (*longhorn.Engine, error)

PickVolumeCurrentEngine pick the current Engine from the Engine list of a volume with the given namespace

func (*DataStore) RemoveFinalizerForBackingImage added in v1.1.1

func (s *DataStore) RemoveFinalizerForBackingImage(obj *longhorn.BackingImage) error

RemoveFinalizerForBackingImage will result in deletion if DeletionTimestamp was set

func (*DataStore) RemoveFinalizerForBackingImageDataSource added in v1.2.0

func (s *DataStore) RemoveFinalizerForBackingImageDataSource(obj *longhorn.BackingImageDataSource) error

RemoveFinalizerForBackingImageDataSource will result in deletion if DeletionTimestamp was set

func (*DataStore) RemoveFinalizerForBackingImageManager added in v1.1.1

func (s *DataStore) RemoveFinalizerForBackingImageManager(obj *longhorn.BackingImageManager) error

RemoveFinalizerForBackingImageManager will result in deletion if DeletionTimestamp was set

func (*DataStore) RemoveFinalizerForBackup added in v1.2.0

func (s *DataStore) RemoveFinalizerForBackup(backup *longhorn.Backup) error

RemoveFinalizerForBackup will result in deletion if DeletionTimestamp was set

func (*DataStore) RemoveFinalizerForBackupVolume added in v1.2.0

func (s *DataStore) RemoveFinalizerForBackupVolume(backupVolume *longhorn.BackupVolume) error

RemoveFinalizerForBackupVolume will result in deletion if DeletionTimestamp was set

func (*DataStore) RemoveFinalizerForEngine

func (s *DataStore) RemoveFinalizerForEngine(obj *longhorn.Engine) error

RemoveFinalizerForEngine will result in deletion if DeletionTimestamp was set

func (*DataStore) RemoveFinalizerForEngineImage

func (s *DataStore) RemoveFinalizerForEngineImage(obj *longhorn.EngineImage) error

RemoveFinalizerForEngineImage will result in deletion if DeletionTimestamp was set

func (*DataStore) RemoveFinalizerForNode

func (s *DataStore) RemoveFinalizerForNode(obj *longhorn.Node) error

RemoveFinalizerForNode will result in deletion if DeletionTimestamp was set

func (*DataStore) RemoveFinalizerForReplica

func (s *DataStore) RemoveFinalizerForReplica(obj *longhorn.Replica) error

RemoveFinalizerForReplica will result in deletion if DeletionTimestamp was set

func (*DataStore) RemoveFinalizerForShareManager added in v1.1.0

func (s *DataStore) RemoveFinalizerForShareManager(obj *longhorn.ShareManager) error

RemoveFinalizerForShareManager will result in deletion if DeletionTimestamp was set

func (*DataStore) RemoveFinalizerForVolume

func (s *DataStore) RemoveFinalizerForVolume(obj *longhorn.Volume) error

RemoveFinalizerForVolume will result in deletion if DeletionTimestamp was set

func (*DataStore) ResetMonitoringEngineStatus added in v0.7.0

func (s *DataStore) ResetMonitoringEngineStatus(e *longhorn.Engine) (*longhorn.Engine, error)

ResetMonitoringEngineStatus clean and update Engine status

func (*DataStore) Sync

func (s *DataStore) Sync(stopCh <-chan struct{}) bool

Sync returns WaitForCacheSync for Longhorn DataStore

func (*DataStore) UpdateBackingImage added in v1.1.1

func (s *DataStore) UpdateBackingImage(backingImage *longhorn.BackingImage) (*longhorn.BackingImage, error)

UpdateBackingImage updates Longhorn BackingImage and verifies update

func (*DataStore) UpdateBackingImageDataSource added in v1.2.0

func (s *DataStore) UpdateBackingImageDataSource(backingImageDataSource *longhorn.BackingImageDataSource) (*longhorn.BackingImageDataSource, error)

UpdateBackingImageDataSource updates Longhorn BackingImageDataSource and verifies update

func (*DataStore) UpdateBackingImageDataSourceStatus added in v1.2.0

func (s *DataStore) UpdateBackingImageDataSourceStatus(backingImageDataSource *longhorn.BackingImageDataSource) (*longhorn.BackingImageDataSource, error)

UpdateBackingImageDataSourceStatus updates Longhorn BackingImageDataSource resource status and verifies update

func (*DataStore) UpdateBackingImageManager added in v1.1.1

func (s *DataStore) UpdateBackingImageManager(backingImageManager *longhorn.BackingImageManager) (*longhorn.BackingImageManager, error)

UpdateBackingImageManager updates Longhorn BackingImageManager and verifies update

func (*DataStore) UpdateBackingImageManagerStatus added in v1.1.1

func (s *DataStore) UpdateBackingImageManagerStatus(backingImageManager *longhorn.BackingImageManager) (*longhorn.BackingImageManager, error)

UpdateBackingImageManagerStatus updates Longhorn BackingImageManager resource status and verifies update

func (*DataStore) UpdateBackingImageStatus added in v1.1.1

func (s *DataStore) UpdateBackingImageStatus(backingImage *longhorn.BackingImage) (*longhorn.BackingImage, error)

UpdateBackingImageStatus updates Longhorn BackingImage resource status and verifies update

func (*DataStore) UpdateBackup added in v1.2.0

func (s *DataStore) UpdateBackup(backup *longhorn.Backup) (*longhorn.Backup, error)

UpdateBackup updates the given Longhorn backup in the cluster Backup CR and verifies update

func (*DataStore) UpdateBackupStatus added in v1.2.0

func (s *DataStore) UpdateBackupStatus(backup *longhorn.Backup) (*longhorn.Backup, error)

UpdateBackupStatus updates the given Longhorn backup status in the cluster Backups CR status and verifies update

func (*DataStore) UpdateBackupTarget added in v1.2.0

func (s *DataStore) UpdateBackupTarget(backupTarget *longhorn.BackupTarget) (*longhorn.BackupTarget, error)

UpdateBackupTarget updates the given Longhorn backup target in the cluster BackupTargets CR and verifies update

func (*DataStore) UpdateBackupTargetStatus added in v1.2.0

func (s *DataStore) UpdateBackupTargetStatus(backupTarget *longhorn.BackupTarget) (*longhorn.BackupTarget, error)

UpdateBackupTargetStatus updates the given Longhorn backup target in the cluster BackupTargets CR status and verifies update

func (*DataStore) UpdateBackupVolume added in v1.2.0

func (s *DataStore) UpdateBackupVolume(backupVolume *longhorn.BackupVolume) (*longhorn.BackupVolume, error)

UpdateBackupVolume updates the given Longhorn backup volume in the cluster BackupVolume CR and verifies update

func (*DataStore) UpdateBackupVolumeStatus added in v1.2.0

func (s *DataStore) UpdateBackupVolumeStatus(backupVolume *longhorn.BackupVolume) (*longhorn.BackupVolume, error)

UpdateBackupVolumeStatus updates the given Longhorn backup volume in the cluster BackupVolumes CR status and verifies update

func (*DataStore) UpdateCronJob added in v1.2.0

func (s *DataStore) UpdateCronJob(cronJob *batchv1beta1.CronJob) (*batchv1beta1.CronJob, error)

UpdateCronJob updates CronJob resource

func (*DataStore) UpdateDaemonSet added in v0.6.0

func (s *DataStore) UpdateDaemonSet(obj *appsv1.DaemonSet) (*appsv1.DaemonSet, error)

UpdateDaemonSet updates the DaemonSet for the given DaemonSet object and namespace

func (*DataStore) UpdateDeployment added in v0.6.0

func (s *DataStore) UpdateDeployment(obj *appsv1.Deployment) (*appsv1.Deployment, error)

UpdateDeployment updates Deployment for the given Deployment object and namespace

func (*DataStore) UpdateEngine

func (s *DataStore) UpdateEngine(e *longhorn.Engine) (*longhorn.Engine, error)

UpdateEngine updates Longhorn Engine and verifies update

func (*DataStore) UpdateEngineImage

func (s *DataStore) UpdateEngineImage(img *longhorn.EngineImage) (*longhorn.EngineImage, error)

UpdateEngineImage updates Longhorn EngineImage and verifies update

func (*DataStore) UpdateEngineImageStatus added in v0.7.0

func (s *DataStore) UpdateEngineImageStatus(img *longhorn.EngineImage) (*longhorn.EngineImage, error)

UpdateEngineImageStatus updates Longhorn EngineImage resource status and verifies update

func (*DataStore) UpdateEngineStatus added in v0.7.0

func (s *DataStore) UpdateEngineStatus(e *longhorn.Engine) (*longhorn.Engine, error)

UpdateEngineStatus updates Longhorn Engine status and verifies update

func (*DataStore) UpdateInstanceManager added in v0.6.0

func (s *DataStore) UpdateInstanceManager(im *longhorn.InstanceManager) (*longhorn.InstanceManager, error)

UpdateInstanceManager updates Longhorn InstanceManager resource and verifies update

func (*DataStore) UpdateInstanceManagerStatus added in v0.7.0

func (s *DataStore) UpdateInstanceManagerStatus(im *longhorn.InstanceManager) (*longhorn.InstanceManager, error)

UpdateInstanceManagerStatus updates Longhorn InstanceManager resource status and verifies update

func (*DataStore) UpdateNode

func (s *DataStore) UpdateNode(node *longhorn.Node) (*longhorn.Node, error)

UpdateNode updates Longhorn Node resource and verifies update

func (*DataStore) UpdateNodeStatus added in v0.7.0

func (s *DataStore) UpdateNodeStatus(node *longhorn.Node) (*longhorn.Node, error)

UpdateNodeStatus updates Longhorn Node status and verifies update

func (*DataStore) UpdatePersistentVolume added in v1.1.2

func (s *DataStore) UpdatePersistentVolume(pv *corev1.PersistentVolume) (*corev1.PersistentVolume, error)

UpdatePersistentVolume updates the PersistentVolume for the given PersistentVolume object

func (*DataStore) UpdatePersistentVolumeClaim added in v1.1.2

func (s *DataStore) UpdatePersistentVolumeClaim(namespace string, pvc *corev1.PersistentVolumeClaim) (*corev1.PersistentVolumeClaim, error)

UpdatePersistentVolumeClaim expand the PersistentVolumeClaim from the index for the given name and namespace

func (*DataStore) UpdateRecurringJob added in v1.2.0

func (s *DataStore) UpdateRecurringJob(recurringJob *longhorn.RecurringJob) (*longhorn.RecurringJob, error)

UpdateRecurringJob updates Longhorn RecurringJob and verifies update

func (*DataStore) UpdateRecurringJobStatus added in v1.2.0

func (s *DataStore) UpdateRecurringJobStatus(recurringJob *longhorn.RecurringJob) (*longhorn.RecurringJob, error)

UpdateRecurringJobStatus updates Longhorn RecurringJob resource status and verifies update

func (*DataStore) UpdateReplica

func (s *DataStore) UpdateReplica(r *longhorn.Replica) (*longhorn.Replica, error)

UpdateReplica updates Replica and verifies update

func (*DataStore) UpdateReplicaStatus added in v0.7.0

func (s *DataStore) UpdateReplicaStatus(r *longhorn.Replica) (*longhorn.Replica, error)

UpdateReplicaStatus updates Replica status and verifies update

func (*DataStore) UpdateSetting

func (s *DataStore) UpdateSetting(setting *longhorn.Setting) (*longhorn.Setting, error)

UpdateSetting updates the given Longhorn Settings and verifies update

func (*DataStore) UpdateShareManager added in v1.1.0

func (s *DataStore) UpdateShareManager(sm *longhorn.ShareManager) (*longhorn.ShareManager, error)

UpdateShareManager updates Longhorn ShareManager resource and verifies update

func (*DataStore) UpdateShareManagerStatus added in v1.1.0

func (s *DataStore) UpdateShareManagerStatus(sm *longhorn.ShareManager) (*longhorn.ShareManager, error)

UpdateShareManagerStatus updates Longhorn ShareManager resource status and verifies update

func (*DataStore) UpdateVolume

func (s *DataStore) UpdateVolume(v *longhorn.Volume) (*longhorn.Volume, error)

UpdateVolume updates Longhorn Volume and verifies update

func (*DataStore) UpdateVolumeStatus added in v0.7.0

func (s *DataStore) UpdateVolumeStatus(v *longhorn.Volume) (*longhorn.Volume, error)

UpdateVolumeStatus updates Longhorn Volume status and verifies update

func (*DataStore) ValidateSetting added in v0.6.0

func (s *DataStore) ValidateSetting(name, value string) (err error)

ValidateSetting checks the given setting value types and condition

Jump to

Keyboard shortcuts

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