-
-
Notifications
You must be signed in to change notification settings - Fork 544
[Bug]: Permission denied reading redpanda.yaml stopping container from proper start #3157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The file in question is owned by ![]() Is it possible that the user is incorrectly set @mdelapenya ? ![]() |
In v0.36.0, the module already used Can you run your own code with the redpanda image that is used in the tests? I guess the "bug" could come from the |
I've run all the tests using |
@mdelapenya after some more digging I have some code that can reproduce (I tried with the same image in the tests but that's not the issue). The code to reproduce: package experiment
import (
"context"
"testing"
"github.com/docker/docker/api/types/container"
"github.com/stretchr/testify/require"
"github.com/testcontainers/testcontainers-go"
"github.com/testcontainers/testcontainers-go/modules/redpanda"
)
func TestRedpanda(t *testing.T) {
t.Parallel()
ctx := context.Background()
redpandaContainer, err := redpanda.Run(ctx,
"docker.redpanda.com/redpandadata/redpanda:latest",
testcontainers.WithConfigModifier(func(config *container.Config) {
// Setting this config modifier overrides the existing one which applies the user
// In my own code, I was just trying to add some labels here
}),
)
require.NoError(t, err)
defer func() {
require.NoError(t, testcontainers.TerminateContainer(redpandaContainer))
}()
} The cause seems to be that I was using Would you say this is expected behaviour? My intention wasn't to replace the entire config modifier originally, just add to it... |
Ok then, the config modifier option overrides the existing one, it's not appending. We have a similar discussion when adding In any case, you have now a I think we are victims here of the semantics in the names, as mentioned above: should the options override, or append/merge? It depends of the field that we are modifying. For CMD and ENTRYPOINT seemed easy to identify two different use cases. For maps and slices fields (Env, Labels, LifecycleHooks...) it seems easy to "append" values. For the rest, we can implicitly think that the user wanted to override. Probably a bug in the documentation, which is not explaining it correctly. cc/ @stevenh |
Oh at least for my use case I can definitely use the |
Yer I think we need to consider ensuring it's very obvious with naming. We have the same issue with |
So just for completeness I fixed my issue by just using the suggested |
Uh oh!
There was an error while loading. Please reload this page.
Testcontainers version
0.37.0
Using the latest Testcontainers version?
Yes
Host OS
Mac
Host arch
ARM
Go version
go1.24.2 darwin/arm64
Docker version
Client: Version: 28.0.1 API version: 1.48 Go version: go1.23.6 Git commit: 068a01e Built: Wed Feb 26 10:38:16 2025 OS/Arch: darwin/arm64 Context: desktop-linux Server: Docker Desktop 4.39.0 (184744) Engine: Version: 28.0.1 API version: 1.48 (minimum version 1.24) Go version: go1.23.6 Git commit: bbd0a17 Built: Wed Feb 26 10:40:57 2025 OS/Arch: linux/arm64 Experimental: false containerd: Version: 1.7.25 GitCommit: bcc810d6b9066471b0b6fa75f557a15a1cbf31bb runc: Version: 1.2.4 GitCommit: v1.2.4-0-g6c52b3f docker-init: Version: 0.19.0 GitCommit: de40ad0
Docker info
What happened?
When starting a redpanda container using
v0.37.0
it fails with/etc/redpanda/redpanda.yaml: Permission denied
.This works correctly up to
v0.36.0
.Relevant log output
`grep: /etc/redpanda/redpanda.yaml: Permission denied`
Additional information
Simple reproduction code:
The text was updated successfully, but these errors were encountered: