Documentation
¶
Index ¶
- Variables
- func NewCmdVolSync(in io.Reader, out, errout io.Writer) *cobra.Command
- func NewCmdVolSyncContinueReplication(streams genericclioptions.IOStreams) *cobra.Command
- func NewCmdVolSyncRemoveReplication(streams genericclioptions.IOStreams) *cobra.Command
- func NewCmdVolSyncSetReplication(streams genericclioptions.IOStreams) *cobra.Command
- func NewCmdVolSyncStartReplication(streams genericclioptions.IOStreams) *cobra.Command
- type Config
- type DestinationOptions
- type FinalizeOptions
- type ReplicationOptions
- type SSHKeysSecretOptions
- type SetupReplicationOptions
- func (o *SetupReplicationOptions) Bind(cmd *cobra.Command, v *viper.Viper) error
- func (o *SetupReplicationOptions) Complete() error
- func (o *SetupReplicationOptions) CreateDestination(ctx context.Context) error
- func (o *SetupReplicationOptions) CreateDestinationPVCFromSource(ctx context.Context, latestImage *corev1.TypedLocalObjectReference) (string, error)
- func (o *SetupReplicationOptions) GetSourcePVC(ctx context.Context) (*corev1.PersistentVolumeClaim, error)
- func (o *SetupReplicationOptions) NameDestinationPVC(ctx context.Context) (string, error)
- func (o *SetupReplicationOptions) StartReplication() error
- func (o *SetupReplicationOptions) Validate() error
- type VolSyncDestinationOptions
- type VolSyncSourceOptions
Constants ¶
This section is empty.
Variables ¶
var (
VolSyncVersion = "0.0.0"
)
Functions ¶
func NewCmdVolSync ¶
NewCmdVolSync implements the volsync command
func NewCmdVolSyncContinueReplication ¶
func NewCmdVolSyncContinueReplication(streams genericclioptions.IOStreams) *cobra.Command
func NewCmdVolSyncRemoveReplication ¶
func NewCmdVolSyncRemoveReplication(streams genericclioptions.IOStreams) *cobra.Command
func NewCmdVolSyncSetReplication ¶
func NewCmdVolSyncSetReplication(streams genericclioptions.IOStreams) *cobra.Command
func NewCmdVolSyncStartReplication ¶
func NewCmdVolSyncStartReplication(streams genericclioptions.IOStreams) *cobra.Command
Types ¶
type DestinationOptions ¶
type DestinationOptions struct {
Name string
Config Config
RepOpts ReplicationOptions
SSHKeysSecretOptions SSHKeysSecretOptions
Schedule string
CopyMethod string
Capacity string
StorageClass string
AccessMode string
Address string
VolumeSnapshotClassName string
DestPVC string
SSHUser string
ServiceType string
Port int32
Path string
RcloneConfig string
Provider string
ProviderParameters string
}
type FinalizeOptions ¶
type FinalizeOptions struct {
Config Config
RepOpts ReplicationOptions
genericclioptions.IOStreams
// contains filtered or unexported fields
}
func NewFinalizeOptions ¶
func NewFinalizeOptions(streams genericclioptions.IOStreams) *FinalizeOptions
func (*FinalizeOptions) Complete ¶
func (o *FinalizeOptions) Complete() error
func (*FinalizeOptions) Continue ¶
func (o *FinalizeOptions) Continue() error
Continue updates ReplicationSource to remove a manual trigger the replications then proceed according to the replication source schedule.
func (*FinalizeOptions) RemoveReplication ¶
func (o *FinalizeOptions) RemoveReplication() error
RemoveReplication does the following: 0) Checks ReplicationSource,Destination are connected (same rsync address) 1) Removes ReplicationSource 2) Removes synced sshSecret from source namespace 3) Removed ReplicationDestination
func (*FinalizeOptions) SetReplication ¶
func (o *FinalizeOptions) SetReplication() error
SetReplication does the following: 1) Performs manually triggered sync as the last sync 2) Create DestinationPVC if CopyMethod=Snapshot With the manual trigger in place, no further replications will execute.
type ReplicationOptions ¶
type ReplicationOptions struct {
Source VolSyncSourceOptions
Dest VolSyncDestinationOptions
genericclioptions.IOStreams
}
func (*ReplicationOptions) Bind ¶
func (o *ReplicationOptions) Bind(cmd *cobra.Command, v *viper.Viper)
func (*ReplicationOptions) Complete ¶
func (o *ReplicationOptions) Complete() error
type SSHKeysSecretOptions ¶
type SSHKeysSecretOptions struct {
Config Config
RepOpts ReplicationOptions
SSHKeysSecret string
}
func (*SSHKeysSecretOptions) Bind ¶
func (o *SSHKeysSecretOptions) Bind(cmd *cobra.Command, v *viper.Viper)
func (*SSHKeysSecretOptions) SyncSSHSecret ¶
func (o *SSHKeysSecretOptions) SyncSSHSecret() error
type SetupReplicationOptions ¶
type SetupReplicationOptions struct {
Name string
Config Config
RepOpts ReplicationOptions
SSHKeysSecretOptions SSHKeysSecretOptions
DestOpts DestinationOptions
SourcePVC string
Schedule string
CopyMethod string
Capacity string
StorageClass string
AccessMode string
VolumeSnapshotClassName string
SSHUser string
ServiceType string
Port int32
RcloneConfig string
Provider string
ProviderParameters string
genericclioptions.IOStreams
}
func NewSetupReplicationOptions ¶
func NewSetupReplicationOptions(streams genericclioptions.IOStreams) *SetupReplicationOptions
func (*SetupReplicationOptions) Complete ¶
func (o *SetupReplicationOptions) Complete() error
func (*SetupReplicationOptions) CreateDestination ¶
func (o *SetupReplicationOptions) CreateDestination(ctx context.Context) error
CreateDestination creates a ReplicationDestination resource along with a destination PVC if copyMethod "None"
func (*SetupReplicationOptions) CreateDestinationPVCFromSource ¶
func (o *SetupReplicationOptions) CreateDestinationPVCFromSource( ctx context.Context, latestImage *corev1.TypedLocalObjectReference) (string, error)
CreateDestinationPVCFromSource creates PVC in destination namespace synced from source PVC
func (*SetupReplicationOptions) GetSourcePVC ¶
func (o *SetupReplicationOptions) GetSourcePVC(ctx context.Context) (*corev1.PersistentVolumeClaim, error)
func (*SetupReplicationOptions) NameDestinationPVC ¶
func (o *SetupReplicationOptions) NameDestinationPVC(ctx context.Context) (string, error)
NameDestinationPVC returns the name that will be given to the destination PVC
func (*SetupReplicationOptions) StartReplication ¶
func (o *SetupReplicationOptions) StartReplication() error
StartReplication does the following: 1) Create ReplicationDestination 2) Create DestinationPVC (if not provided) 3) Create ReplicationSource
func (*SetupReplicationOptions) Validate ¶
func (o *SetupReplicationOptions) Validate() error
type VolSyncDestinationOptions ¶
type VolSyncDestinationOptions struct {
Config Config
KubeContext string
KubeClusterName string
Namespace string
Client client.Client
CopyMethod volsyncv1alpha1.CopyMethodType
Capacity resource.Quantity
StorageClass *string
AccessModes []corev1.PersistentVolumeAccessMode
VolumeSnapClassName *string
SSHUser *string
ServiceType corev1.ServiceType
Port *int32
Provider string
Parameters map[string]string
}
func (*VolSyncDestinationOptions) Bind ¶
func (o *VolSyncDestinationOptions) Bind(cmd *cobra.Command, v *viper.Viper)
func (*VolSyncDestinationOptions) Complete ¶
func (o *VolSyncDestinationOptions) Complete() error
type VolSyncSourceOptions ¶
type VolSyncSourceOptions struct {
Config Config
KubeContext string
KubeClusterName string
Namespace string
Client client.Client
CopyMethod volsyncv1alpha1.CopyMethodType
Capacity resource.Quantity
StorageClass *string
AccessModes []corev1.PersistentVolumeAccessMode
VolumeSnapClassName *string
SSHUser *string
ServiceType corev1.ServiceType
Port *int32
Provider string
Parameters map[string]string
}
func (*VolSyncSourceOptions) Bind ¶
func (o *VolSyncSourceOptions) Bind(cmd *cobra.Command, v *viper.Viper)
func (*VolSyncSourceOptions) Complete ¶
func (o *VolSyncSourceOptions) Complete() error