controller

package
v1.3.2-rc2 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2022 License: Apache-2.0 Imports: 61 Imported by: 2

Documentation

Index

Constants

View Source
const (
	BackingImageDataSourcePodContainerName = "backing-image-data-source"

	DataSourceTypeExportFromVolumeParameterVolumeName    = "volume-name"
	DataSourceTypeExportFromVolumeParameterVolumeSize    = "volume-size"
	DataSourceTypeExportFromVolumeParameterSnapshotName  = "snapshot-name"
	DataSourceTypeExportFromVolumeParameterSenderAddress = "sender-address"
)
View Source
const (
	EventReasonCreate         = "Create"
	EventReasonFailedCreating = "FailedCreating"
	EventReasonDelete         = "Delete"
	EventReasonFailedDeleting = "FailedDeleting"
	EventReasonStart          = "Start"
	EventReasonFailedStarting = "FailedStarting"
	EventReasonStop           = "Stop"
	EventReasonFailedStopping = "FailedStopping"
	EventReasonUpdate         = "Update"

	EventReasonRebuilt          = "Rebuilt"
	EventReasonRebuilding       = "Rebuilding"
	EventReasonFailedRebuilding = "FailedRebuilding"

	EventReasonVolumeCloneCompleted = "VolumeCloneCompleted"
	EventReasonVolumeCloneInitiated = "VolumeCloneInitiated"
	EventReasonVolumeCloneFailed    = "VolumeCloneFailed"

	EventReasonFailedStartingSnapshotPurge = "FailedStartingSnapshotPurge"
	EventReasonTimeoutSnapshotPurge        = "TimeoutSnapshotPurge"
	EventReasonFailedSnapshotPurge         = "FailedSnapshotPurge"

	EventReasonFailedRestore = "FailedRestore"

	EventReasonFailedExpansion    = "FailedExpansion"
	EventReasonSucceededExpansion = "SucceededExpansion"
	EventReasonCanceledExpansion  = "CanceledExpansion"

	EventReasonAttached       = "Attached"
	EventReasonDetached       = "Detached"
	EventReasonHealthy        = "Healthy"
	EventReasonFaulted        = "Faulted"
	EventReasonDegraded       = "Degraded"
	EventReasonOrphaned       = "Orphaned"
	EventReasonUnknown        = "Unknown"
	EventReasonFailedEviction = "FailedEviction"

	EventReasonDetachedUnexpectly = "DetachedUnexpectly"
	EventReasonRemount            = "Remount"
	EventReasonAutoSalvaged       = "AutoSalvaged"

	EventReasonFetching = "Fetching"
	EventReasonSyncing  = "Syncing"
)
View Source
const (
	VersionTagLatest = "latest"
	VersionTagStable = "stable"
)
View Source
const (
	CRDEngineName                 = "engines.longhorn.io"
	CRDReplicaName                = "replicas.longhorn.io"
	CRDVolumeName                 = "volumes.longhorn.io"
	CRDEngineImageName            = "engineimages.longhorn.io"
	CRDNodeName                   = "nodes.longhorn.io"
	CRDInstanceManagerName        = "instancemanagers.longhorn.io"
	CRDShareManagerName           = "sharemanagers.longhorn.io"
	CRDBackingImageName           = "backingimages.longhorn.io"
	CRDBackingImageManagerName    = "backingimagemanagers.longhorn.io"
	CRDBackingImageDataSourceName = "backingimagedatasources.longhorn.io"
	CRDBackupTargetName           = "backuptargets.longhorn.io"
	CRDBackupVolumeName           = "backupvolumes.longhorn.io"
	CRDBackupName                 = "backups.longhorn.io"
	CRDRecurringJobName           = "recurringjobs.longhorn.io"
	CRDOrphanName                 = "orphans.longhorn.io"
	CRDSnapshotName               = "snapshots.longhorn.io"

	EnvLonghornNamespace = "LONGHORN_NAMESPACE"
)
View Source
const (
	CronJobBackoffLimit               = 3
	CronJobSuccessfulJobsHistoryLimit = 1
	VolumeSnapshotsWarningThreshold   = 100

	LastAppliedCronJobSpecAnnotationKeySuffix = "last-applied-cronjob-spec"
)
View Source
const (
	BackingImageManagerPodContainerName = "backing-image-manager"
)
View Source
const (
	ConflictRetryCount = 5
)

Variables

