mirror of
https://github.com/rancher/steve.git
synced 2025-09-04 00:44:55 +00:00
Index more sqlite cache fields (#271)
* Add more fields to index when sql-caching is on. Misc changes: - Use the builtin Event class, not events.k8s.io (by looking at the dashboard client code) - Specify full path to the management.cattle.io fields. - Map `Event.type` to `Event._type` for indexing. Use a compound transform-func to first check for a "signal", and then to run all the relevant transformers until either one fails or the list is exhausted. - Includes moving the fakeSummaryCache type into a common area. Use a simpler way of running transforms. * Inline the function to get the gvk key. * Create a '--sql-cache' flag to turn on caching for the steve CLI. * Improve error-handling in object transformer. * Drop the 'GetTransform' function. * Inline the code that transforms a payload into a k8s-unstructured object.
This commit is contained in:
@@ -13,6 +13,7 @@ import (
|
||||
type Config struct {
|
||||
Debug bool
|
||||
DebugLevel int
|
||||
SQLCache bool
|
||||
}
|
||||
|
||||
func (c *Config) MustSetupDebug() {
|
||||
@@ -54,6 +55,10 @@ func Flags(config *Config) []cli.Flag {
|
||||
Value: 7,
|
||||
Destination: &config.DebugLevel,
|
||||
},
|
||||
cli.BoolFlag{
|
||||
Name: "sql-cache",
|
||||
Destination: &config.SQLCache,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,5 +73,9 @@ func FlagsV2(config *Config) []cliv2.Flag {
|
||||
Value: 7,
|
||||
Destination: &config.DebugLevel,
|
||||
},
|
||||
&cliv2.BoolFlag{
|
||||
Name: "sql-cache",
|
||||
Destination: &config.SQLCache,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user