Skip to content

Commit

Permalink
Remove the downloadConfig and retryConfig from plugin/process.Applica…
Browse files Browse the repository at this point in the history
…tion and plugin/service.Application. (#19603)

* Remove the downloadConfig and retryConfig from plugin/process.Application and plugin/service.Application.

* Run mage fmt.
  • Loading branch information
blakerouse committed Jul 9, 2020
1 parent 7580c72 commit fb53a8a
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 43 deletions.
36 changes: 15 additions & 21 deletions x-pack/elastic-agent/pkg/core/plugin/process/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
}

Expand Down
38 changes: 16 additions & 22 deletions x-pack/elastic-agent/pkg/core/plugin/service/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit fb53a8a

Please sign in to comment.