Change StateUnknown to StateInit
Signed-off-by: Lantao Liu <lantaol@google.com>
This commit is contained in:
@@ -85,7 +85,7 @@ func (c *criService) RunPodSandbox(ctx context.Context, r *runtime.RunPodSandbox
|
||||
RuntimeHandler: r.GetRuntimeHandler(),
|
||||
},
|
||||
sandboxstore.Status{
|
||||
State: sandboxstore.StateUnknown,
|
||||
State: sandboxstore.StateInit,
|
||||
},
|
||||
)
|
||||
|
||||
@@ -258,7 +258,7 @@ func (c *criService) RunPodSandbox(ctx context.Context, r *runtime.RunPodSandbox
|
||||
return nil, errors.Wrap(err, "failed to update sandbox created timestamp")
|
||||
}
|
||||
|
||||
// Add sandbox into sandbox store in UNKNOWN state.
|
||||
// Add sandbox into sandbox store in INIT state.
|
||||
sandbox.Container = container
|
||||
if err := c.sandboxStore.Add(sandbox); err != nil {
|
||||
return nil, errors.Wrapf(err, "failed to add sandbox %+v into store", sandbox)
|
||||
@@ -269,7 +269,7 @@ func (c *criService) RunPodSandbox(ctx context.Context, r *runtime.RunPodSandbox
|
||||
c.sandboxStore.Delete(id)
|
||||
}
|
||||
}()
|
||||
// NOTE(random-liu): Sandbox state only stay in UNKNOWN state after this point
|
||||
// NOTE(random-liu): Sandbox state only stay in INIT state after this point
|
||||
// and before the end of this function.
|
||||
// * If `Update` succeeds, sandbox state will become READY in one transaction.
|
||||
// * If `Update` fails, sandbox will be removed from the store in the defer above.
|
||||
@@ -279,8 +279,8 @@ func (c *criService) RunPodSandbox(ctx context.Context, r *runtime.RunPodSandbox
|
||||
// * If the task is running, sandbox state will be READY,
|
||||
// * Or else, sandbox state will be NOTREADY.
|
||||
//
|
||||
// In any case, sandbox will leave UNKNOWN state, so it's safe to ignore sandbox
|
||||
// in UNKNOWN state in other functions.
|
||||
// In any case, sandbox will leave INIT state, so it's safe to ignore sandbox
|
||||
// in INIT state in other functions.
|
||||
|
||||
// Start sandbox container in one transaction to avoid race condition with
|
||||
// event monitor.
|
||||
@@ -293,8 +293,8 @@ func (c *criService) RunPodSandbox(ctx context.Context, r *runtime.RunPodSandbox
|
||||
// see the sandbox disappear after the defer clean up, which may confuse
|
||||
// them.
|
||||
//
|
||||
// Given so, we should keep the sandbox in UNKNOWN state if `Update` fails,
|
||||
// and ignore sandbox in UNKNOWN state in all the inspection functions.
|
||||
// Given so, we should keep the sandbox in INIT state if `Update` fails,
|
||||
// and ignore sandbox in INIT state in all the inspection functions.
|
||||
|
||||
// Create sandbox task in containerd.
|
||||
log.Tracef("Create sandbox container (id=%q, name=%q).",
|
||||
|
||||
Reference in New Issue
Block a user