1
0
mirror of https://github.com/rancher/steve.git synced 2025-09-06 18:01:04 +00:00

#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
This commit is contained in:
Felipe Gehrke
2025-06-16 19:33:28 -03:00
committed by GitHub
parent 2e8a0f2851
commit b3539616e0
13 changed files with 513 additions and 33 deletions

View File

@@ -1068,7 +1068,7 @@ func Test_formatterLinks(t *testing.T) {
APIObject: test.apiObject,
Links: test.currentLinks,
}
fmtter := formatter(nil, asl)
fmtter := formatter(nil, asl, TemplateOptions{InSQLMode: false})
fmtter(request, resource)
require.Equal(t, test.wantLinks, resource.Links)
@@ -1269,7 +1269,7 @@ func TestFormatterAddsResourcePermissions(t *testing.T) {
asl.EXPECT().AccessFor(&defaultUserInfo).Return(&accessSet).AnyTimes()
formatter := formatter(fakeCache, asl)
formatter := formatter(fakeCache, asl, TemplateOptions{InSQLMode: false})
formatter(req, resource)
// Extract the resultant resourcePermissions