Description
Original Question in Slack
I started a discussion regarding a replacement for the old querier mechanism in slack which I have included below:
We have code that ties into the old querier mechanism from operator-registry where we would do the following:
- convert declarative config to model representation using
model, err := declcfg.ConvertToModel(cfg)
- get the querier using
querier, err = registry.NewQuerier(model)
- use the querier so we can get the same results as would be provided via the GRPC interface, but without actual GRPC calls.
With the changes that went in sometime in January, this mechanism was replaced with the JSON cache. To do something similar to what I described above I’d either need public access to things that are currently private, (e.g.
JSON.packageIndex
) or I need a function likefunc FromDeclCfg(*cfg declcfg.DeclarativeConfig) *JSON
that allows me to have a JSON instance built from a declarative config.Given what I’ve described, is there some other option I’ve not considered or do we need a code change to make this happen?
Potential PRs To-date
After discussion with @joelanford, he created PR #1111 which would allow the JSON cache to be instantiated without incurring unnecessary processing for the use case described above. He would like to explore other options that don't rely on the cache mechanism to make for a cleaner API.