Skip to content

Commit b16d467

Browse files
committed
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 <[email protected]>
1 parent be9336f commit b16d467

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/cri/server/sandbox_run.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ func (c *criService) RunPodSandbox(ctx context.Context, r *runtime.RunPodSandbox
120120
RuntimeHandler: r.GetRuntimeHandler(),
121121
},
122122
sandboxstore.Status{
123-
State: sandboxstore.StateUnknown,
123+
State: sandboxstore.StateUnknown,
124+
CreatedAt: time.Now().UTC(),
124125
},
125126
)
126127

0 commit comments

Comments
 (0)