Skip to content
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

fix!: typos #2940

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci-test-go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ jobs:
- name: go test
# only run tests on linux, there are a number of things that won't allow the tests to run on anything else
# many (maybe, all?) images used can only be build on Linux, they don't have Windows in their manifest, and
# we can't put Windows Server in "Linux Mode" in Github actions
# we can't put Windows Server in "Linux Mode" in GitHub actions
# another, host mode is only available on Linux, and we have tests around that, do we skip them?
if: ${{ inputs.run-tests }}
working-directory: ./${{ inputs.project-directory }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/conventions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
with:
# We may not need a scope on every commit (i.e. repo-level change).
#
# feat!: read config consistenly
# feat!: read config consistently
# feat(redis): support for clustering
# chore(redis): update tests
# fix(redis): trim connection string
Expand Down
2 changes: 1 addition & 1 deletion cleanup.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func TerminateContainer(container Container, options ...TerminateOption) error {
return nil
}

// isNil returns true if val is nil or an nil instance false otherwise.
// isNil returns true if val is nil or a nil instance false otherwise.
func isNil(val any) bool {
if val == nil {
return true
Expand Down
78 changes: 39 additions & 39 deletions container.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ type ImageBuildInfo interface {
GetTag() string // get tag label for image
BuildLogWriter() io.Writer // for output of build log, use io.Discard to disable the output
ShouldBuildImage() bool // return true if the image needs to be built
GetBuildArgs() map[string]*string // return the environment args used to build the from Dockerfile
GetBuildArgs() map[string]*string // return the environment args used to build the Dockerfile
GetAuthConfigs() map[string]registry.AuthConfig // Deprecated. Testcontainers will detect registry credentials automatically. Return the auth configs to be able to pull from an authenticated docker registry
}

Expand Down Expand Up @@ -128,44 +128,44 @@ func (c *ContainerFile) validate() error {
// ContainerRequest represents the parameters used to get a running container
type ContainerRequest struct {
FromDockerfile
HostAccessPorts []int
Image string
ImageSubstitutors []ImageSubstitutor
Entrypoint []string
Env map[string]string
ExposedPorts []string // allow specifying protocol info
Cmd []string
Labels map[string]string
Mounts ContainerMounts
Tmpfs map[string]string
RegistryCred string // Deprecated: Testcontainers will detect registry credentials automatically
WaitingFor wait.Strategy
Name string // for specifying container name
Hostname string
WorkingDir string // specify the working directory of the container
ExtraHosts []string // Deprecated: Use HostConfigModifier instead
Privileged bool // For starting privileged container
Networks []string // for specifying network names
NetworkAliases map[string][]string // for specifying network aliases
NetworkMode container.NetworkMode // Deprecated: Use HostConfigModifier instead
Resources container.Resources // Deprecated: Use HostConfigModifier instead
Files []ContainerFile // files which will be copied when container starts
User string // for specifying uid:gid
SkipReaper bool // Deprecated: The reaper is globally controlled by the .testcontainers.properties file or the TESTCONTAINERS_RYUK_DISABLED environment variable
ReaperImage string // Deprecated: use WithImageName ContainerOption instead. Alternative reaper image
ReaperOptions []ContainerOption // Deprecated: the reaper is configured at the properties level, for an entire test session
AutoRemove bool // Deprecated: Use HostConfigModifier instead. If set to true, the container will be removed from the host when stopped
AlwaysPullImage bool // Always pull image
ImagePlatform string // ImagePlatform describes the platform which the image runs on.
Binds []string // Deprecated: Use HostConfigModifier instead
ShmSize int64 // Amount of memory shared with the host (in bytes)
CapAdd []string // Deprecated: Use HostConfigModifier instead. Add Linux capabilities
CapDrop []string // Deprecated: Use HostConfigModifier instead. Drop Linux capabilities
ConfigModifier func(*container.Config) // Modifier for the config before container creation
HostConfigModifier func(*container.HostConfig) // Modifier for the host config before container creation
EnpointSettingsModifier func(map[string]*network.EndpointSettings) // Modifier for the network settings before container creation
LifecycleHooks []ContainerLifecycleHooks // define hooks to be executed during container lifecycle
LogConsumerCfg *LogConsumerConfig // define the configuration for the log producer and its log consumers to follow the logs
HostAccessPorts []int
Image string
ImageSubstitutors []ImageSubstitutor
Entrypoint []string
Env map[string]string
ExposedPorts []string // allow specifying protocol info
Cmd []string
Labels map[string]string
Mounts ContainerMounts
Tmpfs map[string]string
RegistryCred string // Deprecated: Testcontainers will detect registry credentials automatically
WaitingFor wait.Strategy
Name string // for specifying container name
Hostname string
WorkingDir string // specify the working directory of the container
ExtraHosts []string // Deprecated: Use HostConfigModifier instead
Privileged bool // For starting privileged container
Networks []string // for specifying network names
NetworkAliases map[string][]string // for specifying network aliases
NetworkMode container.NetworkMode // Deprecated: Use HostConfigModifier instead
Resources container.Resources // Deprecated: Use HostConfigModifier instead
Files []ContainerFile // files which will be copied when container starts
User string // for specifying uid:gid
SkipReaper bool // Deprecated: The reaper is globally controlled by the .testcontainers.properties file or the TESTCONTAINERS_RYUK_DISABLED environment variable
ReaperImage string // Deprecated: use WithImageName ContainerOption instead. Alternative reaper image
ReaperOptions []ContainerOption // Deprecated: the reaper is configured at the properties level, for an entire test session
AutoRemove bool // Deprecated: Use HostConfigModifier instead. If set to true, the container will be removed from the host when stopped
AlwaysPullImage bool // Always pull image
ImagePlatform string // ImagePlatform describes the platform which the image runs on.
Binds []string // Deprecated: Use HostConfigModifier instead
ShmSize int64 // Amount of memory shared with the host (in bytes)
CapAdd []string // Deprecated: Use HostConfigModifier instead. Add Linux capabilities
CapDrop []string // Deprecated: Use HostConfigModifier instead. Drop Linux capabilities
ConfigModifier func(*container.Config) // Modifier for the config before container creation
HostConfigModifier func(*container.HostConfig) // Modifier for the host config before container creation
EndpointSettingsModifier func(map[string]*network.EndpointSettings) // Modifier for the network settings before container creation
LifecycleHooks []ContainerLifecycleHooks // define hooks to be executed during container lifecycle
LogConsumerCfg *LogConsumerConfig // define the configuration for the log producer and its log consumers to follow the logs
}

// sessionID returns the session ID for the container request.
Expand Down
2 changes: 1 addition & 1 deletion docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ func (c *DockerContainer) CopyDirToContainer(ctx context.Context, hostDirPath st
}

if !dir {
// it's not a dir: let the consumer to handle an error
// it's not a dir: let the consumer handle the error
return fmt.Errorf("path %s is not a directory", hostDirPath)
}

Expand Down
2 changes: 1 addition & 1 deletion docker_auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ func requireValidAuthConfig(t *testing.T) {
require.NoError(t, err)

// We can only check the keys as the values are not deterministic as they depend
// on users environment.
// on user's environment.
expected := map[string]registry.AuthConfig{
core.IndexDockerIO: {},
exampleRegistry: {},
Expand Down
4 changes: 2 additions & 2 deletions docker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1391,7 +1391,7 @@ func TestDockerContainerCopyDirToContainer(t *testing.T) {
CleanupContainer(t, nginxC)
require.NoError(t, err)

p := filepath.Join(".", "testdata", "Dokerfile")
p := filepath.Join(".", "testdata", "Dockerfile")
err = nginxC.CopyDirToContainer(ctx, p, "/tmp/testdata/Dockerfile", 700)
require.Error(t, err) // copying a file using the directory method will raise an error

Expand Down Expand Up @@ -1870,7 +1870,7 @@ func assertExtractedFiles(t *testing.T, ctx context.Context, container Container
}

fp := filepath.Join(containerFilePath, srcFile.Name())
// copy file by file, as there is a limitation in the Docker client to copy an entiry directory from the container
// copy file by file, as there is a limitation in the Docker client to copy an entire directory from the container
// paths for the container files are using Linux path separators
fd, err := container.CopyFileFromContainer(ctx, fp)
require.NoError(t, err, "Path not found in container: %s", fp)
Expand Down
6 changes: 3 additions & 3 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

There are many ways to contribute, from writing tutorials or blog posts, improving the documentation, submitting bug reports and feature requests, or writing code for the core library or for a technology module.

In any case, if you like the project, please star the project on [Github](https://github.com/testcontainers/testcontainers-go/stargazers) and help spread the word :)
In any case, if you like the project, please star the project on [GitHub](https://github.com/testcontainers/testcontainers-go/stargazers) and help spread the word :)
Also join our [Slack workspace](http://slack.testcontainers.org) to get help, share your ideas, and chat with the community.

## Questions
Expand Down Expand Up @@ -49,7 +49,7 @@ Please just be sure to:
* For linting just the modulegen: `make -C modulegen lint`
* verify all tests are passing. Build and test the project with `make test-all` to do this.
* For a given module or example, go to the module or example directory and run `make test`.
* If you find an `ld warning` message on MacOS, you can ignore it. It is a indeed a warning: https://github.com/golang/go/issues/61229
* If you find an `ld warning` message on MacOS, you can ignore it. It is indeed a warning: https://github.com/golang/go/issues/61229
> === Errors
> ld: warning: '/private/var/folders/3y/8hbf585d4yl6f8j5yzqx6wz80000gn/T/go-link-2319589277/000018.o' has malformed LC_DYSYMTAB, expected 98 undefined symbols to start at index 1626, found 95 undefined symbols starting at index 1626

Expand Down Expand Up @@ -102,4 +102,4 @@ make clean-docs
Note that documentation for pull requests will automatically be published by Netlify as 'deploy previews'.
These deployment previews can be accessed via the `deploy/netlify` check that appears for each pull request.

Please check the Github comment Netlify posts on the PR for the URL to the deployment preview.
Please check the GitHub comment Netlify posts on the PR for the URL to the deployment preview.
2 changes: 1 addition & 1 deletion docs/features/common_functional_options.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ In more locked down / secured environments, it can be problematic to pull images

An image name substitutor converts a Docker image name, as may be specified in code, to an alternative name. This is intended to provide a way to override image names, for example to enforce pulling of images from a private registry.

_Testcontainers for Go_ exposes an interface to perform this operations: `ImageSubstitutor`, and a No-operation implementation to be used as reference for custom implementations:
_Testcontainers for Go_ exposes an interface to perform this operation: `ImageSubstitutor`, and a No-operation implementation to be used as reference for custom implementations:

<!--codeinclude-->
[Image Substitutor Interface](../../options.go) inside_block:imageSubstitutor
Expand Down
4 changes: 2 additions & 2 deletions docs/features/creating_container.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ In the following example, we are going to create a container using all the lifec
_Testcontainers for Go_ comes with a default logging hook that will print a log message for each container lifecycle event, using the default logger. You can add your own logger by passing the `testcontainers.DefaultLoggingHook` option to the `ContainerRequest`, passing a reference to your preferred logger:

<!--codeinclude-->
[Use a custom logger for container hooks](../../lifecycle_test.go) inside_block:reqWithDefaultLogginHook
[Use a custom logger for container hooks](../../lifecycle_test.go) inside_block:reqWithDefaultLoggingHook
[Custom Logger implementation](../../lifecycle_test.go) inside_block:customLoggerImplementation
<!--/codeinclude-->

Expand All @@ -156,7 +156,7 @@ The aforementioned `GenericContainer` function and the `ContainerRequest` struct
<!--/codeinclude-->

!!!warning
The only special case where the modifiers are not applied last, is when there are no exposed ports in the container request and the container does not use a network mode from a container (e.g. `req.NetworkMode = container.NetworkMode("container:$CONTAINER_ID")`). In that case, _Testcontainers for Go_ will extract the ports from the underliying Docker image and export them.
The only special case where the modifiers are not applied last, is when there are no exposed ports in the container request and the container does not use a network mode from a container (e.g. `req.NetworkMode = container.NetworkMode("container:$CONTAINER_ID")`). In that case, _Testcontainers for Go_ will extract the ports from the underlying Docker image and export them.

## Reusable container

Expand Down
2 changes: 1 addition & 1 deletion docs/features/docker_compose.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ To interact with service containers after a stack was started it is possible to
The function takes a **service name** (and a `context.Context`) and returns either a `*tc.DockerContainer` or an `error`.
This is different to the previous `LocalDockerCompose` API where service containers were accessed via their **container name** e.g. `mysql_1` or `mysql-1` (depending on the version of `docker compose`).

Furthermore, there's the convenience function `Serices()` to get a list of all services **defined** by the current project.
Furthermore, there's the convenience function `Services()` to get a list of all services **defined** by the current project.
Note that not all of them need necessarily be correctly started as the information is based on the given compose files.

### Wait strategies
Expand Down
4 changes: 2 additions & 2 deletions docs/features/follow_logs.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ This will represent the current way for associating `LogConsumer`s. You simply d
[Passing LogConsumers](../../logconsumer_test.go) inside_block:logConsumersAtRequest
<!--/codeinclude-->

Please check that it's possible to configure the log production with an slice of functional options. These options must be of the `LogProductionOption` type:
Please check that it's possible to configure the log production with a slice of functional options. These options must be of the `LogProductionOption` type:

```go
type LogProductionOption func(*DockerContainer)
```

At the moment, _Testcontainers for Go_ exposes an option to set log production timeout, using the `WithLogProductionTimeout` function.

_Testcontainers for Go_ will read this log producer/consumer configuration to automatically start producing logs if an only if the consumers slice contains at least one valid `LogConsumer`.
_Testcontainers for Go_ will read this log producer/consumer configuration to automatically start producing logs if and only if the consumers slice contains at least one valid `LogConsumer`.

## Manually using the FollowOutput function

Expand Down
6 changes: 3 additions & 3 deletions docs/features/networking.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ It is normally advisable to use `Host` and `MappedPort` together when constructi

In some cases it is necessary to make a network connection from a container to a socket that is listening on the host machine. Natively, Docker has limited support for this model across platforms. Testcontainers, however, makes this possible, allowing your code to access services running on the host machine.

In this example, assume that `freePorts` is an slice of ports on our test host machine where different servers (e.g. a web application) are running.
In this example, assume that `freePorts` is a slice of ports on our test host machine where different servers (e.g. a web application) are running.

We can simply create a container and expose these ports to the container using the `ContainerRequest` struct:

Expand All @@ -76,7 +76,7 @@ In the above example we are executing an HTTP request from the command line insi

When you expose a host port to a container, _Testcontainers for Go_ creates an SSHD server companion container, which will be used to forward the traffic from the container to the host machine. This is done by creating a tunnel between the container and the host machine through the SSHD server container.

You can find more information about this SSHD server container on its Github repository: [https://github.com/testcontainers/sshd-docker](https://github.com/testcontainers/sshd-docker).
You can find more information about this SSHD server container on its GitHub repository: [https://github.com/testcontainers/sshd-docker](https://github.com/testcontainers/sshd-docker).

<!--codeinclude-->
[SSHD Server Docker Image](../../port_forwarding.go) inside_block:hubSshdImage
Expand All @@ -101,7 +101,7 @@ In the case you need to skip a test on non-Linux hosts, you can use the `SkipIfD
[Skipping tests on non-Linux hosts](../../docker_test.go) inside_block:skipIfDockerDesktop
<!--/codeinclude-->

It will try to get a Docker client and obtain its Info. In the case the Operation System is "Docker Desktop", it will skip the test.
It will try to get a Docker client and obtain its Info. In the case the Operating System is "Docker Desktop", it will skip the test.

## Advanced networking

Expand Down
Loading
Loading