View Source
var (
	EnginePollInterval = 5 * time.Second
	EnginePollTimeout  = 30 * time.Second

	EngineMonitorConflictRetryCount = 5
)
View Source
var (
	RetryInterval = 100 * time.Millisecond
	RetryCounts   = 20

	AutoSalvageTimeLimit = 1 * time.Minute
)
View Source
var (
	ExpiredEngineImageTimeout = 60 * time.Minute
)
View Source
var (
	Workers = 5
)

Functions

func BackingImageDiskFileCleanup added in v1.2.0

func BackingImageDiskFileCleanup(node *longhorn.Node, bi *longhorn.BackingImage, bids *longhorn.BackingImageDataSource, waitInterval time.Duration, haRequirement int)

func EnhancedDefaultControllerRateLimiter added in v0.8.0

func EnhancedDefaultControllerRateLimiter() workqueue.RateLimiter

EnhancedDefaultControllerRateLimiter is an enhanced version of workqueue.DefaultControllerRateLimiter() See https://github.com/longhorn/longhorn/issues/1058 for details

func GetBinaryClientForEngine added in v1.3.0

func GetBinaryClientForEngine(e *longhorn.Engine, engines engineapi.EngineClientCollection, image string) (client *engineapi.EngineBinary, err error)

func GetInstanceManagerCPURequirement added in v1.1.1

func GetInstanceManagerCPURequirement(ds *datastore.DataStore, imName string) (*corev1.ResourceRequirements, error)

func IsRebuildingReplica added in v1.2.1

func IsRebuildingReplica(r *longhorn.Replica) bool

func IsSameGuaranteedCPURequirement added in v1.0.0

func IsSameGuaranteedCPURequirement(a, b *corev1.ResourceRequirements) bool

func ParseResourceRequirement added in v1.1.1

func ParseResourceRequirement(val string) (*corev1.ResourceRequirements, error)

Types

type BackingImageController added in v1.1.1

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

func NewBackingImageController added in v1.1.1

func NewBackingImageController(
	logger logrus.FieldLogger,
	ds *datastore.DataStore,
	scheme *runtime.Scheme,
	kubeClient clientset.Interface,
	namespace string, controllerID, serviceAccount string) *BackingImageController

func (*BackingImageController) Run added in v1.1.1

func (bic *BackingImageController) Run(workers int, stopCh <-chan struct{})

type BackingImageDataSourceController added in v1.2.0

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

func NewBackingImageDataSourceController added in v1.2.0

func NewBackingImageDataSourceController(
	logger logrus.FieldLogger,
	ds *datastore.DataStore,
	scheme *runtime.Scheme,
	kubeClient clientset.Interface,
	namespace, controllerID, serviceAccount string,
	proxyConnCounter util.Counter,
) *BackingImageDataSourceController

func (*BackingImageDataSourceController) Run added in v1.2.0

func (c *BackingImageDataSourceController) Run(workers int, stopCh <-chan struct{})

type BackingImageDataSourceMonitor added in v1.2.0

type BackingImageDataSourceMonitor struct {
	Name string
	// contains filtered or unexported fields
}

type BackingImageManagerController added in v1.1.1

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

func NewBackingImageManagerController added in v1.1.1

func NewBackingImageManagerController(
	logger logrus.FieldLogger,
	ds *datastore.DataStore,
	scheme *runtime.Scheme,
	kubeClient clientset.Interface,
	namespace, controllerID, serviceAccount string) *BackingImageManagerController

func (*BackingImageManagerController) Run added in v1.1.1

func (c *BackingImageManagerController) Run(workers int, stopCh <-chan struct{})

type BackingImageManagerMonitor added in v1.1.1

type BackingImageManagerMonitor struct {
	Name string
	// contains filtered or unexported fields
}

func (*BackingImageManagerMonitor) Run added in v1.1.1

func (m *BackingImageManagerMonitor) Run()

type BackupController added in v1.2.0

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

func NewBackupController added in v1.2.0

func NewBackupController(
	logger logrus.FieldLogger,
	ds *datastore.DataStore,
	scheme *runtime.Scheme,
	kubeClient clientset.Interface,
	controllerID string,
	namespace string,
	proxyConnCounter util.Counter,
) *BackupController

func (*BackupController) Run added in v1.2.0

func (bc *BackupController) Run(workers int, stopCh <-chan struct{})

type BackupStoreTimer added in v1.2.0

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

