Skip to content

Commit 8df9362

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 146c960 commit 8df9362

5 files changed

Lines changed: 0 additions & 145 deletions

File tree

.golangci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ linters:
7676
- path: _test\.go
7777
linters:
7878
- prealloc
79-
8079
issues:
8180
max-issues-per-linter: 0
8281
max-same-issues: 0

libpod/container.go

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

111-
rootlessSlirpSyncR *os.File
112-
rootlessSlirpSyncW *os.File
113-
114-
rootlessPortSyncR *os.File
115-
rootlessPortSyncW *os.File
116-
117111
// reservedPorts contains the fds for the bound ports when using the
118112
// bridge network mode as root.
119113
reservedPorts []*os.File

libpod/networking_freebsd.go

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

229-
func (c *Container) reloadRootlessRLKPortMapping() error {
230-
return errors.New("unsupported (*Container).reloadRootlessRLKPortMapping")
231-
}
232-
233229
func (r *Runtime) setupRootlessPortMappingViaPesto(_ *Container) error {
234230
return errors.New("unsupported setupRootlessPortMappingViaPesto on FreeBSD")
235231
}

libpod/networking_slirp4netns.go

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

libpod/oci_conmon_common.go

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1193,34 +1193,6 @@ func (r *ConmonOCIRuntime) createOCIContainer(ctr *Container, restoreOptions *Co
11931193
cmd.ExtraFiles = append(cmd.ExtraFiles, ctr.reservedPorts...)
11941194
ctr.reservedPorts = nil
11951195
}
1196-
1197-
if ctr.config.NetMode.IsSlirp4netns() || rootless.IsRootless() {
1198-
if ctr.config.PostConfigureNetNS {
1199-
havePortMapping := len(ctr.config.PortMappings) > 0
1200-
if havePortMapping {
1201-
ctr.rootlessPortSyncR, ctr.rootlessPortSyncW, err = os.Pipe()
1202-
if err != nil {
1203-
return 0, fmt.Errorf("failed to create rootless port sync pipe: %w", err)
1204-
}
1205-
}
1206-
ctr.rootlessSlirpSyncR, ctr.rootlessSlirpSyncW, err = os.Pipe()
1207-
if err != nil {
1208-
return 0, fmt.Errorf("failed to create rootless network sync pipe: %w", err)
1209-
}
1210-
}
1211-
1212-
if ctr.rootlessSlirpSyncW != nil {
1213-
defer errorhandling.CloseQuiet(ctr.rootlessSlirpSyncW)
1214-
// Leak one end in conmon, the other one will be leaked into slirp4netns
1215-
cmd.ExtraFiles = append(cmd.ExtraFiles, ctr.rootlessSlirpSyncW)
1216-
}
1217-
1218-
if ctr.rootlessPortSyncW != nil {
1219-
defer errorhandling.CloseQuiet(ctr.rootlessPortSyncW)
1220-
// Leak one end in conmon, the other one will be leaked into rootlessport
1221-
cmd.ExtraFiles = append(cmd.ExtraFiles, ctr.rootlessPortSyncW)
1222-
}
1223-
}
12241196
var runtimeRestoreStarted time.Time
12251197
if restoreOptions != nil {
12261198
runtimeRestoreStarted = time.Now()

0 commit comments

Comments
 (0)