pod: CreatedAt time will be 269 years ago while creating cri network failed.
We should set sandbox CreatedAt first time when we create sandbox struct, and then set sandbox CreatedAt second time after container started. Before this commit, we just set sandbox CreatedAt after container started, but if network create failed, the sandbox time is the default time, which is 269 years ago, so we need to set sandbox CreatedAt at first, even if an error occurred before start container. Signed-off-by: zzzzzzzzzy9 <zhang.yu58@zte.com.cn>
This commit is contained in:
parent
be9336fed1
commit
b16d467404
@ -120,7 +120,8 @@ func (c *criService) RunPodSandbox(ctx context.Context, r *runtime.RunPodSandbox
|
||||
RuntimeHandler: r.GetRuntimeHandler(),
|
||||
},
|
||||
sandboxstore.Status{
|
||||
State: sandboxstore.StateUnknown,
|
||||
State: sandboxstore.StateUnknown,
|
||||
CreatedAt: time.Now().UTC(),
|
||||
},
|
||||
)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user