Skip to content

Commit a27b508

Browse files
committed
chore: Better naming
1 parent f1d1ef9 commit a27b508

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

‎managedplugin/plugin.go‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -291,20 +291,20 @@ func (c *Client) startDockerPlugin(ctx context.Context, configPath string) error
291291
cli.NegotiateAPIVersion(ctx)
292292
pluginArgs := c.getPluginArgs()
293293

294-
portBindings, err := nat.ParsePortSpec("7777/tcp")
294+
portMappings, err := nat.ParsePortSpec("7777/tcp")
295295
if err != nil {
296296
return fmt.Errorf("failed to parse port spec: %w", err)
297297
}
298298

299-
if len(portBindings) == 0 {
299+
if len(portMappings) == 0 {
300300
return fmt.Errorf("failed to parse port spec: %w", errors.New("no port bindings found"))
301301
}
302302

303-
portBinding := portBindings[0]
303+
portMapping := portMappings[0]
304304

305305
config := &container.Config{
306306
ExposedPorts: nat.PortSet{
307-
portBinding.Port: {},
307+
portMapping.Port: {},
308308
},
309309
Image: configPath,
310310
Cmd: pluginArgs,
@@ -315,7 +315,7 @@ func (c *Client) startDockerPlugin(ctx context.Context, configPath string) error
315315
hostConfig := &container.HostConfig{
316316
ExtraHosts: c.dockerExtraHosts,
317317
PortBindings: map[nat.Port][]nat.PortBinding{
318-
portBinding.Port: {portBinding.Binding},
318+
portMapping.Port: {portMapping.Binding},
319319
},
320320
}
321321

@@ -338,7 +338,7 @@ func (c *Client) startDockerPlugin(ctx context.Context, configPath string) error
338338

339339
var hostConnection string
340340
err = retry.Do(func() error {
341-
hostConnection, err = getHostConnection(ctx, cli, resp.ID, portBinding.Port)
341+
hostConnection, err = getHostConnection(ctx, cli, resp.ID, portMapping.Port)
342342
return err
343343
}, retry.RetryIf(func(err error) bool {
344344
return err.Error() == "failed to get port mapping for container"

0 commit comments

Comments
 (0)