@@ -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