How to get the specific container ContainerConfig by cri-api ?
Colstuwjx opened this issue · comments
Hi team,
I'm working on some tools which need to be interacting with cri-api, but I found that it's hard to get the ContainerConfig of a running container:
criapi, err := remote.NewRemoteRuntimeService("/run/containerd/containerd.sock", containerd.WithTimeout(10 * time.Second))
if err != nil {
panic(err)
}
cid = "<A_CONTAINER_ID>"
containerStatus, err := criapi.ContainerStatus(cid)
if err != nil {
panic(err)
}
// But there is no container config data, e.g. container envs.
So we did have a ContainerConfig while doing CreateContainer
, how do we get such config data for running containers?
Thanks!
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
- After 90d of inactivity,
lifecycle/stale
is applied - After 30d of inactivity since
lifecycle/stale
was applied,lifecycle/rotten
is applied - After 30d of inactivity since
lifecycle/rotten
was applied, the issue is closed
You can:
- Mark this issue or PR as fresh with
/remove-lifecycle stale
- Mark this issue or PR as rotten with
/lifecycle rotten
- Close this issue or PR with
/close
- Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
- After 90d of inactivity,
lifecycle/stale
is applied - After 30d of inactivity since
lifecycle/stale
was applied,lifecycle/rotten
is applied - After 30d of inactivity since
lifecycle/rotten
was applied, the issue is closed
You can:
- Mark this issue or PR as fresh with
/remove-lifecycle rotten
- Close this issue or PR with
/close
- Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten
Can you please post this on https://github.com/kubernetes/kubernetes/? This repository is read only.
/close
@SergeyKanzhelev: Closing this issue.
In response to this:
Can you please post this on https://github.com/kubernetes/kubernetes/? This repository is read only.
/close
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/test-infra repository.