func (*BackupStoreTimer) Start added in v1.2.0

func (bst *BackupStoreTimer) Start()

func (*BackupStoreTimer) Stop added in v1.2.0

func (bst *BackupStoreTimer) Stop()

type BackupTargetController added in v1.2.0

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

func NewBackupTargetController added in v1.2.0

func NewBackupTargetController(
	logger logrus.FieldLogger,
	ds *datastore.DataStore,
	scheme *runtime.Scheme,
	kubeClient clientset.Interface,
	controllerID string,
	namespace string,
	proxyConnCounter util.Counter) *BackupTargetController

func (*BackupTargetController) Run added in v1.2.0

func (btc *BackupTargetController) Run(workers int, stopCh <-chan struct{})

type BackupVolumeController added in v1.2.0

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

func NewBackupVolumeController added in v1.2.0

func NewBackupVolumeController(
	logger logrus.FieldLogger,
	ds *datastore.DataStore,
	scheme *runtime.Scheme,
	kubeClient clientset.Interface,
	controllerID string,
	namespace string,
	proxyConnCounter util.Counter,
) *BackupVolumeController

func (*BackupVolumeController) Run added in v1.2.0

func (bvc *BackupVolumeController) Run(workers int, stopCh <-chan struct{})

type CheckUpgradeRequest added in v0.3.2

type CheckUpgradeRequest struct {
	AppVersion string            `json:"appVersion"`
	ExtraInfo  map[string]string `json:"extraInfo"`
}

type CheckUpgradeResponse added in v0.3.2

type CheckUpgradeResponse struct {
	Versions []Version `json:"versions"`
}

type EngineController

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

func NewEngineController

func NewEngineController(
	logger logrus.FieldLogger,
	ds *datastore.DataStore,
	scheme *runtime.Scheme,
	kubeClient clientset.Interface,
	engines engineapi.EngineClientCollection,
	namespace string, controllerID string,
	proxyConnCounter util.Counter) *EngineController

func (*EngineController) CreateInstance added in v0.6.0

func (ec *EngineController) CreateInstance(obj interface{}) (*longhorn.InstanceProcess, error)

func (*EngineController) DeleteInstance added in v0.6.0

func (ec *EngineController) DeleteInstance(obj interface{}) error

func (*EngineController) GetInstance added in v0.6.0

func (ec *EngineController) GetInstance(obj interface{}) (*longhorn.InstanceProcess, error)

func (*EngineController) LogInstance added in v0.6.0

func (ec *EngineController) LogInstance(ctx context.Context, obj interface{}) (*engineapi.InstanceManagerClient, *imapi.LogStream, error)

func (*EngineController) ReconcileEngineState

func (ec *EngineController) ReconcileEngineState(e *longhorn.Engine) error

func (*EngineController) Run

func (ec *EngineController) Run(workers int, stopCh <-chan struct{})

func (*EngineController) Upgrade

func (ec *EngineController) Upgrade(e *longhorn.Engine) (err error)

func (*EngineController) UpgradeEngineProcess added in v0.8.0

func (ec *EngineController) UpgradeEngineProcess(e *longhorn.Engine) error

type EngineImageController

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

func NewEngineImageController

func NewEngineImageController(
	logger logrus.FieldLogger,
	ds *datastore.DataStore,
	scheme *runtime.Scheme,
	kubeClient clientset.Interface,
	namespace string, controllerID, serviceAccount string) *EngineImageController

func (*EngineImageController) ResolveRefAndEnqueue

func (ic *EngineImageController) ResolveRefAndEnqueue(namespace string, ref *metav1.OwnerReference)

func (*EngineImageController) Run

func (ic *EngineImageController) Run(workers int, stopCh <-chan struct{})

type EngineMonitor

type EngineMonitor struct {
	Name string
	// contains filtered or unexported fields
}

func (*EngineMonitor) Run

func (m *EngineMonitor) Run()

type InstanceHandler

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

InstanceHandler can handle the state transition of correlated instance and engine/replica object. It assumed the instance it's going to operate with is using the SAME NAME from the engine/replica object

func NewInstanceHandler

func NewInstanceHandler(ds *datastore.DataStore, instanceManagerHandler InstanceManagerHandler, eventRecorder record.EventRecorder) *InstanceHandler

func (*InstanceHandler) ReconcileInstanceState

func (h *InstanceHandler) ReconcileInstanceState(obj interface{}, spec *longhorn.InstanceSpec, status *longhorn.InstanceStatus) (err error)

