jordanwilson230 / kubectl-plugins

A Collection of Plugins for kubectl Integration (exec as any user, context switching, etc).
Apache License 2.0
623 stars 63 forks source link

The Pod is invalid: spec.containers[0].restartPolicy: Forbidden: may not be set for non-init containers #53

Open kishor7007 opened 1 month ago

kishor7007 commented 1 month ago

Running kubectl exec-as -u root -n default -c istio-proxy -d sleep-db7f48c4-spbgw -- /bin/bash command throws below error The Pod "kishor-1" is invalid: spec.containers[0].restartPolicy: Forbidden: may not be set for non-init containers

dvglab commented 1 week ago

The same issue for me: kubectl exec-as -u root -n dev -c backend -d backend-77bffd84b-66hzg -- /bin/bash The Pod "dvg-1" is invalid: spec.containers[0].restartPolicy: Forbidden: may not be set for non-init containers