util

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// LonghornV1ToV2MinorVersionNum v1 minimal minor version when the upgrade path is from v1.x to v2.0
	// TODO: decide the v1 minimum version that could be upgraded to v2.0
	LonghornV1ToV2MinorVersionNum = 30
)

Variables

This section is empty.

Functions

func CheckUpgradePath added in v1.6.0

func CheckUpgradePath(namespace string, lhClient lhclientset.Interface, eventRecorder record.EventRecorder, enableUpgradeVersionCheck bool) error

func CreateAndUpdateBackingImageInProvidedCache added in v1.5.0

func CreateAndUpdateBackingImageInProvidedCache(namespace string, lhClient *lhclientset.Clientset, resourceMaps map[string]interface{}, bid *longhorn.BackingImageDataSource) (*longhorn.BackingImageDataSource, error)

CreateAndUpdateBackingImageInProvidedCache creates a backingImage and saves it into the provided cached `resourceMap`. This method is not thread-safe.

func CreateAndUpdateRecurringJobInProvidedCache added in v1.5.0

func CreateAndUpdateRecurringJobInProvidedCache(namespace string, lhClient *lhclientset.Clientset, resourceMaps map[string]interface{}, job *longhorn.RecurringJob) (*longhorn.RecurringJob, error)

CreateAndUpdateRecurringJobInProvidedCache creates a recurringJob and saves it into the provided cached `resourceMap`. This method is not thread-safe.

func CreateOrUpdateLonghornVersionSetting added in v1.2.4

func CreateOrUpdateLonghornVersionSetting(namespace string, lhClient *lhclientset.Clientset) error

func DeleteRemovedSettings added in v1.5.0

func DeleteRemovedSettings(namespace string, lhClient *lhclientset.Clientset) error

func GetCurrentLonghornVersion added in v1.2.4

func GetCurrentLonghornVersion(namespace string, lhClient lhclientset.Interface) (string, error)

func GetCurrentReferredLonghornEngineImageVersions added in v1.6.0

func GetCurrentReferredLonghornEngineImageVersions(namespace string, lhClient lhclientset.Interface) (map[string]emeta.VersionOutput, error)

func ListAndUpdateBackingImageDataSourcesInProvidedCache added in v1.5.0

func ListAndUpdateBackingImageDataSourcesInProvidedCache(namespace string, lhClient *lhclientset.Clientset, resourceMaps map[string]interface{}) (map[string]*longhorn.BackingImageDataSource, error)

ListAndUpdateBackingImageDataSourcesInProvidedCache list all backingImageDataSources and save them into the provided cached `resourceMap`. This method is not thread-safe.

func ListAndUpdateBackingImagesInProvidedCache added in v1.5.0

func ListAndUpdateBackingImagesInProvidedCache(namespace string, lhClient *lhclientset.Clientset, resourceMaps map[string]interface{}) (map[string]*longhorn.BackingImage, error)

ListAndUpdateBackingImagesInProvidedCache list all backingImages and save them into the provided cached `resourceMap`. This method is not thread-safe.

func ListAndUpdateBackupsInProvidedCache added in v1.5.0

func ListAndUpdateBackupsInProvidedCache(namespace string, lhClient *lhclientset.Clientset, resourceMaps map[string]interface{}) (map[string]*longhorn.Backup, error)

ListAndUpdateBackupsInProvidedCache list all backups and save them into the provided cached `resourceMap`. This method is not thread-safe.

func ListAndUpdateEngineImagesInProvidedCache added in v1.5.0

func ListAndUpdateEngineImagesInProvidedCache(namespace string, lhClient *lhclientset.Clientset, resourceMaps map[string]interface{}) (map[string]*longhorn.EngineImage, error)

ListAndUpdateEngineImagesInProvidedCache list all engineImages and save them into the provided cached `resourceMap`. This method is not thread-safe.

func ListAndUpdateEnginesInProvidedCache added in v1.5.0

func ListAndUpdateEnginesInProvidedCache(namespace string, lhClient *lhclientset.Clientset, resourceMaps map[string]interface{}) (map[string]*longhorn.Engine, error)

ListAndUpdateEnginesInProvidedCache list all engines and save them into the provided cached `resourceMap`. This method is not thread-safe.

func ListAndUpdateInstanceManagersInProvidedCache added in v1.5.0

func ListAndUpdateInstanceManagersInProvidedCache(namespace string, lhClient *lhclientset.Clientset, resourceMaps map[string]interface{}) (map[string]*longhorn.InstanceManager, error)

ListAndUpdateInstanceManagersInProvidedCache list all instanceManagers and save them into the provided cached `resourceMap`. This method is not thread-safe.

func ListAndUpdateNodesInProvidedCache added in v1.5.0

func ListAndUpdateNodesInProvidedCache(namespace string, lhClient *lhclientset.Clientset, resourceMaps map[string]interface{}) (map[string]*longhorn.Node, error)

ListAndUpdateNodesInProvidedCache list all nodes and save them into the provided cached `resourceMap`. This method is not thread-safe.

