Remove cri SandboxInfo RuntimeHandler
Signed-off-by: Jin Dong <djdongjin95@gmail.com>
This commit is contained in:
parent
dacde84372
commit
6f43197c25
@ -61,11 +61,10 @@ func (c *Controller) Status(ctx context.Context, sandboxID string, verbose bool)
|
|||||||
// toCRISandboxInfo converts internal container object information to CRI sandbox status response info map.
|
// toCRISandboxInfo converts internal container object information to CRI sandbox status response info map.
|
||||||
func toCRISandboxInfo(ctx context.Context, sb *types.PodSandbox) (map[string]string, error) {
|
func toCRISandboxInfo(ctx context.Context, sb *types.PodSandbox) (map[string]string, error) {
|
||||||
si := &critypes.SandboxInfo{
|
si := &critypes.SandboxInfo{
|
||||||
Pid: sb.Status.Get().Pid,
|
Pid: sb.Status.Get().Pid,
|
||||||
Config: sb.Metadata.Config,
|
Config: sb.Metadata.Config,
|
||||||
RuntimeHandler: sb.Metadata.RuntimeHandler,
|
CNIResult: sb.Metadata.CNIResult,
|
||||||
CNIResult: sb.Metadata.CNIResult,
|
Metadata: &sb.Metadata,
|
||||||
Metadata: &sb.Metadata,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if container := sb.Container; container != nil {
|
if container := sb.Container; container != nil {
|
||||||
|
@ -144,10 +144,9 @@ func toCRISandboxStatus(meta sandboxstore.Metadata, status string, createdAt tim
|
|||||||
// we should fallback to get SandboxInfo from cached sandbox itself.
|
// we should fallback to get SandboxInfo from cached sandbox itself.
|
||||||
func toDeletedCRISandboxInfo(sandbox sandboxstore.Sandbox) (map[string]string, error) {
|
func toDeletedCRISandboxInfo(sandbox sandboxstore.Sandbox) (map[string]string, error) {
|
||||||
si := &types.SandboxInfo{
|
si := &types.SandboxInfo{
|
||||||
Pid: sandbox.Status.Get().Pid,
|
Pid: sandbox.Status.Get().Pid,
|
||||||
Config: sandbox.Config,
|
Config: sandbox.Config,
|
||||||
RuntimeHandler: sandbox.RuntimeHandler,
|
CNIResult: sandbox.CNIResult,
|
||||||
CNIResult: sandbox.CNIResult,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// If processStatus is empty, it means that the task is deleted. Apply "deleted"
|
// If processStatus is empty, it means that the task is deleted. Apply "deleted"
|
||||||
|
@ -27,16 +27,12 @@ import (
|
|||||||
// SandboxInfo is extra information for sandbox.
|
// SandboxInfo is extra information for sandbox.
|
||||||
// TODO (mikebrow): discuss predefining constants structures for some or all of these field names in CRI
|
// TODO (mikebrow): discuss predefining constants structures for some or all of these field names in CRI
|
||||||
type SandboxInfo struct {
|
type SandboxInfo struct {
|
||||||
Pid uint32 `json:"pid"`
|
Pid uint32 `json:"pid"`
|
||||||
Status string `json:"processStatus"`
|
Status string `json:"processStatus"`
|
||||||
NetNSClosed bool `json:"netNamespaceClosed"`
|
NetNSClosed bool `json:"netNamespaceClosed"`
|
||||||
Image string `json:"image"`
|
Image string `json:"image"`
|
||||||
SnapshotKey string `json:"snapshotKey"`
|
SnapshotKey string `json:"snapshotKey"`
|
||||||
Snapshotter string `json:"snapshotter"`
|
Snapshotter string `json:"snapshotter"`
|
||||||
// Note: a new field `RuntimeHandler` has been added into the CRI PodSandboxStatus struct, and
|
|
||||||
// should be set. This `RuntimeHandler` field will be deprecated after containerd 1.3 (tracked
|
|
||||||
// in https://github.com/containerd/cri/issues/1064).
|
|
||||||
RuntimeHandler string `json:"runtimeHandler"` // see the Note above
|
|
||||||
RuntimeType string `json:"runtimeType"`
|
RuntimeType string `json:"runtimeType"`
|
||||||
RuntimeOptions interface{} `json:"runtimeOptions"`
|
RuntimeOptions interface{} `json:"runtimeOptions"`
|
||||||
Config *runtime.PodSandboxConfig `json:"config"`
|
Config *runtime.PodSandboxConfig `json:"config"`
|
||||||
|
Loading…
Reference in New Issue
Block a user