Skip to content

Commit

Permalink
fix: Fix container filepath to make it platform independent (#80)
Browse files Browse the repository at this point in the history
Issue #, if available:
N/A
*Description of changes:*
In the `container cp` command test, container path is evaluated using
`filepath.Join("/tmp", filename)`. On windows this evaluates to
`/tmp\<filename>` which is not a unix path for the container.

*Testing done:*
Yes


- [X] I've reviewed the guidance in CONTRIBUTING.md


#### License Acceptance

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.

Signed-off-by: Vishwas Siravara <[email protected]>
  • Loading branch information
vsiravar authored Sep 19, 2023
1 parent e1bacf3 commit 5496e94
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/cp.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
func Cp(o *option.Option) {
filename := "test-file"
content := "test-content"
containerFilepath := filepath.Join("/tmp", filename)
containerFilepath := filepath.ToSlash(filepath.Join("/tmp", filename))
containerResource := fmt.Sprintf("%s:%s", testContainerName, containerFilepath)

ginkgo.Describe("copy from container to host and vice versa", func() {
Expand Down

0 comments on commit 5496e94

Please sign in to comment.