Skip to content
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

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

Merged
merged 2 commits into from
Jul 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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