8000 api: add CreatedAt to v1.Pod by iaguis · Pull Request #3797 · rkt/rkt · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Feb 24, 2020. It is now read-only.

api: add CreatedAt to v1.Pod #3797

Merged
merged 2 commits into from
Sep 20, 2017
Merged

api: add CreatedAt to v1.Pod #3797

merged 2 commits into from
Sep 20, 2017

Conversation

iaguis
Copy link
Member
@iaguis iaguis commented Sep 18, 2017

It might happen that the pod is created but we can't get its start time
(e.g. we can't find the CNI network corresponding to --net=NETWORK).

This means StartedAt will not be set and the kubelet will error out and
ignore the pod, so it won't try to start it again.

Let's introduce CreatedAt to express the time when the pod was created
(even if it doesn't start) to handle this. This works because this time
is available after pod preparation.

We'll need to change rktlet to use CreatedAt instead of StartedAt when
getting a pod sandbox status.

@lucab
Copy link
Member
lucab commented Sep 19, 2017

For reference, what's the CRI field this is forwarded to and what is its expected semantics?

@iaguis
Copy link
Member Author
iaguis commented Sep 19, 2017

The CRI field is CreatedAt and it is the "Creation timestamps of the PodSandbox in nanoseconds".

I think it matches better with rkt's creation time than start time.

@lucab
Copy link
Member
lucab commented Sep 19, 2017

@iaguis agreed, it makes sense. If we already have some testing around status output can we at least introduce a check for the always >0 invariant to avoid future regressions?

@iaguis
Copy link
Member Author
iaguis commented Sep 19, 2017

@iaguis agreed, it makes sense. If we already have some testing around status output can we at least introduce a check for the always >0 invariant to avoid future regressions?

I can add an invariant check on the function that parses the output rkt status $UUID so we make sure we always have the state and created fields.

Then I can add a test that does rkt app --net=nonexistent sandbox and checks its status.

@lucab
Copy link
Member
lucab commented Sep 20, 2017

@iaguis I'm personally happy enough with the first check and the always-positive check.

@lucab lucab added this to the 1.29.0 milestone Sep 20, 2017
It might happen that the pod is created but we can't get its start time
(e.g. we can't find the CNI network corresponding to `--net=NETWORK`).

This means StartedAt will not be set and the kubelet will error out and
ignore the pod, so it won't try to start it again.

Let's introduce CreatedAt to express the time when the pod was created
(even if it doesn't start) to handle this. This works because this time
is available after pod preparation.

We'll need to change rktlet to use CreatedAt instead of StartedAt when
getting a pod sandbox status.
@iaguis
Copy link
Member Author
iaguis commented Sep 20, 2017

Updated.

Copy link
Member
@lucab lucab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

8000
@iaguis iaguis merged commit 0051bc1 into rkt:master Sep 20, 2017
@iaguis iaguis deleted the iaguis/created-at branch January 9, 2018 12:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0