mirror of
https://github.com/rancher/steve.git
synced 2025-09-01 23:47:50 +00:00
Added more fields - part 6. (#485)
* Added more fields - part 6. * Tweaks needed to get 'batch.cronjobs' working * Add a clarifying comment on pulling values out of an array. * Use the correct capitalization for the etcd-snapshot kind.
This commit is contained in:
@@ -898,6 +898,7 @@ func getField(a any, field string) (any, error) {
|
||||
}
|
||||
obj = fmt.Sprintf("%v", t[key])
|
||||
} else if i == len(subFields)-1 {
|
||||
// If the last layer is an array, return array.map(a => a[subfield])
|
||||
result := make([]string, len(t))
|
||||
for index, v := range t {
|
||||
itemVal, ok := v.(map[string]interface{})
|
||||
|
@@ -76,7 +76,7 @@ func NewStore(ctx context.Context, example any, keyFunc cache.KeyFunc, c db.Clie
|
||||
|
||||
dbName := db.Sanitize(s.name)
|
||||
|
||||
// once multiple informerfactories are needed, this can accept the case where table already exists error is received
|
||||
// once multiple informer-factories are needed, this can accept the case where table already exists error is received
|
||||
err := s.WithTransaction(ctx, true, func(tx transaction.Client) error {
|
||||
createTableQuery := fmt.Sprintf(createTableFmt, dbName)
|
||||
_, err := tx.Exec(createTableQuery)
|
||||
|
Reference in New Issue
Block a user