Skip to content

[release/1.6] Handle teardown failure to avoid blocking cleanup#10778

Merged
kzys merged 1 commit intocontainerd:release/1.6from
matteopulcini6:release1.6
Oct 18, 2024
Merged

[release/1.6] Handle teardown failure to avoid blocking cleanup#10778
kzys merged 1 commit intocontainerd:release/1.6from
matteopulcini6:release1.6

Conversation

@matteopulcini6
Copy link
Copy Markdown

@matteopulcini6 matteopulcini6 commented Oct 5, 2024

Cherry-pick of #10770 for release 1.6


Created pod-config.json as per crictl docs

root@7611fd8b15fd:/src# create pod-config.json
  echo "{
      \"metadata\": {
          \"name\": \"nginx-sandbox\",
          \"namespace\": \"default\",
          \"attempt\": 1,
          \"uid\": \"65fb5845de97d8a4\"
      },
      \"log_directory\": \"/tmp\",
      \"linux\": {
      }
  }
  " | tee pod-config.json
root@2f8f343b8881:/src# crictl runp pod-config.json
E1005 18:00:26.719186   23199 remote_runtime.go:176] "RunPodSandbox from runtime service failed" err="rpc error: code = Unknown desc = failed to setup network for sandbox \"df615a04a1ba1eef496b5e64f8a7a4a2eb8b188e35f2442a8ba1f5f54a169b8c\": cni plugin not initialized"
FATA[0001] run pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "df615a04a1ba1eef496b5e64f8a7a4a2eb8b188e35f2442a8ba1f5f54a169b8c": cni plugin not initialized 

The pod has still been created, although CNI has not been installed.

root@2f8f343b8881:/src# crictl pods
POD ID              CREATED             STATE               NAME                NAMESPACE           ATTEMPT             RUNTIME
df615a04a1ba1       5 seconds ago       NotReady            nginx-sandbox       default             1                   (default)

Reset cleanupErr variable to prevent further defer functions from being blocked

// ignoring failed to destroy networks when we failed to setup networks
if sandbox.CNIResult == nil {
cleanupErr = nil
}

Re-build code with changes ...

The pod isn't created ...

root@7611fd8b15fd:/src# crictl pods
POD ID              CREATED             STATE               NAME                NAMESPACE           ATTEMPT             RUNTIME

Signed-off-by: root <root@MYDTK1.fyre.ibm.com>
@k8s-ci-robot
Copy link
Copy Markdown

Hi @matteopulcini6. Thanks for your PR.

I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@dosubot dosubot bot added the area/cri Container Runtime Interface (CRI) label Oct 5, 2024
@matteopulcini6 matteopulcini6 changed the title Cherry pick of #10770 for release 1.6 [Release/1.6] Handle teardown failure to avoid blocking cleanup Oct 5, 2024
@samuelkarp samuelkarp changed the title [Release/1.6] Handle teardown failure to avoid blocking cleanup [release/1.6] Handle teardown failure to avoid blocking cleanup Oct 18, 2024
@kzys kzys merged commit 8a30dc0 into containerd:release/1.6 Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants