Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libpod: always use PostConfigureNetNS option #18468

Closed
wants to merge 1 commit into from

Commits on May 8, 2023

  1. libpod: always use PostConfigureNetNS option

    Maintaining two code paths for network setup has been difficult, I had
    to deal with many bugs because of that. Often the PostConfigureNetNS was
    not as tested. Overall the code has quite a bit of complexity because of
    this option. Just look at this commit how much simpler the code now
    looks.
    
    The main advantage of this is that we no longer have to test everything
    twice, i.e. with userns and without one.
    
    The downside is that mount and netns setup is no longer parallel but I
    think this is fine, it didn't seem to make a measurable difference.
    
    To preserve compatibility in case of an downgrade we keep the
    PostConfigureNetNS bool and set it always to true.
    
    This turned out to be much more complicated that thought due to our
    spaghetti code. The restart=always case is special because we reuse the
    netns. But the slirp4netns and rootlessport process are bound to the
    conmon process so they have to be restarted. Given the the network is
    now setup in completeNetworkSetup() which is always called by init()
    which is called in handleRestartPolicy(). Therefore we can get rid of
    the special rootless setup function to restart slirp and rootlessport.
    Instead we let one single network setup function take care of that
    which is used in all cases.
    
    [NO NEW TESTS NEEDED] Existing test should all pass.
    
    Fixes containers#17965
    
    Signed-off-by: Paul Holzinger <[email protected]>
    Luap99 committed May 8, 2023
    Configuration menu
    Copy the full SHA
    8031869 View commit details
    Browse the repository at this point in the history