From dfc28335ea48bb7b23eab2565f7a9816657a887f Mon Sep 17 00:00:00 2001 From: Nathaniel Cook Date: Mon, 26 Aug 2019 12:35:26 -0600 Subject: [PATCH] refactor(query/dependencies): update to new Flux dependencies defaults --- cmd/influx/repl.go | 2 +- go.mod | 2 +- go.sum | 4 ++-- storage/readservice/service.go | 6 +++--- task/options/options.go | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cmd/influx/repl.go b/cmd/influx/repl.go index 6fa1c06d54..d01d4306c8 100644 --- a/cmd/influx/repl.go +++ b/cmd/influx/repl.go @@ -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 } diff --git a/go.mod b/go.mod index 9abb903943..cda9ba8422 100644 --- a/go.mod +++ b/go.mod @@ -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 diff --git a/go.sum b/go.sum index bd374d9ea6..67f7c1e402 100644 --- a/go.sum +++ b/go.sum @@ -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= diff --git a/storage/readservice/service.go b/storage/readservice/service.go index 4342dea472..34c84449af 100644 --- a/storage/readservice/service.go +++ b/storage/readservice/service.go @@ -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) diff --git a/task/options/options.go b/task/options/options.go index c5dadcd93e..3cbdf69d91 100644 --- a/task/options/options.go +++ b/task/options/options.go @@ -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