1
0
mirror of https://github.com/rancher/steve.git synced 2025-09-25 14:49:38 +00:00
Commit Graph

3 Commits

Author SHA1 Message Date
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
Felipe Gehrke
4212386e13 changing ParseHumanDuration to support timestamp values too (#684) 2025-06-18 10:57:49 -07:00
Felipe Gehrke
b3539616e0 #48673 - Added Timestamp Cache Handling to metadata.fields (#648)
* added timestamp convertion to metadata.fields

* fixed duration parsing

* fixed tests

* removed tags file

* added comments

* added better error handling

* changed ParseHumanDuration to use Fscanf

* added builtins handling

* adding mock updates

* fixing tests

* another try

* added timestamp convertion to metadata.fields

* addressing comments from @ericpromislow

* converting error to warning

* added template options
2025-06-16 15:33:28 -07:00