mirror of https://github.com/rancher/steve.git
* Capture type info so numeric values sort correctly. * Replace conditional string prefixing with strings.TrimPrefix * Add tabular data for other metadata.fields to sort numerically. The issue is that some fields are not numeric, but are represented in an entry in metadata.fields with a numeric indicator. Like with secrets, metadata.fields[2] gives the number of actual keys in the stored secret. * Update added test to include the typeGuidance param. * Act on review suggestions/comments. * Add a unit test verifying typeGuidance can change a DB field type. The test found an error that it's better for getFieldAndColInfo to return default typeGuidance = an empty map rather than `nil`. * Add Tom's unit test to verify TypeGuidance influences sorting. Also add a fake type-guidance as int on a field where the values start with a number but also have non-numeric data. sqlite stores the entire string, and sort maps the values to 0... so sorting doesn't repeats the incoming order (and sort-DESC reverses it). * Add a clarifying comment on sorting non-ints or partly-ints as INT. * Add more test objects to verify sorting mix of ints and non-ints works as expected. |
||
|---|---|---|
| .. | ||
| db_mocks_test.go | ||
| dynamic_mocks_test.go | ||
| informer_factory.go | ||
| informer_factory_test.go | ||
| k8s_cache_mocks_test.go | ||
| sql_informer_mocks_test.go | ||