Documentation ¶
Index ¶
- Constants
- func DefaultRsyncRemoteShellToUse(cmd *cobra.Command) string
- func NewCmdRsync(name, parent string, f kcmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command
- type CopyStrategy
- type PathSpec
- type RsyncOptions
- func (o *RsyncOptions) Complete(f kcmdutil.Factory, cmd *cobra.Command, args []string) error
- func (o *RsyncOptions) GetCopyStrategy(name string) (CopyStrategy, error)
- func (o *RsyncOptions) PodName() string
- func (o *RsyncOptions) RunRsync() error
- func (o *RsyncOptions) Validate() error
- func (o *RsyncOptions) WatchAndSync() error
Constants ¶
const (
RsyncDaemonStartTimeOut = 10 * time.Second
)
const (
// RsyncRecommendedName is the recommended name for the rsync command
RsyncRecommendedName = "rsync"
)
Variables ¶
This section is empty.
Functions ¶
func NewCmdRsync ¶
func NewCmdRsync(name, parent string, f kcmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command
NewCmdRsync creates a new sync command
Types ¶
type CopyStrategy ¶
type CopyStrategy interface { Copy(source, destination *PathSpec, out, errOut io.Writer) error Validate() error String() string }
CopyStrategy implementations copy file to/from a pod.
func NewDefaultCopyStrategy ¶
func NewDefaultCopyStrategy(o *RsyncOptions) CopyStrategy
NewDefaultCopyStrategy returns a copy strategy that to uses rsync and falls back to tar if needed.
func NewRsyncDaemonStrategy ¶
func NewRsyncDaemonStrategy(o *RsyncOptions) CopyStrategy
NewRsyncDaemonStrategy returns a copy strategy that starts and uses an rsync daemon in the remote pod.
func NewRsyncStrategy ¶
func NewRsyncStrategy(o *RsyncOptions) CopyStrategy
NewRsyncStrategy returns a copy strategy that uses rsync.
func NewTarStrategy ¶
func NewTarStrategy(o *RsyncOptions) CopyStrategy
NewTarStrategy returns a copy strategy that uses tar.
type PathSpec ¶
PathSpec represents a path (remote or local) given as a source or destination argument to the rsync command
type RsyncOptions ¶
type RsyncOptions struct { Namespace string ContainerName string Source *PathSpec Destination *PathSpec Strategy CopyStrategy StrategyName string Quiet bool Delete bool Watch bool Compress bool SuggestedCmdUsage string RshCmd string RsyncInclude []string RsyncExclude []string RsyncProgress bool RsyncNoPerms bool Config *rest.Config Client kubernetes.Interface genericclioptions.IOStreams }
RsyncOptions holds the options to execute the sync command
func NewRsyncOptions ¶
func NewRsyncOptions(streams genericclioptions.IOStreams) *RsyncOptions
func (*RsyncOptions) Complete ¶
Complete verifies command line arguments and loads data from the command environment
func (*RsyncOptions) GetCopyStrategy ¶
func (o *RsyncOptions) GetCopyStrategy(name string) (CopyStrategy, error)
func (*RsyncOptions) PodName ¶
func (o *RsyncOptions) PodName() string
PodName returns the name of the pod as specified in either the the source or destination arguments
func (*RsyncOptions) RunRsync ¶
func (o *RsyncOptions) RunRsync() error
RunRsync copies files from source to destination
func (*RsyncOptions) Validate ¶
func (o *RsyncOptions) Validate() error
Validate checks that SyncOptions has all necessary fields
func (*RsyncOptions) WatchAndSync ¶
func (o *RsyncOptions) WatchAndSync() error
WatchAndSync sets up a recursive filesystem watch on the sync path and invokes rsync each time the path changes.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package fsnotification provides helper functions that wrap the fsnotify filesystem notification package.
|
Package fsnotification provides helper functions that wrap the fsnotify filesystem notification package. |