Skip to content

Commit

Permalink
fix(container): fix cross check failed.
Browse files Browse the repository at this point in the history
Signed-off-by: Yuchao.Li <mimelyc@gmail.com>
  • Loading branch information
MimeLyc committed Jan 26, 2023
1 parent 20855d2 commit 17d8722
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/cmd/container/cp_linux.go → pkg/cmd/container/cp.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ import (
"github.com/sirupsen/logrus"
)

var errFileSpecDoesntMatchFormat = errors.New("filespec must match the canonical format: [container:]file/path")

// Copy files/folders between a running container and the local filesystem.
func Cp(ctx context.Context, args []string, options types.ContainerCpOptions) error {
srcSpec, err := parseCpFileSpec(args[0])
Expand Down Expand Up @@ -92,6 +90,8 @@ func Cp(ctx context.Context, args []string, options types.ContainerCpOptions) er
return kopy(ctx, container2host, proc.Pid, destSpec.Path, srcSpec.Path, options.FollowLink)
}

var errFileSpecDoesntMatchFormat = errors.New("filespec must match the canonical format: [container:]file/path")

func parseCpFileSpec(arg string) (*cpFileSpec, error) {
i := strings.Index(arg, ":")

Expand Down

0 comments on commit 17d8722

Please sign in to comment.