Skip to content

Commit 8e2362b

Browse files
committed
Remove rootlessport dead code
Delete networking_rootlessport.go, rootlessPortSync pipes, and the reloadRootlessRLKPortMapping stub. Signed-off-by: Jan Rodák <hony.com@seznam.cz>
1 parent 9b40265 commit 8e2362b

File tree

5 files changed

+0
-96
lines changed

5 files changed

+0
-96
lines changed

.golangci.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,6 @@ linters:
7676
- path: _test\.go
7777
linters:
7878
- prealloc
79-
- linters:
80-
- unused
81-
text: "(rootlessPortSyncR|rootlessPortSyncW)"
82-
8379
issues:
8480
max-issues-per-linter: 0
8581
max-same-issues: 0

libpod/container.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,6 @@ type Container struct {
108108
runtime *Runtime
109109
ociRuntime OCIRuntime
110110

111-
rootlessPortSyncR *os.File
112-
rootlessPortSyncW *os.File
113-
114111
// reservedPorts contains the fds for the bound ports when using the
115112
// bridge network mode as root.
116113
reservedPorts []*os.File

libpod/networking_freebsd.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,6 @@ func (c *Container) inspectJoinedNetworkNS(_ string) (q types.StatusBlock, retEr
221221
return types.StatusBlock{}, nil
222222
}
223223

224-
func (c *Container) reloadRootlessRLKPortMapping() error {
225-
return errors.New("unsupported (*Container).reloadRootlessRLKPortMapping")
226-
}
227-
228224
func (r *Runtime) setupRootlessPortMappingViaPesto(_ *Container) error {
229225
return errors.New("unsupported setupRootlessPortMappingViaPesto on FreeBSD")
230226
}

libpod/networking_rootlessport.go

Lines changed: 0 additions & 67 deletions
This file was deleted.

libpod/oci_conmon_common.go

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,29 +1187,11 @@ func (r *ConmonOCIRuntime) createOCIContainer(ctr *Container, restoreOptions *Co
11871187
// by the container and conmon will keep the ports busy so that another
11881188
// process cannot use them.
11891189
cmd.ExtraFiles = append(cmd.ExtraFiles, ports...)
1190-
1191-
// For rootless port forwarding, create sync pipe and leak write end to conmon
1192-
if rootless.IsRootless() && len(ctr.config.PortMappings) > 0 {
1193-
ctr.rootlessPortSyncR, ctr.rootlessPortSyncW, err = os.Pipe()
1194-
if err != nil {
1195-
return 0, fmt.Errorf("failed to create rootless port sync pipe: %w", err)
1196-
}
1197-
defer errorhandling.CloseQuiet(ctr.rootlessPortSyncW)
1198-
// Leak one end in conmon, the other one will be used by rootlessport
1199-
cmd.ExtraFiles = append(cmd.ExtraFiles, ctr.rootlessPortSyncW)
1200-
}
12011190
} else {
12021191
// ports were bound in ctr.prepare() as we must do it before the netns setup
12031192
filesToClose = append(filesToClose, ctr.reservedPorts...)
12041193
cmd.ExtraFiles = append(cmd.ExtraFiles, ctr.reservedPorts...)
12051194
ctr.reservedPorts = nil
1206-
1207-
// For rootless port forwarding, leak write end to conmon
1208-
// The pipes were created in setupRootlessPortMappingViaRLK() during network setup
1209-
if ctr.rootlessPortSyncW != nil {
1210-
defer errorhandling.CloseQuiet(ctr.rootlessPortSyncW)
1211-
cmd.ExtraFiles = append(cmd.ExtraFiles, ctr.rootlessPortSyncW)
1212-
}
12131195
}
12141196
var runtimeRestoreStarted time.Time
12151197
if restoreOptions != nil {

0 commit comments

Comments
 (0)