Skip to content

Commit d068e01

Browse files
committed
chore: deprecate option
1 parent 0564645 commit d068e01

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

modules/dolt/dolt.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,14 @@ type DoltContainer struct {
2727
database string
2828
}
2929

30+
// Deprecated: this function will be removed in the next major release.
3031
func WithDefaultCredentials() testcontainers.CustomizeRequestOption {
32+
return withDefaultCredentials()
33+
}
34+
35+
// withDefaultCredentials is the function that applies the default credentials to the container request.
36+
// In case the provided username is the root user, the credentials will be removed.
37+
func withDefaultCredentials() testcontainers.CustomizeRequestOption {
3138
return func(req *testcontainers.GenericContainerRequest) error {
3239
username := req.Env["DOLT_USER"]
3340
if strings.EqualFold(rootUser, username) {
@@ -90,6 +97,7 @@ func Run(ctx context.Context, img string, opts ...testcontainers.ContainerCustom
9097

9198
createUser := true
9299
if !foundUser {
100+
// withCredentials found the root user
93101
dc.username = rootUser
94102
createUser = false
95103
}

0 commit comments

Comments
 (0)