refactor(query/dependencies): update to new Flux dependencies defaults

pull/14813/head
Nathaniel Cook 2019-08-26 12:35:26 -06:00
parent c7bbfbe293
commit dfc28335ea
5 changed files with 8 additions and 8 deletions

View File

@ -106,5 +106,5 @@ func getFluxREPL(addr, token string, orgID platform.ID) (*repl.REPL, error) {
}
// background context is OK here, and DefaultDependencies are noop deps. Also safe since we send all queries to the
// server side.
return repl.New(context.Background(), dependencies.NewDefaultDependencies(), q), nil
return repl.New(context.Background(), dependencies.NewDefaults(), q), nil
}

2
go.mod
View File

@ -38,7 +38,7 @@ require (
github.com/hashicorp/go-msgpack v0.0.0-20150518234257-fa3f63826f7c // indirect
github.com/hashicorp/raft v1.0.0 // indirect
github.com/hashicorp/vault/api v1.0.2
github.com/influxdata/flux v0.40.2-0.20190823211512-ec418d051ff0
github.com/influxdata/flux v0.40.2-0.20190826193022-fc11285bfb27
github.com/influxdata/influxql v0.0.0-20180925231337-1cbfca8e56b6
github.com/influxdata/usage-client v0.0.0-20160829180054-6d3895376368
github.com/jessevdk/go-flags v1.4.0

4
go.sum
View File

@ -206,8 +206,8 @@ github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NH
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/influxdata/changelog v1.0.0 h1:RstJD6H48zLQj0GdE6E6k/6RPwtUjkyzIe/T1E/xuWU=
github.com/influxdata/changelog v1.0.0/go.mod h1:uzpGWE/qehT8L426YuXwpMQub+a63vIINhIeEI9mnSM=
github.com/influxdata/flux v0.40.2-0.20190823211512-ec418d051ff0 h1:mLoY05dhJ5ZsEMuhtlgWt64QH0sBs7WSYSj6wkfiL0k=
github.com/influxdata/flux v0.40.2-0.20190823211512-ec418d051ff0/go.mod h1:QvF9P06HFgYKD28Z556rFLJ0D0bvtcgEtkFALteZ4Lo=
github.com/influxdata/flux v0.40.2-0.20190826193022-fc11285bfb27 h1:mjKMrgn7Ud4xc2LS5RH+6opaDubrhFUJuHxHMJossCo=
github.com/influxdata/flux v0.40.2-0.20190826193022-fc11285bfb27/go.mod h1:QvF9P06HFgYKD28Z556rFLJ0D0bvtcgEtkFALteZ4Lo=
github.com/influxdata/goreleaser v0.97.0-influx h1:jT5OrcW7WfS0e2QxfwmTBjhLvpIC9CDLRhNgZJyhj8s=
github.com/influxdata/goreleaser v0.97.0-influx/go.mod h1:MnjA0e0Uq6ISqjG1WxxMAl+3VS1QYjILSWVnMYDxasE=
github.com/influxdata/influxql v0.0.0-20180925231337-1cbfca8e56b6 h1:CFx+pP90q/qg3spoiZjf8donE4WpAdjeJfPOcoNqkWo=

View File

@ -1,8 +1,6 @@
package readservice
import (
"net/http"
"github.com/influxdata/flux/dependencies"
platform "github.com/influxdata/influxdb"
"github.com/influxdata/influxdb/query"
@ -29,7 +27,9 @@ func AddControllerConfigDependencies(
orgSvc platform.OrganizationService,
ss platform.SecretService,
) error {
cc.ExecutorDependencies[dependencies.InterpreterDepsKey] = dependencies.NewDependenciesInterface(http.DefaultClient, query.FromSecretService(ss))
deps := dependencies.NewDefaults()
deps.Deps.SecretService = query.FromSecretService(ss)
cc.ExecutorDependencies[dependencies.InterpreterDepsKey] = deps
bucketLookupSvc := query.FromBucketService(bucketSvc)
orgLookupSvc := query.FromOrganizationService(orgSvc)

View File

@ -203,7 +203,7 @@ func FromScript(script string) (Options, error) {
return opt, err
}
durTypes := grabTaskOptionAST(fluxAST, optEvery, optOffset)
ctx, deps := context.Background(), dependencies.NewDefaultDependencies()
ctx, deps := context.Background(), dependencies.NewEmpty()
_, scope, err := flux.EvalAST(ctx, deps, fluxAST)
if err != nil {
return opt, err