New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add system time to /info #11291
Add system time to /info #11291
Conversation
@jfrazelle we'll need to refresh all the remote test daemon binaries once this is merged to fix the events-related tests on windows CI |
cool cool On Tue, Mar 10, 2015 at 2:34 PM, Ahmet Alp Balkan notifications@github.com
|
LGTM |
@@ -69,6 +70,15 @@ func (env *Env) SetBool(key string, value bool) { | |||
} | |||
} | |||
|
|||
func (env *Env) GetDate(key string) (time.Time, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be GetTime and SetTime
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tiborvass right. fixed.
This change adds daemon's system time as RFC3339Nano to the `/info` endpoint and shows in a more readable format (UnixDate) in `docker -D info` output. I will be using this to fix the clock skew between the remote test host and the CI machines running `docker events`-related tests as they're using `--since` and `--until` and the timestamps are not matching when daemon is not on the same machine. Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Anyone else? |
@@ -69,6 +70,15 @@ func (env *Env) SetBool(key string, value bool) { | |||
} | |||
} | |||
|
|||
func (env *Env) GetTime(key string) (time.Time, error) { | |||
t, err := time.Parse(time.RFC3339Nano, env.Get(key)) | |||
return t, err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a blocker, but why not directly return time.Parse(...)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
erm, right. should I fix? @icecrime
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll survive :p
Yup, LGTM! Moving to |
@icecrime updated Remote API 1.18 already. |
examples in the Docs LGTM - @docker/docs-owners |
LGTM |
Thanks for reviewing. @jfrazelle we need to update remote test daemon bits with this now. |
woohooo |
This change adds daemon's system time as RFC3339Nano to the
/info
endpointand shows in a more readable format (UnixDate) in
docker -D info
output.I will be using this to fix the clock skew between the remote test host and
the CI machines running
docker events
-related tests as they're using--since
and
--until
and the timestamps are not matching when daemon is not on thesame machine.
Signed-off-by: Ahmet Alp Balkan ahmetalpbalkan@gmail.com
cc: @icecrime @duglin @jfrazelle