triangularSquare
triangularSquare

Reputation: 21

Can a Pod created with CRI-O be updated using the crictl tool?

I wrote a manifest like this:

# busy.pod.yaml
---
metadata:
  name: busybox
  namespace: crio
linux:
  security_context:
    namespace_options:
      network: 2

... and created a Pod from the above with critcl like this:

> sudo crictl runp busy.pod.yaml

That actually created the Pod:

> sudo crictl pods
  POD ID              CREATED             STATE               NAME                NAMESPACE           ATTEMPT             RUNTIME
  7e3c925ff1885       About an hour ago   NotReady            busybox             crio                0                   (default)

However, when I attempted to delete that Pod, I got the following error:

> sudo crictl rmp 7e3c925ff1885
  getting sandbox status of pod "7e3c925ff1885": metadata.Name, metadata.Namespace or metadata.Uid is not in metadata "&PodSandboxMetadata{Name:busybox,Uid:,Namespace:crio,Attempt:0,}"

After some research, I found the following issue on GitHub: https://github.com/containerd/containerd/issues/8830

It seems as if this problem is related to a missing Uid which isn't provided in my above busy.pod.yaml

Someone in the GitHub issue already mentioned:

[...] you need to add a uid field to delete normally [...]

But is it possible to edit (or rather add) a Uid afterwards (after the the Pod has been run with runp)?

I would need to find a way to manually add a Uid so that the Pod can be removed using crictl rmp

I'm currently stuck with the above Pod since I can't remove it, even commands like the following didn't work:

> sudo crictl rmp -f 7e3c925ff1885
  getting sandbox status of pod "7e3c925ff1885": metadata.Name, metadata.Namespace or metadata.Uid is not in metadata "&PodSandboxMetadata{Name:busybox,Uid:,Namespace:crio,Attempt:0,}"

> sudo crictl rmp -f -a
getting sandbox status of pod "7e3c925ff1885ceef01810fd6ecebf38ef67f1da4242ca9508c4848e6a0b70e3": metadata.Name, metadata.Namespace or metadata.Uid is not in metadata "&PodSandboxMetadata{Name:busybox,Uid:,Namespace:crio,Attempt:0,}"

Upvotes: 0

Views: 111

Answers (0)

Related Questions