• Kubernetes Submit Queue's avatar
    Merge pull request #52864 from dcbw/dockershim-fix-net-teardown · fc8a647f
    Kubernetes Submit Queue authored
    Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>..
    
    dockershim: fine-tune network-ready handling on sandbox teardown and removal
    
    If sandbox teardown results in an error, GC will periodically attempt
    to again remove the sandbox.  Until the sandbox is removed, pod
    sandbox status calls will attempt to enter the pod's namespace and
    retrieve the pod IP, but the first teardown attempt may have already
    removed the network namespace, resulting in a pointless log error
    message that the network namespace doesn't exist, or that nsenter
    can't find eth0.
    
    The network-ready mechanism originally attempted to suppress those
    messages by ensuring that pod sandbox status skipped network checks
    when networking was already torn down, but unfortunately the ready
    value was cleared too early.
    
    Also, don't tear down the pod network multiple times if the first
    time we tore it down, it succeeded.
    
    
    
    **What this PR does / why we need it**:
    
    **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #
    
    **Special notes for your reviewer**:
    
    **Release note**:
    
    ```release-note
    ```
    fc8a647f
docker_sandbox.go 24.6 KB