"juju resources" revision date format uses year-date-month format instead of year-month-date

Bug #1933705 reported by Paul Goins
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
Medium
Harry Pidcock

Bug Description

I just noticed the timestamps listed per "juju resources" appear off. This is on Juju 2.9.5.

$ juju resources kubernetes-master
Resource Supplied by Revision
cdk-addons admin 2021-25-06T23:14
core charmstore 0
kube-apiserver charmstore 0
kube-controller-manager charmstore 0
kube-proxy charmstore 0
kube-scheduler charmstore 0
kubectl charmstore 0

That revision looks close to an ISO 8601 style date, except that it has the month and date flipped around. I'd expect to see this as 2021-06-25T23:14 (or perhaps even 2021-06-25T23:14Z), if ISO 8601 dates are the intent here.

Revision history for this message
Harry Pidcock (hpidcock) wrote :

Yep, that's a bug.

func combinedRevision(r resource.Resource) string {
 switch r.Origin {
 case charmresource.OriginStore:
  // Have to check since 0+ is a valid revision number
  if r.Revision >= 0 {
   return fmt.Sprintf("%d", r.Revision)
  }
 case charmresource.OriginUpload:
  if !r.Timestamp.IsZero() {
   return r.Timestamp.Format("2006-02-01T15:04")
  }
 }
 return "-"
}

Changed in juju:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → Harry Pidcock (hpidcock)
milestone: none → 2.9.7
Revision history for this message
Harry Pidcock (hpidcock) wrote :
Changed in juju:
status: Confirmed → In Progress
Harry Pidcock (hpidcock)
Changed in juju:
status: In Progress → Fix Committed
Changed in juju:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.