Skip to content

Commit 8b5211f

Browse files
authored
chore!: rename EnpointSettingsModifier to EndpointSettingsModifier
1 parent 83d5e55 commit 8b5211f

File tree

5 files changed

+44
-44
lines changed

5 files changed

+44
-44
lines changed

container.go

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -128,44 +128,44 @@ func (c *ContainerFile) validate() error {
128128
// ContainerRequest represents the parameters used to get a running container
129129
type ContainerRequest struct {
130130
FromDockerfile
131-
HostAccessPorts []int
132-
Image string
133-
ImageSubstitutors []ImageSubstitutor
134-
Entrypoint []string
135-
Env map[string]string
136-
ExposedPorts []string // allow specifying protocol info
137-
Cmd []string
138-
Labels map[string]string
139-
Mounts ContainerMounts
140-
Tmpfs map[string]string
141-
RegistryCred string // Deprecated: Testcontainers will detect registry credentials automatically
142-
WaitingFor wait.Strategy
143-
Name string // for specifying container name
144-
Hostname string
145-
WorkingDir string // specify the working directory of the container
146-
ExtraHosts []string // Deprecated: Use HostConfigModifier instead
147-
Privileged bool // For starting privileged container
148-
Networks []string // for specifying network names
149-
NetworkAliases map[string][]string // for specifying network aliases
150-
NetworkMode container.NetworkMode // Deprecated: Use HostConfigModifier instead
151-
Resources container.Resources // Deprecated: Use HostConfigModifier instead
152-
Files []ContainerFile // files which will be copied when container starts
153-
User string // for specifying uid:gid
154-
SkipReaper bool // Deprecated: The reaper is globally controlled by the .testcontainers.properties file or the TESTCONTAINERS_RYUK_DISABLED environment variable
155-
ReaperImage string // Deprecated: use WithImageName ContainerOption instead. Alternative reaper image
156-
ReaperOptions []ContainerOption // Deprecated: the reaper is configured at the properties level, for an entire test session
157-
AutoRemove bool // Deprecated: Use HostConfigModifier instead. If set to true, the container will be removed from the host when stopped
158-
AlwaysPullImage bool // Always pull image
159-
ImagePlatform string // ImagePlatform describes the platform which the image runs on.
160-
Binds []string // Deprecated: Use HostConfigModifier instead
161-
ShmSize int64 // Amount of memory shared with the host (in bytes)
162-
CapAdd []string // Deprecated: Use HostConfigModifier instead. Add Linux capabilities
163-
CapDrop []string // Deprecated: Use HostConfigModifier instead. Drop Linux capabilities
164-
ConfigModifier func(*container.Config) // Modifier for the config before container creation
165-
HostConfigModifier func(*container.HostConfig) // Modifier for the host config before container creation
166-
EnpointSettingsModifier func(map[string]*network.EndpointSettings) // Modifier for the network settings before container creation
167-
LifecycleHooks []ContainerLifecycleHooks // define hooks to be executed during container lifecycle
168-
LogConsumerCfg *LogConsumerConfig // define the configuration for the log producer and its log consumers to follow the logs
131+
HostAccessPorts []int
132+
Image string
133+
ImageSubstitutors []ImageSubstitutor
134+
Entrypoint []string
135+
Env map[string]string
136+
ExposedPorts []string // allow specifying protocol info
137+
Cmd []string
138+
Labels map[string]string
139+
Mounts ContainerMounts
140+
Tmpfs map[string]string
141+
RegistryCred string // Deprecated: Testcontainers will detect registry credentials automatically
142+
WaitingFor wait.Strategy
143+
Name string // for specifying container name
144+
Hostname string
145+
WorkingDir string // specify the working directory of the container
146+
ExtraHosts []string // Deprecated: Use HostConfigModifier instead
147+
Privileged bool // For starting privileged container
148+
Networks []string // for specifying network names
149+
NetworkAliases map[string][]string // for specifying network aliases
150+
NetworkMode container.NetworkMode // Deprecated: Use HostConfigModifier instead
151+
Resources container.Resources // Deprecated: Use HostConfigModifier instead
152+
Files []ContainerFile // files which will be copied when container starts
153+
User string // for specifying uid:gid
154+
SkipReaper bool // Deprecated: The reaper is globally controlled by the .testcontainers.properties file or the TESTCONTAINERS_RYUK_DISABLED environment variable
155+
ReaperImage string // Deprecated: use WithImageName ContainerOption instead. Alternative reaper image
156+
ReaperOptions []ContainerOption // Deprecated: the reaper is configured at the properties level, for an entire test session
157+
AutoRemove bool // Deprecated: Use HostConfigModifier instead. If set to true, the container will be removed from the host when stopped
158+
AlwaysPullImage bool // Always pull image
159+
ImagePlatform string // ImagePlatform describes the platform which the image runs on.
160+
Binds []string // Deprecated: Use HostConfigModifier instead
161+
ShmSize int64 // Amount of memory shared with the host (in bytes)
162+
CapAdd []string // Deprecated: Use HostConfigModifier instead. Add Linux capabilities
163+
CapDrop []string // Deprecated: Use HostConfigModifier instead. Drop Linux capabilities
164+
ConfigModifier func(*container.Config) // Modifier for the config before container creation
165+
HostConfigModifier func(*container.HostConfig) // Modifier for the host config before container creation
166+
EndpointSettingsModifier func(map[string]*network.EndpointSettings) // Modifier for the network settings before container creation
167+
LifecycleHooks []ContainerLifecycleHooks // define hooks to be executed during container lifecycle
168+
LogConsumerCfg *LogConsumerConfig // define the configuration for the log producer and its log consumers to follow the logs
169169
}
170170

171171
// sessionID returns the session ID for the container request.

lifecycle.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -555,8 +555,8 @@ func (p *DockerProvider) preCreateContainerHook(ctx context.Context, req Contain
555555
}
556556
req.HostConfigModifier(hostConfig)
557557

558-
if req.EnpointSettingsModifier != nil {
559-
req.EnpointSettingsModifier(endpointSettings)
558+
if req.EndpointSettingsModifier != nil {
559+
req.EndpointSettingsModifier(endpointSettings)
560560
}
561561

562562
networkingConfig.EndpointsConfig = endpointSettings

lifecycle_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func TestPreCreateModifierHook(t *testing.T) {
5757
},
5858
}
5959
},
60-
EnpointSettingsModifier: func(endpointSettings map[string]*network.EndpointSettings) {
60+
EndpointSettingsModifier: func(endpointSettings map[string]*network.EndpointSettings) {
6161
endpointSettings["a"] = &network.EndpointSettings{
6262
Aliases: []string{"b"},
6363
Links: []string{"link1", "link2"},

options.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func WithConfigModifier(modifier func(config *container.Config)) CustomizeReques
5353
// WithEndpointSettingsModifier allows to override the default endpoint settings
5454
func WithEndpointSettingsModifier(modifier func(settings map[string]*network.EndpointSettings)) CustomizeRequestOption {
5555
return func(req *GenericContainerRequest) error {
56-
req.EnpointSettingsModifier = modifier
56+
req.EndpointSettingsModifier = modifier
5757

5858
return nil
5959
}

reaper_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ func (m *mockReaperProvider) RunContainer(ctx context.Context, req ContainerRequ
5353
}
5454
req.HostConfigModifier(m.hostConfig)
5555

56-
if req.EnpointSettingsModifier != nil {
57-
req.EnpointSettingsModifier(m.endpointSettings)
56+
if req.EndpointSettingsModifier != nil {
57+
req.EndpointSettingsModifier(m.endpointSettings)
5858
}
5959

6060
// we're only interested in the request, so instead of mocking the Docker client

0 commit comments

Comments
 (0)