From c9ebe13961da31c5d731824b27901a44ec2055f5 Mon Sep 17 00:00:00 2001 From: Blake Rouse Date: Thu, 9 Jul 2020 10:17:29 -0400 Subject: [PATCH] Remove the downloadConfig and retryConfig from plugin/process.Application and plugin/service.Application. (#19603) * Remove the downloadConfig and retryConfig from plugin/process.Application and plugin/service.Application. * Run mage fmt. (cherry picked from commit fb53a8a04bd812e01e2471fb15bb64f63e70412b) --- .../pkg/core/plugin/process/app.go | 36 ++++++++---------- .../pkg/core/plugin/service/app.go | 38 ++++++++----------- 2 files changed, 31 insertions(+), 43 deletions(-) diff --git a/x-pack/elastic-agent/pkg/core/plugin/process/app.go b/x-pack/elastic-agent/pkg/core/plugin/process/app.go index cc6c4c83895..cdd90b3a190 100644 --- a/x-pack/elastic-agent/pkg/core/plugin/process/app.go +++ b/x-pack/elastic-agent/pkg/core/plugin/process/app.go @@ -15,12 +15,10 @@ import ( "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors" "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/operation/config" - "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/artifact" "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/app" "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/logger" "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/monitoring" "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/process" - "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/retry" "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/server" "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/state" "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/tokenbucket" @@ -52,9 +50,7 @@ type Application struct { monitor monitoring.Monitor - processConfig *process.Config - downloadConfig *artifact.Config - retryConfig *retry.Config + processConfig *process.Config logger *logger.Logger @@ -84,22 +80,20 @@ func NewApplication( b, _ := tokenbucket.NewTokenBucket(ctx, 3, 3, 1*time.Second) return &Application{ - bgContext: ctx, - id: id, - name: appName, - pipelineID: pipelineID, - logLevel: logLevel, - spec: spec, - srv: srv, - processConfig: cfg.ProcessConfig, - downloadConfig: cfg.DownloadConfig, - retryConfig: cfg.RetryConfig, - logger: logger, - limiter: b, - reporter: reporter, - monitor: monitor, - uid: uid, - gid: gid, + bgContext: ctx, + id: id, + name: appName, + pipelineID: pipelineID, + logLevel: logLevel, + spec: spec, + srv: srv, + processConfig: cfg.ProcessConfig, + logger: logger, + limiter: b, + reporter: reporter, + monitor: monitor, + uid: uid, + gid: gid, }, nil } diff --git a/x-pack/elastic-agent/pkg/core/plugin/service/app.go b/x-pack/elastic-agent/pkg/core/plugin/service/app.go index 3c8a42a0db8..0832312053a 100644 --- a/x-pack/elastic-agent/pkg/core/plugin/service/app.go +++ b/x-pack/elastic-agent/pkg/core/plugin/service/app.go @@ -18,12 +18,10 @@ import ( "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/errors" "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/operation/config" - "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/artifact" "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/app" "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/logger" "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/monitoring" "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/process" - "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/retry" "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/server" "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/state" "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/tokenbucket" @@ -55,9 +53,7 @@ type Application struct { monitor monitoring.Monitor - processConfig *process.Config - downloadConfig *artifact.Config - retryConfig *retry.Config + processConfig *process.Config logger *logger.Logger @@ -88,23 +84,21 @@ func NewApplication( b, _ := tokenbucket.NewTokenBucket(ctx, 3, 3, 1*time.Second) return &Application{ - bgContext: ctx, - id: id, - name: appName, - pipelineID: pipelineID, - logLevel: logLevel, - spec: spec, - srv: srv, - processConfig: cfg.ProcessConfig, - downloadConfig: cfg.DownloadConfig, - retryConfig: cfg.RetryConfig, - logger: logger, - limiter: b, - reporter: reporter, - monitor: monitor, - uid: uid, - gid: gid, - credsPort: credsPort, + bgContext: ctx, + id: id, + name: appName, + pipelineID: pipelineID, + logLevel: logLevel, + spec: spec, + srv: srv, + processConfig: cfg.ProcessConfig, + logger: logger, + limiter: b, + reporter: reporter, + monitor: monitor, + uid: uid, + gid: gid, + credsPort: credsPort, }, nil }