manager

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2019 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

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
)
View Source
const (
	BackupStatusQueryInterval = 2 * time.Second
)

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 GetBackupCredentialConfig(ds *datastore.DataStore) (map[string]string, error)

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 SyncVolumeLastBackupWithBackupVolume(volumeName string, backupVolume *engineapi.BackupVolume,
	getVolume func(name string) (*longhorn.Volume, error),
	updateVolume func(v *longhorn.Volume) (*longhorn.Volume, error)) (err error)

func SyncVolumesLastBackupWithBackupVolumes added in v0.5.0

func SyncVolumesLastBackupWithBackupVolumes(backupVolumes map[string]*engineapi.BackupVolume,
	listVolumes func() (map[string]*longhorn.Volume, error),
	getVolume func(name string) (*longhorn.Volume, error),
	updateVolume func(v *longhorn.Volume) (*longhorn.Volume, error))

func UpdateVolumeLastBackup added in v0.5.0

func UpdateVolumeLastBackup(volumeName string, backupTarget *engineapi.BackupTarget,
	getVolume func(name string) (*longhorn.Volume, error),
	updateVolume func(v *longhorn.Volume) (*longhorn.Volume, error)) (err error)

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 GetRuntimeObjectListFunc func() (runtime.Object, error)

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) Activate added in v0.5.0

func (m *VolumeManager) Activate(volumeName string, frontend string) (v *longhorn.Volume, err error)

func (*VolumeManager) Attach

func (m *VolumeManager) Attach(name, nodeID string, disableFrontend bool) (v *longhorn.Volume, err error)

func (*VolumeManager) BackupSnapshot

func (m *VolumeManager) BackupSnapshot(snapshotName string, labels map[string]string, volumeName string) error

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 (m *VolumeManager) CreateOrUpdateSetting(s *longhorn.Setting) (*longhorn.Setting, error)

func (*VolumeManager) CreateSnapshot

func (m *VolumeManager) CreateSnapshot(snapshotName string, labels map[string]string, volumeName string) (*engineapi.Snapshot, error)

func (*VolumeManager) Delete

func (m *VolumeManager) Delete(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) 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 (m *VolumeManager) DiskUpdate(name string, updateDisks []types.DiskSpec) (*longhorn.Node, error)

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) Get

func (m *VolumeManager) Get(vName string) (*longhorn.Volume, error)

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) 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) 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 (m *VolumeManager) GetEngines(vName string) (map[string]*longhorn.Engine, error)

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 (m *VolumeManager) GetReplicas(vName string) (map[string]*longhorn.Replica, error)

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) List

func (m *VolumeManager) List() (map[string]*longhorn.Volume, 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) 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) 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 (m *VolumeManager) ListSnapshots(volumeName string) (map[string]*engineapi.Snapshot, error)

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) Salvage

func (m *VolumeManager) Salvage(volumeName string, replicaNames []string) (v *longhorn.Volume, err error)

func (*VolumeManager) UpdateNode

func (m *VolumeManager) UpdateNode(n *longhorn.Node) (*longhorn.Node, error)

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 (m *VolumeManager) UpdateReplicaCount(name string, count int) (v *longhorn.Volume, err error)

func (*VolumeManager) WaitForEngineImage

func (m *VolumeManager) WaitForEngineImage(image string) error

Jump to

Keyboard shortcuts

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