func ListAndUpdateOrphansInProvidedCache added in v1.5.0

func ListAndUpdateOrphansInProvidedCache(namespace string, lhClient *lhclientset.Clientset, resourceMaps map[string]interface{}) (map[string]*longhorn.Orphan, error)

ListAndUpdateOrphansInProvidedCache list all orphans and save them into the provided cached `resourceMap`. This method is not thread-safe.

func ListAndUpdateRecurringJobsInProvidedCache added in v1.5.0

func ListAndUpdateRecurringJobsInProvidedCache(namespace string, lhClient *lhclientset.Clientset, resourceMaps map[string]interface{}) (map[string]*longhorn.RecurringJob, error)

ListAndUpdateRecurringJobsInProvidedCache list all recurringJobs and save them into the provided cached `resourceMap`. This method is not thread-safe.

func ListAndUpdateReplicasInProvidedCache added in v1.5.0

func ListAndUpdateReplicasInProvidedCache(namespace string, lhClient *lhclientset.Clientset, resourceMaps map[string]interface{}) (map[string]*longhorn.Replica, error)

ListAndUpdateReplicasInProvidedCache list all replicas and save them into the provided cached `resourceMap`. This method is not thread-safe.

func ListAndUpdateSettingsInProvidedCache added in v1.5.0

func ListAndUpdateSettingsInProvidedCache(namespace string, lhClient *lhclientset.Clientset, resourceMaps map[string]interface{}) (map[string]*longhorn.Setting, error)

ListAndUpdateSettingsInProvidedCache list all settings and save them into the provided cached `resourceMap`. This method is not thread-safe.

func ListAndUpdateShareManagersInProvidedCache added in v1.5.0

func ListAndUpdateShareManagersInProvidedCache(namespace string, lhClient *lhclientset.Clientset, resourceMaps map[string]interface{}) (map[string]*longhorn.ShareManager, error)

ListAndUpdateShareManagersInProvidedCache list all shareManagers and save them into the provided cached `resourceMap`. This method is not thread-safe.

func ListAndUpdateSnapshotsInProvidedCache added in v1.5.0

func ListAndUpdateSnapshotsInProvidedCache(namespace string, lhClient *lhclientset.Clientset, resourceMaps map[string]interface{}) (map[string]*longhorn.Snapshot, error)

ListAndUpdateSnapshotsInProvidedCache list all snapshots and save them into the provided cached `resourceMap`. This method is not thread-safe.

func ListAndUpdateVolumeAttachmentsInProvidedCache added in v1.5.2

func ListAndUpdateVolumeAttachmentsInProvidedCache(namespace string, lhClient *lhclientset.Clientset, resourceMaps map[string]interface{}) (map[string]*longhorn.VolumeAttachment, error)

ListAndUpdateVolumeAttachmentsInProvidedCache list all volumeAttachments and save them into the provided cached `resourceMap`. This method is not thread-safe.

func ListAndUpdateVolumesInProvidedCache added in v1.5.0

func ListAndUpdateVolumesInProvidedCache(namespace string, lhClient *lhclientset.Clientset, resourceMaps map[string]interface{}) (map[string]*longhorn.Volume, error)

ListAndUpdateVolumesInProvidedCache list all volumes and save them into the provided cached `resourceMap`. This method is not thread-safe.

func ListIMPods

func ListIMPods(namespace string, kubeClient *clientset.Clientset) ([]corev1.Pod, error)

func ListManagerPods added in v1.4.4

func ListManagerPods(namespace string, kubeClient *clientset.Clientset) ([]corev1.Pod, error)

func ListShareManagerPods

func ListShareManagerPods(namespace string, kubeClient *clientset.Clientset) ([]corev1.Pod, error)

func MergeStringMaps

func MergeStringMaps(baseMap, overwriteMap map[string]string) map[string]string

func UpdateResources added in v1.5.0

func UpdateResources(namespace string, lhClient *lhclientset.Clientset, resourceMaps map[string]interface{}) error

UpdateResources persists all the resources' spec changes in provided cached `resourceMap`. This method is not thread-safe.

func UpdateResourcesStatus added in v1.5.0

func UpdateResourcesStatus(namespace string, lhClient *lhclientset.Clientset, resourceMaps map[string]interface{}) error

UpdateResourcesStatus persists all the resources' status changes in provided cached `resourceMap`. This method is not thread-safe.

Types

type ProgressMonitor added in v1.2.5

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

func NewProgressMonitor added in v1.2.5

func NewProgressMonitor(description string, currentValue, targetValue int) *ProgressMonitor

func (*ProgressMonitor) GetCurrentProgress added in v1.2.5

func (pm *ProgressMonitor) GetCurrentProgress() (int, int, float64)

func (*ProgressMonitor) Inc added in v1.2.5

func (pm *ProgressMonitor) Inc() int

func (*ProgressMonitor) SetCurrentValue added in v1.2.5

func (pm *ProgressMonitor) SetCurrentValue(newValue int)

Jump to

Keyboard shortcuts

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