type InstanceManagerController added in v0.6.0

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

func NewInstanceManagerController added in v0.6.0

func NewInstanceManagerController(
	logger logrus.FieldLogger,
	ds *datastore.DataStore,
	scheme *runtime.Scheme,
	kubeClient clientset.Interface,
	namespace, controllerID, serviceAccount string,
) *InstanceManagerController

func (*InstanceManagerController) Run added in v0.6.0

func (imc *InstanceManagerController) Run(workers int, stopCh <-chan struct{})

type InstanceManagerHandler added in v0.6.0

type InstanceManagerHandler interface {
	GetInstance(obj interface{}) (*longhorn.InstanceProcess, error)
	CreateInstance(obj interface{}) (*longhorn.InstanceProcess, error)
	DeleteInstance(obj interface{}) error
	LogInstance(ctx context.Context, obj interface{}) (*engineapi.InstanceManagerClient, *imapi.LogStream, error)
}

type InstanceManagerMonitor added in v0.6.0

type InstanceManagerMonitor struct {
	Name string
	// contains filtered or unexported fields
}

func (*InstanceManagerMonitor) CheckMonitorStoppedWithLock added in v1.1.2

func (m *InstanceManagerMonitor) CheckMonitorStoppedWithLock() bool

func (*InstanceManagerMonitor) Run added in v0.6.0

func (m *InstanceManagerMonitor) Run()

func (*InstanceManagerMonitor) StopMonitorWithLock added in v1.1.2

func (m *InstanceManagerMonitor) StopMonitorWithLock()

type KubernetesConfigMapController added in v1.1.0

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

func NewKubernetesConfigMapController added in v1.1.0

func NewKubernetesConfigMapController(
	logger logrus.FieldLogger,
	ds *datastore.DataStore,
	scheme *runtime.Scheme,
	kubeClient clientset.Interface,
	controllerID string,
	namespace string) *KubernetesConfigMapController

func (*KubernetesConfigMapController) Run added in v1.1.0

func (kc *KubernetesConfigMapController) Run(workers int, stopCh <-chan struct{})

type KubernetesNodeController added in v0.8.1

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

func NewKubernetesNodeController added in v0.8.1

func NewKubernetesNodeController(
	logger logrus.FieldLogger,
	ds *datastore.DataStore,
	scheme *runtime.Scheme,
	kubeClient clientset.Interface,
	controllerID string) *KubernetesNodeController

func (*KubernetesNodeController) Run added in v0.8.1

func (knc *KubernetesNodeController) Run(workers int, stopCh <-chan struct{})

type KubernetesPVController added in v0.8.1

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

func NewKubernetesPVController added in v0.8.1

func NewKubernetesPVController(
	logger logrus.FieldLogger,
	ds *datastore.DataStore,
	scheme *runtime.Scheme,
	kubeClient clientset.Interface,
	controllerID string) *KubernetesPVController

func (*KubernetesPVController) Run added in v0.8.1

func (kc *KubernetesPVController) Run(workers int, stopCh <-chan struct{})

type KubernetesPodController added in v1.1.0

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

func NewKubernetesPodController added in v1.1.0

func NewKubernetesPodController(
	logger logrus.FieldLogger,
	ds *datastore.DataStore,
	scheme *runtime.Scheme,
	kubeClient clientset.Interface,
	controllerID string) *KubernetesPodController

func (*KubernetesPodController) Run added in v1.1.0

func (kc *KubernetesPodController) Run(workers int, stopCh <-chan struct{})

type KubernetesSecretController added in v1.1.1

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

func NewKubernetesSecretController added in v1.1.1

func NewKubernetesSecretController(
	logger logrus.FieldLogger,
	ds *datastore.DataStore,
	scheme *runtime.Scheme,
	kubeClient clientset.Interface,
	controllerID string,
	namespace string) *KubernetesSecretController

func (*KubernetesSecretController) Run added in v1.1.1

func (ks *KubernetesSecretController) Run(workers int, stopCh <-chan struct{})

type NodeController

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

func NewNodeController

func NewNodeController(
	logger logrus.FieldLogger,
	ds *datastore.DataStore,
	scheme *runtime.Scheme,
	kubeClient clientset.Interface,
	namespace, controllerID string) *NodeController

func (*NodeController) Run

func (nc *NodeController) Run(workers int, stopCh <-chan struct{})

