1
0
mirror of https://github.com/rancher/steve.git synced 2025-09-24 21:08:03 +00:00
Files
steve/pkg/resources
Wolfgang Jung 10d0492ae3 Fixes parsing of resources older than 2 year (#784)
- Similar assumption as 24h per day:
  365 days per year, ignoring DST and leap-years

Very old resources (older than 2 years) are printed as `2y15d` instead of using just the number of days.

This leads to parser errors for namespaces in rancher:
```
2025/08/18 14:43:34 [WARNING] convert timestamp value: 2y114d failed with error: strconv.ParseInt: parsing "2y114d": invalid syntax
2025/08/18 14:43:34 [WARNING] convert timestamp value: 3y50d failed with error: strconv.ParseInt: parsing "3y50d": invalid syntax
2025/08/18 14:43:34 [WARNING] convert timestamp value: 2y163d failed with error: strconv.ParseInt: parsing "2y163d": invalid syntax
2025/08/18 14:43:34 [WARNING] convert timestamp value: 3y50d failed with error: strconv.ParseInt: parsing "3y50d": invalid syntax
```

Relates to https://github.com/rancher/steve/pull/684

Co-authored-by: Wolfgang Jung <wolfgang.jung@loewenfels.ch>
2025-08-19 13:11:57 -03:00
..
2021-03-01 22:26:26 -07:00
2025-07-11 13:28:52 -04:00