Documentation
¶
Index ¶
- Variables
- func NewCmdScribe(in io.Reader, out, errout io.Writer) *cobra.Command
- func NewCmdScribeContinueReplication(streams genericclioptions.IOStreams) *cobra.Command
- func NewCmdScribeRemoveReplication(streams genericclioptions.IOStreams) *cobra.Command
- func NewCmdScribeSetReplication(streams genericclioptions.IOStreams) *cobra.Command
- func NewCmdScribeStartReplication(streams genericclioptions.IOStreams) *cobra.Command
- type Config
- type DestinationOptions
- type FinalizeOptions
- type ReplicationOptions
- type SSHKeysSecretOptions
- type ScribeDestinationOptions
- type ScribeSourceOptions
- 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
Constants ¶
This section is empty.
Variables ¶
var (
ScribeVersion = "0.0.0"
)
Functions ¶
func NewCmdScribe ¶
NewCmdScribe implements the scribe command
func NewCmdScribeContinueReplication ¶
func NewCmdScribeContinueReplication(streams genericclioptions.IOStreams) *cobra.Command
func NewCmdScribeRemoveReplication ¶
func NewCmdScribeRemoveReplication(streams genericclioptions.IOStreams) *cobra.Command
func NewCmdScribeSetReplication ¶
func NewCmdScribeSetReplication(streams genericclioptions.IOStreams) *cobra.Command
func NewCmdScribeStartReplication ¶
func NewCmdScribeStartReplication(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 ScribeSourceOptions
Dest ScribeDestinationOptions
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 ScribeDestinationOptions ¶
type ScribeDestinationOptions struct {
Config Config
KubeContext string
KubeClusterName string
Namespace string
Client client.Client
CopyMethod scribev1alpha1.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 (*ScribeDestinationOptions) Bind ¶
func (o *ScribeDestinationOptions) Bind(cmd *cobra.Command, v *viper.Viper)
func (*ScribeDestinationOptions) Complete ¶
func (o *ScribeDestinationOptions) Complete() error
type ScribeSourceOptions ¶
type ScribeSourceOptions struct {
Config Config
KubeContext string
KubeClusterName string
Namespace string
Client client.Client
CopyMethod scribev1alpha1.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 (*ScribeSourceOptions) Bind ¶
func (o *ScribeSourceOptions) Bind(cmd *cobra.Command, v *viper.Viper)
func (*ScribeSourceOptions) Complete ¶
func (o *ScribeSourceOptions) Complete() 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