Documentation ¶
Index ¶
- Constants
- Variables
- func GenerateBackupTarget(ds *datastore.DataStore) (*engineapi.BackupTarget, error)
- func GetBackupCredentialConfig(ds *datastore.DataStore) (map[string]string, error)
- func NewPVCManifest(v *longhorn.Volume, pvName, ns, pvcName, storageClassName string) *apiv1.PersistentVolumeClaim
- func NewPVManifest(v *longhorn.Volume, pvName, storageClassName string) *apiv1.PersistentVolume
- func SyncVolumeLastBackupWithBackupVolume(volumeName string, backupVolume *engineapi.BackupVolume, ...) (err error)
- func SyncVolumesLastBackupWithBackupVolumes(backupVolumes map[string]*engineapi.BackupVolume, ...)
- func UpdateVolumeLastBackup(volumeName string, backupTarget *engineapi.BackupTarget, ...) (err error)
- 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) (v *longhorn.Volume, err error)
- func (m *VolumeManager) BackupSnapshot(snapshotName string, labels map[string]string, volumeName string) error
- func (m *VolumeManager) CheckEngineImageReadiness(image string) error
- func (m *VolumeManager) Create(name string, spec *types.VolumeSpec) (v *longhorn.Volume, 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) (*engineapi.Snapshot, error)
- func (m *VolumeManager) Delete(name string) error
- func (m *VolumeManager) DeleteBackup(backupName, 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) DeployAndWaitForEngineImage(image string) error
- func (m *VolumeManager) Detach(name string) (v *longhorn.Volume, err error)
- func (m *VolumeManager) DiskUpdate(name string, updateDisks []types.DiskSpec) (*longhorn.Node, error)
- func (m *VolumeManager) EngineUpgrade(volumeName, image string) (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) GetBackup(backupName, volumeName string) (*engineapi.Backup, error)
- func (m *VolumeManager) GetBackupVolume(volumeName string) (*engineapi.BackupVolume, error)
- func (m *VolumeManager) GetBundleFileHandler() (io.ReadCloser, error)
- func (m *VolumeManager) GetCurrentNodeID() string
- func (m *VolumeManager) GetEngineClient(volumeName string) (client engineapi.EngineClient, err error)
- func (m *VolumeManager) GetEngineImage(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) GetLonghornEventList() (*v1.EventList, error)
- func (m *VolumeManager) GetManagerNodeIPMap() (map[string]string, error)
- func (m *VolumeManager) GetNode(name string) (*longhorn.Node, 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) (*engineapi.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) ListBackupVolumes() (map[string]*engineapi.BackupVolume, error)
- func (m *VolumeManager) ListBackupsForVolume(volumeName string) ([]*engineapi.Backup, error)
- func (m *VolumeManager) ListEngineImagesByName() (map[string]*longhorn.EngineImage, error)
- func (m *VolumeManager) ListEngineImagesSorted() ([]*longhorn.EngineImage, error)
- func (m *VolumeManager) ListNodes() (map[string]*longhorn.Node, error)
- func (m *VolumeManager) ListNodesSorted() ([]*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]*engineapi.Snapshot, error)
- func (m *VolumeManager) ListSorted() ([]*longhorn.Volume, error)
- func (m *VolumeManager) MigrationConfirm(name string) (v *longhorn.Volume, err error)
- func (m *VolumeManager) MigrationRollback(name string) (v *longhorn.Volume, err error)
- func (m *VolumeManager) MigrationStart(name, nodeID string) (v *longhorn.Volume, err 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 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) SettingValidation(name, value string) (err error)
- func (m *VolumeManager) UpdateNode(name string, allowScheduling bool) (*longhorn.Node, error)
- func (m *VolumeManager) UpdateRecurringJobs(volumeName string, jobs []types.RecurringJob) (v *longhorn.Volume, err error)
- func (m *VolumeManager) UpdateReplicaCount(name string, count int) (v *longhorn.Volume, err error)
- func (m *VolumeManager) WaitForEngineImage(image string) error
Constants ¶
View Source
const ( KubeStatusPollConut = 5 KubeStatusPollInterval = 1 * time.Second )
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 )
Variables ¶
View Source
var ( WaitForEngineImageCount = 20 WaitForEngineImageInterval = 6 * time.Second )
View Source
var (
ConflictRetryCount = 5
)
View Source
var VERSION = "v0.3.0"
Functions ¶
func GenerateBackupTarget ¶ added in v0.5.0
func GenerateBackupTarget(ds *datastore.DataStore) (*engineapi.BackupTarget, error)
func GetBackupCredentialConfig ¶ added in v0.5.0
func NewPVCManifest ¶ added in v0.5.0
func NewPVCManifest(v *longhorn.Volume, pvName, ns, pvcName, storageClassName string) *apiv1.PersistentVolumeClaim
func NewPVManifest ¶ added in v0.5.0
func NewPVManifest(v *longhorn.Volume, pvName, storageClassName string) *apiv1.PersistentVolume
func SyncVolumeLastBackupWithBackupVolume ¶ added in v0.5.0
func SyncVolumesLastBackupWithBackupVolumes ¶ added in v0.5.0
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) Attach ¶
func (m *VolumeManager) Attach(name, nodeID string) (v *longhorn.Volume, err error)
func (*VolumeManager) BackupSnapshot ¶
func (*VolumeManager) CheckEngineImageReadiness ¶
func (m *VolumeManager) CheckEngineImageReadiness(image string) error
func (*VolumeManager) Create ¶
func (m *VolumeManager) Create(name string, spec *types.VolumeSpec) (v *longhorn.Volume, 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) DeleteBackup ¶
func (m *VolumeManager) DeleteBackup(backupName, 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) DeployAndWaitForEngineImage ¶
func (m *VolumeManager) DeployAndWaitForEngineImage(image string) error
func (*VolumeManager) Detach ¶
func (m *VolumeManager) Detach(name string) (v *longhorn.Volume, err error)
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) GetBackup ¶
func (m *VolumeManager) GetBackup(backupName, volumeName string) (*engineapi.Backup, error)
func (*VolumeManager) GetBackupVolume ¶
func (m *VolumeManager) GetBackupVolume(volumeName string) (*engineapi.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) GetEngineClient ¶
func (m *VolumeManager) GetEngineClient(volumeName string) (client engineapi.EngineClient, err error)
func (*VolumeManager) GetEngineImage ¶
func (m *VolumeManager) GetEngineImage(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) 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) 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) (*engineapi.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) ListBackupVolumes ¶
func (m *VolumeManager) ListBackupVolumes() (map[string]*engineapi.BackupVolume, error)
func (*VolumeManager) ListBackupsForVolume ¶
func (m *VolumeManager) ListBackupsForVolume(volumeName string) ([]*engineapi.Backup, error)
func (*VolumeManager) ListEngineImagesByName ¶
func (m *VolumeManager) ListEngineImagesByName() (map[string]*longhorn.EngineImage, error)
func (*VolumeManager) ListEngineImagesSorted ¶
func (m *VolumeManager) ListEngineImagesSorted() ([]*longhorn.EngineImage, 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) 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) MigrationConfirm ¶
func (m *VolumeManager) MigrationConfirm(name string) (v *longhorn.Volume, err error)
func (*VolumeManager) MigrationRollback ¶
func (m *VolumeManager) MigrationRollback(name string) (v *longhorn.Volume, err error)
func (*VolumeManager) MigrationStart ¶
func (m *VolumeManager) MigrationStart(name, nodeID string) (v *longhorn.Volume, err 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 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) SettingValidation ¶
func (m *VolumeManager) SettingValidation(name, value string) (err error)
func (*VolumeManager) UpdateNode ¶
func (*VolumeManager) UpdateRecurringJobs ¶
func (m *VolumeManager) UpdateRecurringJobs(volumeName string, jobs []types.RecurringJob) (v *longhorn.Volume, err error)
func (*VolumeManager) UpdateReplicaCount ¶ added in v0.3.3
func (*VolumeManager) WaitForEngineImage ¶
func (m *VolumeManager) WaitForEngineImage(image string) error
Click to show internal directories.
Click to hide internal directories.