Skip to content

Commit

Permalink
chore(docker_mounts): stop doing misleading logging
Browse files Browse the repository at this point in the history
As things are, the logger statement here always triggers for normal use cases.
For example, if I start a container with this mount:
testcontainers.VolumeMount("some-vol", "/some/dir")

then I get this weird message in my logs
Mount type %!s(testcontainers.MountType=1) is not supported by Testcontainers for Go

because a GenericVolumeMountSource doesn't have an implementation of
`GetVolumeOptions() *mount.VolumeOptions`

I suggest removing that logging, as in this PR, because it's going to be purely
confusing for 99% of users.
  • Loading branch information
srabraham committed Jan 31, 2024
1 parent 83ae8bf commit 80d422c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docker_mounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,10 @@ func mapToDockerMounts(containerMounts ContainerMounts) []mount.Mount {
containerMount.VolumeOptions = typedMounter.GetVolumeOptions()
case TmpfsMounter:
containerMount.TmpfsOptions = typedMounter.GetTmpfsOptions()
default:
case BindMounter:
Logger.Printf("Mount type %s is not supported by Testcontainers for Go", m.Source.Type())
default:
// The provided source type has no custom options
}

mounts = append(mounts, containerMount)
Expand Down

0 comments on commit 80d422c

Please sign in to comment.