Bug 1232251
| Summary: | Created time is not same with CLI on deployment page | ||||||
|---|---|---|---|---|---|---|---|
| Product: | OpenShift Container Platform | Reporter: | Wei Sun <wsun> | ||||
| Component: | oc | Assignee: | Maciej Szulik <maszulik> | ||||
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Xingxing Xia <xxia> | ||||
| Severity: | low | Docs Contact: | |||||
| Priority: | medium | ||||||
| Version: | unspecified | CC: | aos-bugs, jforrest, jokerman, libra-bugs, mmccomas, wsun | ||||
| Target Milestone: | --- | ||||||
| Target Release: | --- | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2019-08-21 10:10:02 UTC | Type: | Bug | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Embargoed: | |||||||
| Attachments: |
|
||||||
|
Description
Wei Sun
2015-06-16 11:19:43 UTC
Created attachment 1039392 [details]
deploymentpage
If it's +/- one hour, I suspect we're using a different rounding strategy in the CLI vs the Web Console. Here is what we use in the web console: http://momentjs.com/docs/#/displaying/fromnow/ If it's 1 hr 30 minutes, we round up to 2 hrs. I'm not sure what the CLI does, but perhaps it never rounds up. (In reply to Samuel Padgett from comment #3) > Here is what we use in the web console: > > http://momentjs.com/docs/#/displaying/fromnow/ > > If it's 1 hr 30 minutes, we round up to 2 hrs. I'm not sure what the CLI > does, but perhaps it never rounds up. The client relativetime algorithm is: 1. the formatRelativeTime function definition. https://github.com/openshift/origin/blob/27d63965c30af462e005056af7cfb1e34572b987/pkg/cmd/cli/describe/helpers.go#L113 2. the HumanDuration function definition. https://github.com/docker/docker/blob/master/pkg/units/duration.go#L10 And as the code show here, it switch the type to an integer, so will miss some data. http://play.golang.org/p/WGVrd9ofqf Jessica, should we close? It's working as intended despite the discrepancy. Discussed among the team and we generally agree the truncation approach the CLI is using is wrong when compared to a rounding approach. There was additional discussion that we may want to increase the levels of precision and show hours + mins instead of just hours which would require changes across both CLI and console. We may want to open that as a separate issue to discuss. Related upstream (Docker) PR: https://github.com/docker/go-units/pull/22 Checked in oc/openshift v1.5.0-alpha.1+b53352c-251. Found some problems. Below are test steps and results. First, create various resources when time is: $ date Mon Jan 16 16:00:00 CST 2017 $ oc new-app -f https://raw.githubusercontent.com/openshift/origin/master/examples/sample-app/application-template-stibuild.json Then set local time with various time differences from resource creation time, and check resource age (or synonym display words STARTED/Created) via `oc get all` and via local browser respectively 1. Make local time minus creation time = 1h and 10min $ sudo date -s "2017-01-16 17:10" 2. Check resource age via `oc get all` and via local browser respectively CLI and browser can both show age: 1h. This is acceptable. 3. Make local time minus creation time = 1h and 40min $ sudo date -s "2017-01-16 17:40" 4. Repeat above check 2 CLI and browser can show consistent age. But for build/IS, they show 2h, for other resources pod/rc/svc, they show 1h. This is not acceptable. 5. Make local time minus creation time = 40min $ sudo date -s "2017-01-16 16:40" 6. Repeat above check 2 CLI: all resources build/IS/pod/rc/svc age is shown 40 mins (ago) Browser: all resources build/IS/pod/rc/svc age is shown an hour (ago). Inconsistency between CLI and browser may be acceptable, but not perfect. 7. Make local time minus creation time = 1day and 20h $ sudo date -s "2017-01-18 12:10" 8. Repeat above check 2 CLI: build/IS age is shown 44 hours ago, pod/rc/svc age is shown 1d. This is not acceptable. Browser: all resources build/IS/pod/rc/svc age is shown 2 days (ago). Inconsistency between CLI and browser is not fixed yet and not acceptable 9. Make local time minus creation time = negative 3h $ sudo date -s "2017-01-16 13:40" 10. Repeat above check 2 CLI: build/IS age is shown "Less than a second ago". Other resources pod/rc/svc age is shown <invalid>. The latter is known NOTA bug: 1299328. But the former is inconsistent with the latter. Browser: All resources build/IS/pod/rc/svc age is shown "in 3 hours". Inconsistency between CLI and browser is not acceptable Forgot to notice comment 0 checks creation time in 'oc describe'. Now also checked it by `for i in build is dc rc svc pod; do echo "${i}:"; oc describe $i | grep '^Created'; done` for each time difference in comment 9: For comment 9 step 1 (1h10min), the 'for' execution shows: build: Created: About an hour ago is: Created: About an hour ago Created: About an hour ago dc: Created: About an hour ago Created: About an hour ago rc: svc: pod: For comment 9 step 3 (1h40min), it shows "2 hours ago" (for build/is/dc. Below ditto) For comment 9 step 5 (40min), it shows "About an hour ago". For comment 9 step 7 (1d20h), it shows "44 hours ago". For comment 9 step 9 (-3h), it shows "Less than a second ago". For difference < half an hour, e.g. 20min, it shows "20 minutes ago" So in summary, the time shown in 'oc describe' looks good, though. Unfixed problems only exist in the comparison of `oc get ...` with browser in comment 9. Thanks! Should be fixed by now. |