cmd

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2021 License: AGPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ScribeVersion = "0.0.0"
)

Functions

func NewCmdScribe

func NewCmdScribe(in io.Reader, out, errout io.Writer) *cobra.Command

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 Config

type Config struct {
	// contains filtered or unexported fields
}

func (*Config) Bind

func (o *Config) Bind(cmd *cobra.Command, v *viper.Viper) error

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
}

func (*DestinationOptions) Bind

func (o *DestinationOptions) Bind(cmd *cobra.Command, v *viper.Viper) error

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

func (o *FinalizeOptions) Bind(cmd *cobra.Command, v *viper.Viper) error

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

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 (*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

Jump to

Keyboard shortcuts

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