type OrphanController added in v1.3.0

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

func NewOrphanController added in v1.3.0

func NewOrphanController(
	logger logrus.FieldLogger,
	ds *datastore.DataStore,
	scheme *runtime.Scheme,
	kubeClient clientset.Interface,
	controllerID string,
	namespace string) *OrphanController

func (*OrphanController) Run added in v1.3.0

func (oc *OrphanController) Run(workers int, stopCh <-chan struct{})

type RecurringJobController added in v1.2.0

type RecurringJobController struct {
	ManagerImage string
	// contains filtered or unexported fields
}

func NewRecurringJobController added in v1.2.0

func NewRecurringJobController(
	logger logrus.FieldLogger,
	ds *datastore.DataStore,
	scheme *runtime.Scheme,
	kubeClient clientset.Interface,
	namespace, controllerID, serviceAccount, managerImage string,
) *RecurringJobController

func (*RecurringJobController) Run added in v1.2.0

func (control *RecurringJobController) Run(workers int, stopCh <-chan struct{})

type ReplicaController

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

func NewReplicaController

func NewReplicaController(
	logger logrus.FieldLogger,
	ds *datastore.DataStore,
	scheme *runtime.Scheme,
	kubeClient clientset.Interface,
	namespace string, controllerID string) *ReplicaController

func (*ReplicaController) CanStartRebuildingReplica added in v1.2.1

func (rc *ReplicaController) CanStartRebuildingReplica(r *longhorn.Replica) (bool, error)

func (*ReplicaController) CreateInstance added in v0.6.0

func (rc *ReplicaController) CreateInstance(obj interface{}) (*longhorn.InstanceProcess, error)

func (*ReplicaController) DeleteInstance added in v0.6.0

func (rc *ReplicaController) DeleteInstance(obj interface{}) error

func (*ReplicaController) GetBackingImagePathForReplicaStarting added in v1.2.1

func (rc *ReplicaController) GetBackingImagePathForReplicaStarting(r *longhorn.Replica) (string, error)

func (*ReplicaController) GetInstance added in v0.6.0

func (rc *ReplicaController) GetInstance(obj interface{}) (*longhorn.InstanceProcess, error)

func (*ReplicaController) LogInstance added in v0.6.0

func (rc *ReplicaController) LogInstance(ctx context.Context, obj interface{}) (*engineapi.InstanceManagerClient, *imapi.LogStream, error)

func (*ReplicaController) Run

func (rc *ReplicaController) Run(workers int, stopCh <-chan struct{})

func (*ReplicaController) UpdateReplicaEvictionStatus added in v1.1.0

func (rc *ReplicaController) UpdateReplicaEvictionStatus(replica *longhorn.Replica)

type SettingController added in v0.3.2

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

func NewSettingController added in v0.3.2

func NewSettingController(
	logger logrus.FieldLogger,
	ds *datastore.DataStore,
	scheme *runtime.Scheme,
	kubeClient clientset.Interface,
	namespace, controllerID, version string) *SettingController

func (*SettingController) CheckLatestAndStableLonghornVersions added in v1.2.1

func (sc *SettingController) CheckLatestAndStableLonghornVersions() (string, string, error)

func (*SettingController) Run added in v0.3.2

func (sc *SettingController) Run(stopCh <-chan struct{})

type ShareManagerController added in v1.1.0

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

func NewShareManagerController added in v1.1.0

func NewShareManagerController(
	logger logrus.FieldLogger,
	ds *datastore.DataStore,
	scheme *runtime.Scheme,

	kubeClient clientset.Interface,
	namespace, controllerID, serviceAccount string) *ShareManagerController

func (*ShareManagerController) Run added in v1.1.0

func (c *ShareManagerController) Run(workers int, stopCh <-chan struct{})

type SimpleResourceEventHandler

type SimpleResourceEventHandler struct{ ChangeFunc func() }

func (SimpleResourceEventHandler) OnAdd

func (s SimpleResourceEventHandler) OnAdd(obj interface{})

func (SimpleResourceEventHandler) OnDelete

func (s SimpleResourceEventHandler) OnDelete(obj interface{})

func (SimpleResourceEventHandler) OnUpdate

func (s SimpleResourceEventHandler) OnUpdate(oldObj, newObj interface{})

type SnapshotController added in v1.3.0

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

func NewSnapshotController added in v1.3.0

