Documentation ¶
Index ¶
- Constants
- Variables
- type BundleError
- type BundleMeta
- type BundleState
- type GetObjectMapFunc
- type GetRuntimeObjectListFunc
- type SupportBundle
- type VolumeManager
- func (m *VolumeManager) Activate(volumeName string, frontend string) (v *longhorn.Volume, err error)
- func (m *VolumeManager) Attach(name, nodeID string, disableFrontend bool, attachedBy string) (v *longhorn.Volume, err error)
- func (m *VolumeManager) BackupSnapshot(backupName, volumeName, snapshotName, backingImageName string, ...) error
- func (m *VolumeManager) CancelExpansion(volumeName string) (v *longhorn.Volume, err error)
- func (m *VolumeManager) CleanUpBackingImageDiskFiles(name string, diskFileList []string) (bi *longhorn.BackingImage, err error)
- func (m *VolumeManager) Create(name string, spec *types.VolumeSpec) (v *longhorn.Volume, err error)
- func (m *VolumeManager) CreateBackingImage(name, checksum, sourceType string, parameters map[string]string) (bi *longhorn.BackingImage, err error)
- func (m *VolumeManager) CreateEngineImage(image string) (*longhorn.EngineImage, error)
- func (m *VolumeManager) CreateOrUpdateSetting(s *longhorn.Setting) (*longhorn.Setting, error)
- func (m *VolumeManager) CreateSnapshot(snapshotName string, labels map[string]string, volumeName string) (*types.Snapshot, error)
- func (m *VolumeManager) Delete(name string) error
- func (m *VolumeManager) DeleteBackingImage(name string) error
- func (m *VolumeManager) DeleteBackup(backupName, volumeName string) error
- func (m *VolumeManager) DeleteBackupVolume(volumeName string) error
- func (m *VolumeManager) DeleteEngineImageByName(name string) error
- func (m *VolumeManager) DeleteNode(name string) error
- func (m *VolumeManager) DeleteReplica(volumeName, replicaName string) error
- func (m *VolumeManager) DeleteSnapshot(snapshotName, volumeName string) error
- func (m *VolumeManager) DeleteSupportBundle()
- func (m *VolumeManager) DeployEngineImage(image string) error
- func (m *VolumeManager) Detach(name, nodeID string) (v *longhorn.Volume, err error)
- func (m *VolumeManager) DiskUpdate(name string, updateDisks map[string]types.DiskSpec) (*longhorn.Node, error)
- func (m *VolumeManager) EngineUpgrade(volumeName, image string) (v *longhorn.Volume, err error)
- func (m *VolumeManager) Expand(volumeName string, size int64) (v *longhorn.Volume, err error)
- func (m *VolumeManager) GenerateSupportBundle(issueURL string, description string) (*SupportBundle, error)
- func (m *VolumeManager) Get(vName string) (*longhorn.Volume, error)
- func (m *VolumeManager) GetBackingImage(name string) (*longhorn.BackingImage, error)
- func (m *VolumeManager) GetBackingImageDataSource(name string) (*longhorn.BackingImageDataSource, error)
- func (m *VolumeManager) GetBackingImageDataSourcePod(name string) (*v1.Pod, error)
- func (m *VolumeManager) GetBackup(backupName, volumeName string) (*longhorn.Backup, error)
- func (m *VolumeManager) GetBackupVolume(volumeName string) (*longhorn.BackupVolume, error)
- func (m *VolumeManager) GetBundleFileHandler() (io.ReadCloser, error)
- func (m *VolumeManager) GetCurrentNodeID() string
- func (m *VolumeManager) GetDaemonSetRO(name string) (*appsv1.DaemonSet, error)
- func (m *VolumeManager) GetDiskTags() ([]string, error)
- func (m *VolumeManager) GetEngineClient(volumeName string) (client engineapi.EngineClient, err error)
- func (m *VolumeManager) GetEngineImageByImage(image string) (*longhorn.EngineImage, error)
- func (m *VolumeManager) GetEngineImageByName(name string) (*longhorn.EngineImage, error)
- func (m *VolumeManager) GetEngines(vName string) (map[string]*longhorn.Engine, error)
- func (m *VolumeManager) GetEnginesSorted(vName string) ([]*longhorn.Engine, error)
- func (m *VolumeManager) GetInstanceManager(name string) (*longhorn.InstanceManager, error)
- func (m *VolumeManager) GetLonghornEventList() (*v1.EventList, error)
- func (m *VolumeManager) GetManagerNodeIPMap() (map[string]string, error)
- func (m *VolumeManager) GetNode(name string) (*longhorn.Node, error)
- func (m *VolumeManager) GetNodeTags() ([]string, error)
- func (m *VolumeManager) GetReplicas(vName string) (map[string]*longhorn.Replica, error)
- func (m *VolumeManager) GetReplicasSorted(vName string) ([]*longhorn.Replica, error)
- func (m *VolumeManager) GetSetting(sName types.SettingName) (*longhorn.Setting, error)
- func (m *VolumeManager) GetSettingValueExisted(sName types.SettingName) (string, error)
- func (m *VolumeManager) GetSnapshot(snapshotName, volumeName string) (*types.Snapshot, error)
- func (m *VolumeManager) GetSupportBundle(name string) (*SupportBundle, error)
- func (m *VolumeManager) InitSupportBundle(issueURL string, description string) (*SupportBundle, error)
- func (m *VolumeManager) List() (map[string]*longhorn.Volume, error)
- func (m *VolumeManager) ListBackingImageDataSources() (map[string]*longhorn.BackingImageDataSource, error)
- func (m *VolumeManager) ListBackingImages() (map[string]*longhorn.BackingImage, error)
- func (m *VolumeManager) ListBackingImagesSorted() ([]*longhorn.BackingImage, error)
- func (m *VolumeManager) ListBackupVolumes() (map[string]*longhorn.BackupVolume, error)
- func (m *VolumeManager) ListBackupsForVolume(volumeName string) (map[string]*longhorn.Backup, error)
- func (m *VolumeManager) ListEngineImagesByName() (map[string]*longhorn.EngineImage, error)
- func (m *VolumeManager) ListEngineImagesSorted() ([]*longhorn.EngineImage, error)
- func (m *VolumeManager) ListInstanceManagers() (map[string]*longhorn.InstanceManager, error)
- func (m *VolumeManager) ListNodes() (map[string]*longhorn.Node, error)
- func (m *VolumeManager) ListNodesSorted() ([]*longhorn.Node, error)
- func (m *VolumeManager) ListReadyNodesWithEngineImage(image string) (map[string]*longhorn.Node, error)
- func (m *VolumeManager) ListSettings() (map[types.SettingName]*longhorn.Setting, error)
- func (m *VolumeManager) ListSettingsSorted() ([]*longhorn.Setting, error)
- func (m *VolumeManager) ListSnapshots(volumeName string) (map[string]*types.Snapshot, error)
- func (m *VolumeManager) ListSorted() ([]*longhorn.Volume, error)
- func (m *VolumeManager) Node2APIAddress(nodeID string) (string, error)
- func (m *VolumeManager) PVCCreate(name, namespace, pvcName string) (v *longhorn.Volume, err error)
- func (m *VolumeManager) PVCreate(name, pvName, fsType, secretNamespace, secretName string) (v *longhorn.Volume, err error)
- func (m *VolumeManager) PurgeSnapshot(volumeName string) error
- func (m *VolumeManager) RevertSnapshot(snapshotName, volumeName string) error
- func (m *VolumeManager) Salvage(volumeName string, replicaNames []string) (v *longhorn.Volume, err error)
- func (m *VolumeManager) UpdateAccessMode(name string, accessMode types.AccessMode) (v *longhorn.Volume, err error)
- func (m *VolumeManager) UpdateDataLocality(name string, dataLocality types.DataLocality) (v *longhorn.Volume, err error)
- func (m *VolumeManager) UpdateNode(n *longhorn.Node) (*longhorn.Node, error)
- func (m *VolumeManager) UpdateRecurringJobs(volumeName string, jobs []types.RecurringJob) (v *longhorn.Volume, err error)
- func (m *VolumeManager) UpdateReplicaAutoBalance(name string, inputSpec types.ReplicaAutoBalance) (v *longhorn.Volume, err error)
- func (m *VolumeManager) UpdateReplicaCount(name string, count int) (v *longhorn.Volume, err error)
Constants ¶
View Source
const ( BundleStateInProgress = BundleState("InProgress") BundleStateReadyForDownload = BundleState("ReadyForDownload") BundleStateError = BundleState("Error") )
View Source
const ( BundleErrorMkdirFailed = BundleError("Failed to create bundle file directory") BundleErrorZipFailed = BundleError("Failed to compress the support bundle files") BundleErrorOpenFailed = BundleError("Failed to open the compressed bundle file") BundleErrorStatFailed = BundleError("Failed to compute the size of the compressed bundle file") BundleProgressPercentageYaml = 20 BundleProgressPercentageLogs = 75 BundleProgressPercentageTotal = 100 )
View Source
const (
BackupStatusQueryInterval = 2 * time.Second
)
View Source
const (
MaxRecurringJobRetain = 50
)
Variables ¶
View Source
var ( WaitForEngineImageCount = 20 WaitForEngineImageInterval = 6 * time.Second )
View Source
var VERSION = "v0.3.0"
Functions ¶
This section is empty.
Types ¶
type BundleError ¶ added in v0.5.0
type BundleError string
type BundleMeta ¶ added in v0.4.0
type BundleMeta struct { LonghornVersion string `json:"longhornVersion"` KubernetesVersion string `json:"kubernetesVersion"` LonghornNamespaceUUID string `json:"longhornNamspaceUUID"` BundleCreatedAt string `json:"bundleCreatedAt"` IssueURL string `json:"issueURL"` IssueDescription string `json:"issueDescription"` }
type BundleState ¶ added in v0.5.0
type BundleState string
type GetObjectMapFunc ¶ added in v0.4.0
type GetObjectMapFunc func() (interface{}, error)
type GetRuntimeObjectListFunc ¶ added in v0.4.0
type SupportBundle ¶ added in v0.5.0
type SupportBundle struct { Name string State BundleState Size int64 Error BundleError Filename string ProgressPercentage int }
type VolumeManager ¶
type VolumeManager struct {
// contains filtered or unexported fields
}
func NewVolumeManager ¶
func NewVolumeManager(currentNodeID string, ds *datastore.DataStore) *VolumeManager
func (*VolumeManager) BackupSnapshot ¶
func (m *VolumeManager) BackupSnapshot(backupName, volumeName, snapshotName, backingImageName string, labels map[string]string) error
func (*VolumeManager) CancelExpansion ¶ added in v0.8.1
func (m *VolumeManager) CancelExpansion(volumeName string) (v *longhorn.Volume, err error)
func (*VolumeManager) CleanUpBackingImageDiskFiles ¶ added in v1.2.0
func (m *VolumeManager) CleanUpBackingImageDiskFiles(name string, diskFileList []string) (bi *longhorn.BackingImage, err error)
func (*VolumeManager) Create ¶
func (m *VolumeManager) Create(name string, spec *types.VolumeSpec) (v *longhorn.Volume, err error)
func (*VolumeManager) CreateBackingImage ¶ added in v1.1.1
func (m *VolumeManager) CreateBackingImage(name, checksum, sourceType string, parameters map[string]string) (bi *longhorn.BackingImage, err error)
func (*VolumeManager) CreateEngineImage ¶
func (m *VolumeManager) CreateEngineImage(image string) (*longhorn.EngineImage, error)
func (*VolumeManager) CreateOrUpdateSetting ¶
func (*VolumeManager) CreateSnapshot ¶
func (*VolumeManager) Delete ¶
func (m *VolumeManager) Delete(name string) error
func (*VolumeManager) DeleteBackingImage ¶ added in v1.1.1
func (m *VolumeManager) DeleteBackingImage(name string) error
func (*VolumeManager) DeleteBackup ¶
func (m *VolumeManager) DeleteBackup(backupName, volumeName string) error
func (*VolumeManager) DeleteBackupVolume ¶ added in v0.6.0
func (m *VolumeManager) DeleteBackupVolume(volumeName string) error
func (*VolumeManager) DeleteEngineImageByName ¶
func (m *VolumeManager) DeleteEngineImageByName(name string) error
func (*VolumeManager) DeleteNode ¶ added in v0.3.1
func (m *VolumeManager) DeleteNode(name string) error
func (*VolumeManager) DeleteReplica ¶
func (m *VolumeManager) DeleteReplica(volumeName, replicaName string) error
func (*VolumeManager) DeleteSnapshot ¶
func (m *VolumeManager) DeleteSnapshot(snapshotName, volumeName string) error
func (*VolumeManager) DeleteSupportBundle ¶ added in v0.5.0
func (m *VolumeManager) DeleteSupportBundle()
func (*VolumeManager) DeployEngineImage ¶ added in v1.1.1
func (m *VolumeManager) DeployEngineImage(image string) error
func (*VolumeManager) Detach ¶
func (m *VolumeManager) Detach(name, nodeID string) (v *longhorn.Volume, err error)
Detach will handle regular detachment as well as volume migration confirmation/rollback if nodeID is not specified, the volume will be detached from all nodes
func (*VolumeManager) DiskUpdate ¶
func (*VolumeManager) EngineUpgrade ¶
func (m *VolumeManager) EngineUpgrade(volumeName, image string) (v *longhorn.Volume, err error)
func (*VolumeManager) GenerateSupportBundle ¶ added in v0.4.0
func (m *VolumeManager) GenerateSupportBundle(issueURL string, description string) (*SupportBundle, error)
GenerateSupportBundle covers: 1. YAMLs of the Longhorn related CRDs 2. YAMLs of pods, services, daemonset, deployment in longhorn namespace 3. All the logs of pods in the longhorn namespace 4. Recent events happens in the longhorn namespace
Directories are organized like this: root |- yamls
|- events.yaml |- crds |- <list of top level CRD objects> |- <name of each crd>.yaml |- pods |- <name of each pod>.yaml |- <other workloads>...
|- logs
|- <name of each pod>.log |- <directory by the name of pod, if multiple containers exists> |- <container1>.log |- ...
The bundle would be compressed to a zip file for download.
func (*VolumeManager) GetBackingImage ¶ added in v1.1.1
func (m *VolumeManager) GetBackingImage(name string) (*longhorn.BackingImage, error)
func (*VolumeManager) GetBackingImageDataSource ¶ added in v1.2.0
func (m *VolumeManager) GetBackingImageDataSource(name string) (*longhorn.BackingImageDataSource, error)
func (*VolumeManager) GetBackingImageDataSourcePod ¶ added in v1.2.0
func (m *VolumeManager) GetBackingImageDataSourcePod(name string) (*v1.Pod, error)
func (*VolumeManager) GetBackup ¶
func (m *VolumeManager) GetBackup(backupName, volumeName string) (*longhorn.Backup, error)
func (*VolumeManager) GetBackupVolume ¶
func (m *VolumeManager) GetBackupVolume(volumeName string) (*longhorn.BackupVolume, error)
func (*VolumeManager) GetBundleFileHandler ¶ added in v0.5.0
func (m *VolumeManager) GetBundleFileHandler() (io.ReadCloser, error)
func (*VolumeManager) GetCurrentNodeID ¶
func (m *VolumeManager) GetCurrentNodeID() string
func (*VolumeManager) GetDaemonSetRO ¶ added in v1.1.0
func (m *VolumeManager) GetDaemonSetRO(name string) (*appsv1.DaemonSet, error)
func (*VolumeManager) GetDiskTags ¶ added in v0.6.0
func (m *VolumeManager) GetDiskTags() ([]string, error)
func (*VolumeManager) GetEngineClient ¶
func (m *VolumeManager) GetEngineClient(volumeName string) (client engineapi.EngineClient, err error)
func (*VolumeManager) GetEngineImageByImage ¶ added in v1.1.1
func (m *VolumeManager) GetEngineImageByImage(image string) (*longhorn.EngineImage, error)
func (*VolumeManager) GetEngineImageByName ¶
func (m *VolumeManager) GetEngineImageByName(name string) (*longhorn.EngineImage, error)
func (*VolumeManager) GetEngines ¶
func (*VolumeManager) GetEnginesSorted ¶
func (m *VolumeManager) GetEnginesSorted(vName string) ([]*longhorn.Engine, error)
func (*VolumeManager) GetInstanceManager ¶ added in v0.6.0
func (m *VolumeManager) GetInstanceManager(name string) (*longhorn.InstanceManager, error)
func (*VolumeManager) GetLonghornEventList ¶ added in v0.4.0
func (m *VolumeManager) GetLonghornEventList() (*v1.EventList, error)
func (*VolumeManager) GetManagerNodeIPMap ¶
func (m *VolumeManager) GetManagerNodeIPMap() (map[string]string, error)
func (*VolumeManager) GetNode ¶
func (m *VolumeManager) GetNode(name string) (*longhorn.Node, error)
func (*VolumeManager) GetNodeTags ¶ added in v0.6.0
func (m *VolumeManager) GetNodeTags() ([]string, error)
func (*VolumeManager) GetReplicas ¶
func (*VolumeManager) GetReplicasSorted ¶
func (m *VolumeManager) GetReplicasSorted(vName string) ([]*longhorn.Replica, error)
func (*VolumeManager) GetSetting ¶
func (m *VolumeManager) GetSetting(sName types.SettingName) (*longhorn.Setting, error)
func (*VolumeManager) GetSettingValueExisted ¶
func (m *VolumeManager) GetSettingValueExisted(sName types.SettingName) (string, error)
func (*VolumeManager) GetSnapshot ¶
func (m *VolumeManager) GetSnapshot(snapshotName, volumeName string) (*types.Snapshot, error)
func (*VolumeManager) GetSupportBundle ¶ added in v0.5.0
func (m *VolumeManager) GetSupportBundle(name string) (*SupportBundle, error)
func (*VolumeManager) InitSupportBundle ¶ added in v0.5.0
func (m *VolumeManager) InitSupportBundle(issueURL string, description string) (*SupportBundle, error)
func (*VolumeManager) ListBackingImageDataSources ¶ added in v1.2.0
func (m *VolumeManager) ListBackingImageDataSources() (map[string]*longhorn.BackingImageDataSource, error)
func (*VolumeManager) ListBackingImages ¶ added in v1.1.1
func (m *VolumeManager) ListBackingImages() (map[string]*longhorn.BackingImage, error)
func (*VolumeManager) ListBackingImagesSorted ¶ added in v1.1.2
func (m *VolumeManager) ListBackingImagesSorted() ([]*longhorn.BackingImage, error)
func (*VolumeManager) ListBackupVolumes ¶
func (m *VolumeManager) ListBackupVolumes() (map[string]*longhorn.BackupVolume, error)
func (*VolumeManager) ListBackupsForVolume ¶
func (*VolumeManager) ListEngineImagesByName ¶
func (m *VolumeManager) ListEngineImagesByName() (map[string]*longhorn.EngineImage, error)
func (*VolumeManager) ListEngineImagesSorted ¶
func (m *VolumeManager) ListEngineImagesSorted() ([]*longhorn.EngineImage, error)
func (*VolumeManager) ListInstanceManagers ¶ added in v0.6.0
func (m *VolumeManager) ListInstanceManagers() (map[string]*longhorn.InstanceManager, error)
func (*VolumeManager) ListNodes ¶
func (m *VolumeManager) ListNodes() (map[string]*longhorn.Node, error)
func (*VolumeManager) ListNodesSorted ¶
func (m *VolumeManager) ListNodesSorted() ([]*longhorn.Node, error)
func (*VolumeManager) ListReadyNodesWithEngineImage ¶ added in v1.1.1
func (*VolumeManager) ListSettings ¶
func (m *VolumeManager) ListSettings() (map[types.SettingName]*longhorn.Setting, error)
func (*VolumeManager) ListSettingsSorted ¶
func (m *VolumeManager) ListSettingsSorted() ([]*longhorn.Setting, error)
func (*VolumeManager) ListSnapshots ¶
func (*VolumeManager) ListSorted ¶
func (m *VolumeManager) ListSorted() ([]*longhorn.Volume, error)
func (*VolumeManager) Node2APIAddress ¶
func (m *VolumeManager) Node2APIAddress(nodeID string) (string, error)
func (*VolumeManager) PVCCreate ¶ added in v0.5.0
func (m *VolumeManager) PVCCreate(name, namespace, pvcName string) (v *longhorn.Volume, err error)
func (*VolumeManager) PVCreate ¶ added in v0.5.0
func (m *VolumeManager) PVCreate(name, pvName, fsType, secretNamespace, secretName string) (v *longhorn.Volume, err error)
func (*VolumeManager) PurgeSnapshot ¶
func (m *VolumeManager) PurgeSnapshot(volumeName string) error
func (*VolumeManager) RevertSnapshot ¶
func (m *VolumeManager) RevertSnapshot(snapshotName, volumeName string) error
func (*VolumeManager) UpdateAccessMode ¶ added in v1.1.0
func (m *VolumeManager) UpdateAccessMode(name string, accessMode types.AccessMode) (v *longhorn.Volume, err error)
func (*VolumeManager) UpdateDataLocality ¶ added in v1.1.0
func (m *VolumeManager) UpdateDataLocality(name string, dataLocality types.DataLocality) (v *longhorn.Volume, err error)
func (*VolumeManager) UpdateNode ¶
func (*VolumeManager) UpdateRecurringJobs ¶
func (m *VolumeManager) UpdateRecurringJobs(volumeName string, jobs []types.RecurringJob) (v *longhorn.Volume, err error)
func (*VolumeManager) UpdateReplicaAutoBalance ¶ added in v1.2.0
func (m *VolumeManager) UpdateReplicaAutoBalance(name string, inputSpec types.ReplicaAutoBalance) (v *longhorn.Volume, err error)
func (*VolumeManager) UpdateReplicaCount ¶ added in v0.3.3
Click to show internal directories.
Click to hide internal directories.