-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow offline providers #436
Conversation
I think this needs a few tests. It should be easy to write an integration test that checks that the offline commands work without any configured providers and it should prevent regressions (no one caught it in my PR, and no one probably will, without tests, a year from now) |
@julienduchesne integration test added! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one nit. LGTM!
cmd/grr/main.go
Outdated
providerInitFuncs := []func() grizzly.Provider{ | ||
func() grizzly.Provider { return grafana.NewProvider(&context.Grafana) }, | ||
func() grizzly.Provider { return mimir.NewProvider(&context.Mimir) }, | ||
func() grizzly.Provider { return syntheticmonitoring.NewProvider(&context.SyntheticMonitoring) }, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
providerInitFuncs := []func() grizzly.Provider{ | |
func() grizzly.Provider { return grafana.NewProvider(&context.Grafana) }, | |
func() grizzly.Provider { return mimir.NewProvider(&context.Mimir) }, | |
func() grizzly.Provider { return syntheticmonitoring.NewProvider(&context.SyntheticMonitoring) }, | |
} | |
providers := []grizzly.Provider{ | |
grafana.NewProvider(&context.Grafana), | |
mimir.NewProvider(&context.Mimir), | |
syntheticmonitoring.NewProvider(&context.SyntheticMonitoring), | |
} |
Doesn't need to be a func if we're validating in a separate func
#362 added details of which providers were configured. It also prevented unconfigured
providers from being added to the list of available providers.
This has the unfortunate consequence of preventing "offline" commands from working,
e.g.
grr show
,grr list
orgrr export
.This PR resolves this by still allowing an unconfigured provider to be used for such
situations. Now, an unconfigured provider will just error out when it attempts to
connect to its backend.
Closes #424.