Skip to content

Commit

Permalink
Fix functionbeat
Browse files Browse the repository at this point in the history
  • Loading branch information
kvch committed Oct 26, 2020
1 parent 65df4e1 commit 6d38569
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libbeat/cfgfile/cfgfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,10 @@ func LoadList(file string) ([]*common.Config, error) {
return c, nil
}

func SetConfigPath(path string) {
*configPath = path
}

// GetPathConfig returns ${path.config}. If ${path.config} is not set, ${path.home} is returned.
func GetPathConfig() string {
if *configPath != "" {
Expand Down
1 change: 1 addition & 0 deletions x-pack/functionbeat/provider/gcp/pubsub/pubsub.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ func RunPubSub(ctx context.Context, m gpubsub.Message) error {
ConfigOverrides: config.FunctionOverrides,
}

cfgfile.SetConfigPath("/srv/src/pubsub")
cfgfile.ChangeDefaultCfgfileFlag(settings.Name)

return instance.Run(settings, initFunctionbeat(ctx, m))
Expand Down
1 change: 1 addition & 0 deletions x-pack/functionbeat/provider/gcp/storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ func RunCloudStorage(ctx context.Context, e gcp.StorageEvent) error {
ConfigOverrides: config.FunctionOverrides,
}

cfgfile.SetConfigPath("/srv/src/storage")
cfgfile.ChangeDefaultCfgfileFlag(settings.Name)

return instance.Run(settings, initFunctionbeat(ctx, e))
Expand Down
3 changes: 3 additions & 0 deletions x-pack/functionbeat/scripts/mage/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ func (Update) VendorBeats() error {
Exclude: []string{
".*_test.go$",
".*.yml",
// XXX GCP function metadata lib must be removed to avoid build failures
// GH issue: https://github.com/googleapis/google-cloud-go/issues/1947
".*cloud.google.com/go.*/functions/metadata.*",
},
}
err = cp.Execute()
Expand Down

0 comments on commit 6d38569

Please sign in to comment.