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

oc debug pod --as-root fails with Error: container's runAsUser breaks non-root policy when .spec.securityContext.runAsNonRoot is true #879

Closed
orimanabu opened this issue Jul 12, 2021 · 0 comments

Comments

@orimanabu
Copy link
Contributor

I ran oc debug pod --as-root with cluster-network-operator, then got CreateContainerConfigError.
CNO Pod has .spec.securityContext.runAsNonRoot: true, then should we set it nil?

  • How to reproduce

Run oc debug --as-root with cluster-network-operator.

$ oc -n openshift-network-operator debug pod/network-operator-7855cfd575-wmrlz --as-root --dry-run=client -o yaml | oc apply -f -
$ oc -n openshift-network-operator get pod
NAME                                      READY   STATUS                       RESTARTS   AGE
network-operator-7855cfd575-wmrlz         1/1     Running                      0          29d
network-operator-7855cfd575-wmrlz-debug   0/1     CreateContainerConfigError   0          5s
$ oc -n openshift-network-operator describe pod/network-operator-7855cfd575-wmrlz-debug | tail -n 5
Events:
  Type     Reason  Age                    From     Message
  ----     ------  ----                   ----     -------
  Warning  Failed  2m55s (x12 over 5m8s)  kubelet  Error: container's runAsUser breaks non-root policy
  Normal   Pulled  6s (x25 over 5m8s)     kubelet  Container image "quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:79e60721e7b5362d4de26275281ca8b7208fef8a0a6830bab477b798c84faa3f" already present on machine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant