mirror of https://github.com/k3s-io/k3s
fix 'kubectl cp' with no arguments causes a panic
parent
28b7809d2f
commit
254b02bcc6
|
@ -164,6 +164,9 @@ func (o *CopyOptions) Validate(cmd *cobra.Command, args []string) error {
|
|||
}
|
||||
|
||||
func (o *CopyOptions) Run(args []string) error {
|
||||
if len(args) < 2 {
|
||||
return fmt.Errorf("source and destination are required")
|
||||
}
|
||||
srcSpec, err := extractFileSpec(args[0])
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
Loading…
Reference in New Issue