func NewSnapshotController(
	logger logrus.FieldLogger,
	ds *datastore.DataStore,
	scheme *runtime.Scheme,
	kubeClient clientset.Interface,
	namespace string,
	controllerID string,
	engineClientCollection engineapi.EngineClientCollection,
	proxyConnCounter util.Counter,
) *SnapshotController

func (*SnapshotController) Run added in v1.3.0

func (sc *SnapshotController) Run(workers int, stopCh <-chan struct{})

type TopologyLabelsChecker added in v0.8.0

type TopologyLabelsChecker func(kubeClient clientset.Interface, vers string) (bool, error)

type UninstallController added in v0.3.2

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

func NewUninstallController added in v0.3.2

func NewUninstallController(
	logger logrus.FieldLogger,
	namespace string,
	force bool,
	ds *datastore.DataStore,
	stopCh chan struct{},
	kubeClient clientset.Interface,
	extensionsClient apiextension.Interface,
) *UninstallController

func (*UninstallController) Run added in v0.3.2

func (c *UninstallController) Run() error

type Version added in v0.3.2

type Version struct {
	Name        string // must be in semantic versioning
	ReleaseDate string
	Tags        []string
}

type VolumeController

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

func NewVolumeController

func NewVolumeController(
	logger logrus.FieldLogger,
	ds *datastore.DataStore,
	scheme *runtime.Scheme,
	kubeClient clientset.Interface,
	namespace,
	controllerID string,
	proxyConnCounter util.Counter,
) *VolumeController

func (*VolumeController) EvictReplicas added in v1.1.0

func (vc *VolumeController) EvictReplicas(v *longhorn.Volume,
	e *longhorn.Engine, rs map[string]*longhorn.Replica, healthyCount int) (err error)

EvictReplicas do creating one more replica for eviction, if requested

func (*VolumeController) IsReplicaUnavailable added in v1.2.1

func (vc *VolumeController) IsReplicaUnavailable(r *longhorn.Replica) (bool, error)

func (*VolumeController) ReconcileBackupVolumeState added in v1.2.0

func (vc *VolumeController) ReconcileBackupVolumeState(volume *longhorn.Volume) error

ReconcileBackupVolumeState is responsible for syncing the state of backup volumes to volume.status

func (*VolumeController) ReconcileEngineReplicaState

func (vc *VolumeController) ReconcileEngineReplicaState(v *longhorn.Volume, es map[string]*longhorn.Engine, rs map[string]*longhorn.Replica) (err error)

ReconcileEngineReplicaState will get the current main engine e.Status.ReplicaModeMap, e.Status.RestoreStatus, e.Status.purgeStatus, and e.Status.SnapshotCloneStatus then update v and rs accordingly.

func (*VolumeController) ReconcileShareManagerState added in v1.1.0

func (vc *VolumeController) ReconcileShareManagerState(volume *longhorn.Volume) error

ReconcileShareManagerState is responsible for syncing the state of shared volumes with their share manager

func (*VolumeController) ReconcileVolumeState

func (vc *VolumeController) ReconcileVolumeState(v *longhorn.Volume, es map[string]*longhorn.Engine, rs map[string]*longhorn.Replica) (err error)

ReconcileVolumeState handles the attaching and detaching of volume

func (*VolumeController) ResolveRefAndEnqueue

func (vc *VolumeController) ResolveRefAndEnqueue(namespace string, ref *metav1.OwnerReference)

func (*VolumeController) Run

func (vc *VolumeController) Run(workers int, stopCh <-chan struct{})

type Watcher

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

func (*Watcher) Close

func (w *Watcher) Close()

func (*Watcher) Events

func (w *Watcher) Events() <-chan struct{}

type WebsocketController

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

func NewWebsocketController

func NewWebsocketController(
	logger logrus.FieldLogger,
	ds *datastore.DataStore,
) *WebsocketController

func StartControllers

func StartControllers(logger logrus.FieldLogger, stopCh chan struct{}, controllerID, serviceAccount, managerImage, kubeconfigPath, version string, proxyConnCounter util.Counter) (*datastore.DataStore, *WebsocketController, error)

func (*WebsocketController) Close

func (wc *WebsocketController) Close()

func (*WebsocketController) NewWatcher

func (wc *WebsocketController) NewWatcher(resources ...string) *Watcher

func (*WebsocketController) Run

func (wc *WebsocketController) Run(stopCh <-chan struct{})

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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