Documentation ¶
Index ¶
- Constants
- Variables
- func CheckInstanceManagerType(im *longhorn.InstanceManager) (types.InstanceManagerType, error)
- func ErrorIsConflict(err error) bool
- func ErrorIsNotFound(err error) bool
- type DataStore
- func (s *DataStore) CreateDefaultDisk(node *longhorn.Node) error
- func (s *DataStore) CreateDefaultNode(name string) (*longhorn.Node, error)
- func (s *DataStore) CreateEngine(e *longhorn.Engine) (*longhorn.Engine, error)
- func (s *DataStore) CreateEngineImage(img *longhorn.EngineImage) (*longhorn.EngineImage, error)
- func (s *DataStore) CreateEngineImageDaemonSet(ds *appsv1.DaemonSet) error
- func (s *DataStore) CreateInstanceManager(im *longhorn.InstanceManager) (*longhorn.InstanceManager, error)
- func (s *DataStore) CreateNode(node *longhorn.Node) (*longhorn.Node, error)
- func (s *DataStore) CreatePersisentVolume(pv *corev1.PersistentVolume) (*corev1.PersistentVolume, error)
- func (s *DataStore) CreatePersisentVolumeClaim(ns string, pvc *corev1.PersistentVolumeClaim) (*corev1.PersistentVolumeClaim, error)
- func (s *DataStore) CreatePod(pod *corev1.Pod) (*corev1.Pod, error)
- func (s *DataStore) CreateReplica(r *longhorn.Replica) (*longhorn.Replica, error)
- func (s *DataStore) CreateSetting(setting *longhorn.Setting) (*longhorn.Setting, error)
- func (s *DataStore) CreateVolume(v *longhorn.Volume) (*longhorn.Volume, error)
- func (s *DataStore) CreateVolumeCronJob(volumeName string, cronJob *batchv1beta1.CronJob) (*batchv1beta1.CronJob, error)
- func (s *DataStore) DeleteCronJob(cronJobName string) error
- func (s *DataStore) DeleteDaemonSet(name string) error
- func (s *DataStore) DeleteDeployment(name string) error
- func (s *DataStore) DeleteEngine(name string) error
- func (s *DataStore) DeleteEngineImage(name string) error
- func (s *DataStore) DeleteInstanceManager(name string) error
- func (s *DataStore) DeleteInstanceManagersForEngineImage(engineImageName string) error
- func (s *DataStore) DeleteNode(name string) error
- func (s *DataStore) DeletePod(name string) error
- func (s *DataStore) DeleteReplica(name string) error
- func (s *DataStore) DeleteVolume(name string) error
- func (s *DataStore) GetAllCronJobsList() (runtime.Object, error)
- func (s *DataStore) GetAllDaemonSetsList() (runtime.Object, error)
- func (s *DataStore) GetAllDeploymentsList() (runtime.Object, error)
- func (s *DataStore) GetAllEventsList() (runtime.Object, error)
- func (s *DataStore) GetAllJobsList() (runtime.Object, error)
- func (s *DataStore) GetAllNodesList() (runtime.Object, error)
- func (s *DataStore) GetAllPodsList() (runtime.Object, error)
- func (s *DataStore) GetAllServicesList() (runtime.Object, error)
- func (s *DataStore) GetAllStatefulSetsList() (runtime.Object, error)
- func (s *DataStore) GetCredentialFromSecret(secretName string) (map[string]string, error)
- func (s *DataStore) GetDaemonSet(name string) (*appsv1.DaemonSet, error)
- func (s *DataStore) GetDeployment(name string) (*appsv1.Deployment, error)
- func (s *DataStore) GetEngine(name string) (*longhorn.Engine, error)
- func (s *DataStore) GetEngineImage(name string) (*longhorn.EngineImage, error)
- func (s *DataStore) GetEngineImageDaemonSet(name string) (*appsv1.DaemonSet, error)
- func (s *DataStore) GetInstanceManager(name string) (*longhorn.InstanceManager, error)
- func (s *DataStore) GetInstanceManagerByInstance(obj interface{}) (*longhorn.InstanceManager, error)
- func (s *DataStore) GetInstanceManagerBySelector(node, image string, managerType types.InstanceManagerType) (*longhorn.InstanceManager, error)
- func (s *DataStore) GetInstanceManagerPod(name string) (*corev1.Pod, error)
- func (s *DataStore) GetKubernetesNode(name string) (*corev1.Node, error)
- func (s *DataStore) GetKubernetesVersion() (*version.Info, error)
- func (s *DataStore) GetLonghornEventList() (*corev1.EventList, error)
- func (s *DataStore) GetLonghornNamespace() (*corev1.Namespace, error)
- func (s *DataStore) GetManagerNodeIPMap() (map[string]string, error)
- func (s *DataStore) GetNode(name string) (*longhorn.Node, error)
- func (s *DataStore) GetPersisentVolume(pvName string) (*corev1.PersistentVolume, error)
- func (s *DataStore) GetPersisentVolumeClaim(namespace, pvcName string) (*corev1.PersistentVolumeClaim, error)
- func (s *DataStore) GetPodContainerLogRequest(podName, containerName string) *rest.Request
- func (s *DataStore) GetRandomReadyNode() (*longhorn.Node, error)
- func (s *DataStore) GetReplica(name string) (*longhorn.Replica, error)
- func (s *DataStore) GetSetting(sName types.SettingName) (*longhorn.Setting, error)
- func (s *DataStore) GetSettingAsBool(settingName types.SettingName) (bool, error)
- func (s *DataStore) GetSettingAsInt(settingName types.SettingName) (int64, error)
- func (s *DataStore) GetSettingValueExisted(sName types.SettingName) (string, error)
- func (s *DataStore) GetVolume(name string) (*longhorn.Volume, error)
- func (s *DataStore) InitSettings() error
- func (s *DataStore) IsEngineImageCLIAPIVersionOne(imageName string) (bool, error)
- func (s *DataStore) IsNodeDownOrDeleted(name string) (bool, error)
- func (s *DataStore) ListDaemonSet() ([]*appsv1.DaemonSet, error)
- func (s *DataStore) ListDeployment() ([]*appsv1.Deployment, error)
- func (s *DataStore) ListEngineImages() (map[string]*longhorn.EngineImage, error)
- func (s *DataStore) ListEngines() (map[string]*longhorn.Engine, error)
- func (s *DataStore) ListEnginesByNode(name string) ([]*longhorn.Engine, error)
- func (s *DataStore) ListEnginesROByInstanceManager(name string) ([]*longhorn.Engine, error)
- func (s *DataStore) ListInstanceManagerPods() ([]*corev1.Pod, error)
- func (s *DataStore) ListInstanceManagers() (map[string]*longhorn.InstanceManager, error)
- func (s *DataStore) ListInstanceManagersForEngineImage(engineImageName string) (map[string]*longhorn.InstanceManager, error)
- func (s *DataStore) ListManagerPods() ([]*corev1.Pod, error)
- func (s *DataStore) ListNodes() (map[string]*longhorn.Node, error)
- func (s *DataStore) ListReplicas() (map[string]*longhorn.Replica, error)
- func (s *DataStore) ListReplicasByNode(name string) (map[string][]*longhorn.Replica, error)
- func (s *DataStore) ListReplicasROByInstanceManager(name string) ([]*longhorn.Replica, error)
- func (s *DataStore) ListSettings() (map[types.SettingName]*longhorn.Setting, error)
- func (s *DataStore) ListStandbyVolumesRO() (map[string]*longhorn.Volume, error)
- func (s *DataStore) ListVolumeCronJobROs(volumeName string) (map[string]*batchv1beta1.CronJob, error)
- func (s *DataStore) ListVolumeEngines(volumeName string) (map[string]*longhorn.Engine, error)
- func (s *DataStore) ListVolumeReplicas(volumeName string) (map[string]*longhorn.Replica, error)
- func (s *DataStore) ListVolumes() (map[string]*longhorn.Volume, error)
- func (s *DataStore) ListVolumesRO() ([]*longhorn.Volume, error)
- func (s *DataStore) RemoveFinalizerForEngine(obj *longhorn.Engine) error
- func (s *DataStore) RemoveFinalizerForEngineImage(obj *longhorn.EngineImage) error
- func (s *DataStore) RemoveFinalizerForInstanceManager(obj *longhorn.InstanceManager) error
- func (s *DataStore) RemoveFinalizerForNode(obj *longhorn.Node) error
- func (s *DataStore) RemoveFinalizerForReplica(obj *longhorn.Replica) error
- func (s *DataStore) RemoveFinalizerForVolume(obj *longhorn.Volume) error
- func (s *DataStore) ResetEngineMonitoringStatus(e *longhorn.Engine) (*longhorn.Engine, error)
- func (s *DataStore) Sync(stopCh <-chan struct{}) bool
- func (s *DataStore) UpdateDaemonSet(obj *appsv1.DaemonSet) (*appsv1.DaemonSet, error)
- func (s *DataStore) UpdateDeployment(obj *appsv1.Deployment) (*appsv1.Deployment, error)
- func (s *DataStore) UpdateEngine(e *longhorn.Engine) (*longhorn.Engine, error)
- func (s *DataStore) UpdateEngineImage(img *longhorn.EngineImage) (*longhorn.EngineImage, error)
- func (s *DataStore) UpdateInstanceManager(im *longhorn.InstanceManager) (*longhorn.InstanceManager, error)
- func (s *DataStore) UpdateNode(node *longhorn.Node) (*longhorn.Node, error)
- func (s *DataStore) UpdatePersisentVolume(pv *corev1.PersistentVolume) (*corev1.PersistentVolume, error)
- func (s *DataStore) UpdateReplica(r *longhorn.Replica) (*longhorn.Replica, error)
- func (s *DataStore) UpdateSetting(setting *longhorn.Setting) (*longhorn.Setting, error)
- func (s *DataStore) UpdateVolume(v *longhorn.Volume) (*longhorn.Volume, error)
- func (s *DataStore) UpdateVolumeAndOwner(v *longhorn.Volume) (*longhorn.Volume, error)
- func (s *DataStore) UpdateVolumeCronJob(volumeName string, cronJob *batchv1beta1.CronJob) (*batchv1beta1.CronJob, error)
- func (s *DataStore) ValidateSetting(name, value string) (err error)
Constants ¶
const ( LonghornVolumeKey = "longhornvolume" // NameMaximumLength restricted the length due to Kubernetes name limitation NameMaximumLength = 40 )
Variables ¶
var ( VerificationRetryInterval = 100 * time.Millisecond VerificationRetryCounts = 20 )
var (
SkipListerCheck = false
)
Functions ¶
func CheckInstanceManagerType ¶ added in v0.6.0
func CheckInstanceManagerType(im *longhorn.InstanceManager) (types.InstanceManagerType, error)
func ErrorIsConflict ¶ added in v0.5.0
func ErrorIsNotFound ¶ added in v0.3.1
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, imInformer lhinformers.InstanceManagerInformer, lhClient lhclientset.Interface, podInformer coreinformers.PodInformer, cronJobInformer batchinformers_v1beta1.CronJobInformer, daemonSetInformer appsinformers.DaemonSetInformer, deploymentInformer appsinformers.DeploymentInformer, persistentVolumeInformer coreinformers.PersistentVolumeInformer, persistentVolumeClaimInformer coreinformers.PersistentVolumeClaimInformer, kubeNodeInformer coreinformers.NodeInformer, kubeClient clientset.Interface, namespace string) *DataStore
func (*DataStore) CreateDefaultDisk ¶ added in v0.6.0
CreateDefaultDisk creates a default DiskSpec based on DefaultDataPath and applies it to the provided Node.
func (*DataStore) CreateDefaultNode ¶
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 (*DataStore) CreateEngineImage ¶
func (s *DataStore) CreateEngineImage(img *longhorn.EngineImage) (*longhorn.EngineImage, error)
func (*DataStore) CreateEngineImageDaemonSet ¶
func (*DataStore) CreateInstanceManager ¶ added in v0.6.0
func (s *DataStore) CreateInstanceManager(im *longhorn.InstanceManager) (*longhorn.InstanceManager, error)
func (*DataStore) CreateNode ¶
func (*DataStore) CreatePersisentVolume ¶ added in v0.5.0
func (s *DataStore) CreatePersisentVolume(pv *corev1.PersistentVolume) (*corev1.PersistentVolume, error)
func (*DataStore) CreatePersisentVolumeClaim ¶ added in v0.5.0
func (s *DataStore) CreatePersisentVolumeClaim(ns string, pvc *corev1.PersistentVolumeClaim) (*corev1.PersistentVolumeClaim, error)
func (*DataStore) CreateReplica ¶
func (*DataStore) CreateSetting ¶
func (*DataStore) CreateVolume ¶
func (*DataStore) CreateVolumeCronJob ¶
func (s *DataStore) CreateVolumeCronJob(volumeName string, cronJob *batchv1beta1.CronJob) (*batchv1beta1.CronJob, error)
func (*DataStore) DeleteCronJob ¶
func (*DataStore) DeleteDaemonSet ¶ added in v0.3.2
func (*DataStore) DeleteDeployment ¶ added in v0.4.0
func (*DataStore) DeleteEngine ¶
DeleteEngine won't result in immediately deletion since finalizer was set by default
func (*DataStore) DeleteEngineImage ¶
DeleteEngineImage won't result in immediately deletion since finalizer was set by default
func (*DataStore) DeleteInstanceManager ¶ added in v0.6.0
DeleteInstanceManager won't result in immediately deletion since finalizer was set by default
func (*DataStore) DeleteInstanceManagersForEngineImage ¶ added in v0.6.0
func (*DataStore) DeleteNode ¶ added in v0.3.1
func (*DataStore) DeleteReplica ¶
DeleteReplica won't result in immediately deletion since finalizer was set by default
func (*DataStore) DeleteVolume ¶
DeleteVolume won't result in immediately deletion since finalizer was set by default
func (*DataStore) GetAllCronJobsList ¶ added in v0.4.0
func (*DataStore) GetAllDaemonSetsList ¶ added in v0.4.0
func (*DataStore) GetAllDeploymentsList ¶ added in v0.4.0
func (*DataStore) GetAllEventsList ¶ added in v0.4.0
func (*DataStore) GetAllJobsList ¶ added in v0.4.0
func (*DataStore) GetAllNodesList ¶ added in v0.5.0
func (*DataStore) GetAllPodsList ¶ added in v0.4.0
func (*DataStore) GetAllServicesList ¶ added in v0.4.0
func (*DataStore) GetAllStatefulSetsList ¶ added in v0.4.0
func (*DataStore) GetCredentialFromSecret ¶
func (*DataStore) GetDaemonSet ¶ added in v0.3.2
func (*DataStore) GetDeployment ¶ added in v0.4.0
func (s *DataStore) GetDeployment(name string) (*appsv1.Deployment, error)
func (*DataStore) GetEngineImage ¶
func (s *DataStore) GetEngineImage(name string) (*longhorn.EngineImage, error)
func (*DataStore) GetEngineImageDaemonSet ¶
func (*DataStore) GetInstanceManager ¶ added in v0.6.0
func (s *DataStore) GetInstanceManager(name string) (*longhorn.InstanceManager, error)
func (*DataStore) GetInstanceManagerByInstance ¶ added in v0.6.0
func (s *DataStore) GetInstanceManagerByInstance(obj interface{}) (*longhorn.InstanceManager, error)
func (*DataStore) GetInstanceManagerBySelector ¶ added in v0.6.0
func (s *DataStore) GetInstanceManagerBySelector(node, image string, managerType types.InstanceManagerType) (*longhorn.InstanceManager, error)
GetInstanceManagerBySelector gets the Instance Managers matching the selector using Labels. Even though the labels duplicate information already in the spec, spec cannot be used for Field Selectors in CustomResourceDefinitions: https://github.com/kubernetes/kubernetes/issues/53459
func (*DataStore) GetInstanceManagerPod ¶ added in v0.6.0
func (*DataStore) GetKubernetesNode ¶ added in v0.3.1
func (*DataStore) GetKubernetesVersion ¶ added in v0.4.0
func (*DataStore) GetLonghornEventList ¶ added in v0.4.0
func (*DataStore) GetLonghornNamespace ¶ added in v0.4.0
func (*DataStore) GetManagerNodeIPMap ¶
func (*DataStore) GetPersisentVolume ¶ added in v0.5.0
func (s *DataStore) GetPersisentVolume(pvName string) (*corev1.PersistentVolume, error)
func (*DataStore) GetPersisentVolumeClaim ¶ added in v0.5.0
func (s *DataStore) GetPersisentVolumeClaim(namespace, pvcName string) (*corev1.PersistentVolumeClaim, error)
func (*DataStore) GetPodContainerLogRequest ¶ added in v0.4.0
func (*DataStore) GetRandomReadyNode ¶ added in v0.6.0
func (*DataStore) GetReplica ¶
func (*DataStore) GetSetting ¶
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) GetSettingValueExisted ¶ added in v0.5.0
func (s *DataStore) GetSettingValueExisted(sName types.SettingName) (string, error)
func (*DataStore) InitSettings ¶ added in v0.3.2
func (*DataStore) IsEngineImageCLIAPIVersionOne ¶ added in v0.6.0
func (*DataStore) IsNodeDownOrDeleted ¶ added in v0.3.2
func (*DataStore) ListDaemonSet ¶ added in v0.6.0
func (*DataStore) ListDeployment ¶ added in v0.6.0
func (s *DataStore) ListDeployment() ([]*appsv1.Deployment, error)
func (*DataStore) ListEngineImages ¶
func (s *DataStore) ListEngineImages() (map[string]*longhorn.EngineImage, error)
func (*DataStore) ListEngines ¶ added in v0.3.2
func (*DataStore) ListEnginesByNode ¶ added in v0.3.1
func (*DataStore) ListEnginesROByInstanceManager ¶ added in v0.6.0
func (*DataStore) ListInstanceManagerPods ¶ added in v0.6.0
func (*DataStore) ListInstanceManagers ¶ added in v0.6.0
func (s *DataStore) ListInstanceManagers() (map[string]*longhorn.InstanceManager, error)
func (*DataStore) ListInstanceManagersForEngineImage ¶ added in v0.6.0
func (*DataStore) ListReplicas ¶ added in v0.3.2
func (*DataStore) ListReplicasByNode ¶
func (*DataStore) ListReplicasROByInstanceManager ¶ added in v0.6.0
func (*DataStore) ListSettings ¶
func (*DataStore) ListStandbyVolumesRO ¶ added in v0.5.0
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 (*DataStore) ListVolumeReplicas ¶
func (*DataStore) ListVolumes ¶
func (*DataStore) ListVolumesRO ¶ added in v0.3.2
func (*DataStore) RemoveFinalizerForEngine ¶
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) RemoveFinalizerForInstanceManager ¶ added in v0.6.0
func (s *DataStore) RemoveFinalizerForInstanceManager(obj *longhorn.InstanceManager) error
RemoveFinalizerForInstanceManager will result in deletion if DeletionTimestamp was set
func (*DataStore) RemoveFinalizerForNode ¶
RemoveFinalizerForNode will result in deletion if DeletionTimestamp was set
func (*DataStore) RemoveFinalizerForReplica ¶
RemoveFinalizerForReplica will result in deletion if DeletionTimestamp was set
func (*DataStore) RemoveFinalizerForVolume ¶
RemoveFinalizerForVolume will result in deletion if DeletionTimestamp was set
func (*DataStore) ResetEngineMonitoringStatus ¶
func (*DataStore) UpdateDaemonSet ¶ added in v0.6.0
func (*DataStore) UpdateDeployment ¶ added in v0.6.0
func (s *DataStore) UpdateDeployment(obj *appsv1.Deployment) (*appsv1.Deployment, error)
func (*DataStore) UpdateEngine ¶
func (*DataStore) UpdateEngineImage ¶
func (s *DataStore) UpdateEngineImage(img *longhorn.EngineImage) (*longhorn.EngineImage, error)
func (*DataStore) UpdateInstanceManager ¶ added in v0.6.0
func (s *DataStore) UpdateInstanceManager(im *longhorn.InstanceManager) (*longhorn.InstanceManager, error)
func (*DataStore) UpdateNode ¶
func (*DataStore) UpdatePersisentVolume ¶ added in v0.5.0
func (s *DataStore) UpdatePersisentVolume(pv *corev1.PersistentVolume) (*corev1.PersistentVolume, error)
func (*DataStore) UpdateReplica ¶
func (*DataStore) UpdateSetting ¶
func (*DataStore) UpdateVolume ¶
func (*DataStore) UpdateVolumeAndOwner ¶
func (*DataStore) UpdateVolumeCronJob ¶
func (s *DataStore) UpdateVolumeCronJob(volumeName string, cronJob *batchv1beta1.CronJob) (*batchv1beta1.CronJob, error)