datastore

package
v0.3.2-rc1 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2018 License: Apache-2.0 Imports: 28 Imported by: 2

Documentation

Index

Constants

View Source
const (
	LonghornVolumeKey = "longhornvolume"
	// NameMaximumLength restricted the length due to Kubernetes name limitation
	NameMaximumLength = 40
)
View Source
const (
	LonghornManagerDaemonSetName = "longhorn-manager"
)

Variables

This section is empty.

Functions

func ErrorIsNotFound added in v0.3.1

func ErrorIsNotFound(err error) bool

Types

type DataStore

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

func NewDataStore

func NewDataStore(
	volumeInformer lhinformers.VolumeInformer,
	engineInformer lhinformers.EngineInformer,
	replicaInformer lhinformers.ReplicaInformer,
	engineImageInformer lhinformers.EngineImageInformer,
	nodeInformer lhinformers.NodeInformer,
	settingInformer lhinformers.SettingInformer,
	lhClient lhclientset.Interface,

	podInformer coreinformers.PodInformer,
	cronJobInformer batchinformers_v1beta1.CronJobInformer,
	daemonSetInformer appsinformers_v1beta2.DaemonSetInformer,
	kubeClient clientset.Interface,
	namespace string) *DataStore

func (*DataStore) CreateDefaultNode

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

CreateDefaultNode will set default directory to node replica mount path

func (*DataStore) CreateEngine

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

func (*DataStore) CreateEngineImage

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

func (*DataStore) CreateEngineImageDaemonSet

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

func (*DataStore) CreateNode

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

func (*DataStore) CreateReplica

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

func (*DataStore) CreateSetting

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

func (*DataStore) CreateVolume

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

func (*DataStore) CreateVolumeCronJob

func (s *DataStore) CreateVolumeCronJob(volumeName string, cronJob *batchv1beta1.CronJob) (*batchv1beta1.CronJob, error)

func (*DataStore) DeleteCronJob

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

func (*DataStore) DeleteDaemonSet added in v0.3.2

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

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) DeleteManagerDaemonSet added in v0.3.2

func (s *DataStore) DeleteManagerDaemonSet() error

func (*DataStore) DeleteNode added in v0.3.1

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

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) DeleteVolume

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

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

func (*DataStore) GetCredentialFromSecret

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

func (*DataStore) GetDaemonSet added in v0.3.2

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

func (*DataStore) GetEngine

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

func (*DataStore) GetEngineImage

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

func (*DataStore) GetEngineImageDaemonSet

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

func (*DataStore) GetKubernetesNode added in v0.3.1

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

func (*DataStore) GetManagerDaemonSet added in v0.3.2

func (s *DataStore) GetManagerDaemonSet() (*appsv1beta2.DaemonSet, error)

func (*DataStore) GetManagerNodeIPMap

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

func (*DataStore) GetNode

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

func (*DataStore) GetNodeRO added in v0.3.2

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

func (*DataStore) GetReplica

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

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)

func (*DataStore) GetSettingAsInt

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

func (*DataStore) GetVolume

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

func (*DataStore) InitSettings added in v0.3.2

func (s *DataStore) InitSettings() error

func (*DataStore) IsNodeDownOrDeleted added in v0.3.2

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

func (*DataStore) ListEngineImages

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

func (*DataStore) ListEngines added in v0.3.2

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

func (*DataStore) ListEnginesByNode added in v0.3.1

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

func (*DataStore) ListEvents

func (s *DataStore) ListEvents() ([]*corev1.Event, error)

func (*DataStore) ListManagerPods

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

func (*DataStore) ListNodes

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

func (*DataStore) ListReplicas added in v0.3.2

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

func (*DataStore) ListReplicasByNode

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

func (*DataStore) ListSettings

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

func (*DataStore) ListVolumeCronJobROs

func (s *DataStore) ListVolumeCronJobROs(volumeName string) (map[string]*batchv1beta1.CronJob, error)

ListVolumeCronJobROs returns a map of read-only CronJobs for the volume

func (*DataStore) ListVolumeEngines

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

func (*DataStore) ListVolumeReplicas

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

func (*DataStore) ListVolumes

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

func (*DataStore) ListVolumesRO added in v0.3.2

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

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) RemoveFinalizerForVolume

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

RemoveFinalizerForVolume will result in deletion if DeletionTimestamp was set

func (*DataStore) ResetEngineMonitoringStatus

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

func (*DataStore) Sync

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

func (*DataStore) UpdateEngine

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

func (*DataStore) UpdateEngineImage

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

func (*DataStore) UpdateNode

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

func (*DataStore) UpdateReplica

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

func (*DataStore) UpdateSetting

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

func (*DataStore) UpdateVolume

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

func (*DataStore) UpdateVolumeAndOwner

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

func (*DataStore) UpdateVolumeCronJob

func (s *DataStore) UpdateVolumeCronJob(volumeName string, cronJob *batchv1beta1.CronJob) (*batchv1beta1.CronJob, error)

Jump to

Keyboard shortcuts

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