Skip to content

Commit 14f2acc

Browse files
committed
fix(redpanda): UNIX path for target file when copying files into container with Redpanda (which is Linux based) to run correctly when host OS is Windows.
Signed-off-by: Marat Abrarov <abrarov@gmail.com>
1 parent 3ca7145 commit 14f2acc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

modules/redpanda/redpanda.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ func Run(ctx context.Context, img string, opts ...testcontainers.ContainerCustom
176176
},
177177
testcontainers.ContainerFile{
178178
Reader: bytes.NewReader(bootstrapConfig),
179-
ContainerFilePath: filepath.Join(redpandaDir, bootstrapConfigFile),
179+
ContainerFilePath: filepath.ToSlash(filepath.Join(redpandaDir, bootstrapConfigFile)),
180180
FileMode: 600,
181181
},
182182
)
@@ -186,12 +186,12 @@ func Run(ctx context.Context, img string, opts ...testcontainers.ContainerCustom
186186
req.Files = append(req.Files,
187187
testcontainers.ContainerFile{
188188
Reader: bytes.NewReader(settings.cert),
189-
ContainerFilePath: filepath.Join(redpandaDir, certFile),
189+
ContainerFilePath: filepath.ToSlash(filepath.Join(redpandaDir, certFile)),
190190
FileMode: 600,
191191
},
192192
testcontainers.ContainerFile{
193193
Reader: bytes.NewReader(settings.key),
194-
ContainerFilePath: filepath.Join(redpandaDir, keyFile),
194+
ContainerFilePath: filepath.ToSlash(filepath.Join(redpandaDir, keyFile)),
195195
FileMode: 600,
196196
},
197197
)
@@ -224,7 +224,7 @@ func Run(ctx context.Context, img string, opts ...testcontainers.ContainerCustom
224224
return c, err
225225
}
226226

227-
err = ctr.CopyToContainer(ctx, nodeConfig, filepath.Join(redpandaDir, "redpanda.yaml"), 0o600)
227+
err = ctr.CopyToContainer(ctx, nodeConfig, filepath.ToSlash(filepath.Join(redpandaDir, "redpanda.yaml")), 0o600)
228228
if err != nil {
229229
return c, fmt.Errorf("copy to container: %w", err)
230230
}

0 commit comments

Comments
 (0)