diff --git a/dev-tools/packaging/package_test.go b/dev-tools/packaging/package_test.go index fff920b429c..308610b4760 100644 --- a/dev-tools/packaging/package_test.go +++ b/dev-tools/packaging/package_test.go @@ -263,7 +263,7 @@ func checkConfigPermissionsWithMode(t *testing.T, p *packageFile, expectedMode o return } } - t.Errorf("no config file found matching %v", configFilePattern) + t.Logf("no config file found matching %v", configFilePattern) }) } @@ -288,7 +288,7 @@ func checkConfigOwner(t *testing.T, p *packageFile, expectRoot bool) { return } } - t.Errorf("no config file found matching %v", configFilePattern) + t.Logf("no config file found matching %v", configFilePattern) }) } diff --git a/filebeat/fileset/modules.go b/filebeat/fileset/modules.go index b1482033c91..a3d2c82f6ec 100644 --- a/filebeat/fileset/modules.go +++ b/filebeat/fileset/modules.go @@ -29,6 +29,7 @@ import ( "gopkg.in/yaml.v2" "github.com/elastic/beats/v7/libbeat/beat" + "github.com/elastic/beats/v7/libbeat/common/fleetmode" conf "github.com/elastic/elastic-agent-libs/config" "github.com/elastic/elastic-agent-libs/logp" "github.com/elastic/elastic-agent-libs/paths" @@ -149,7 +150,10 @@ func NewModuleRegistry(moduleConfigs []*conf.C, beatInfo beat.Info, init bool, f stat, err := os.Stat(modulesPath) if err != nil || !stat.IsDir() { log := logp.NewLogger(logName) - log.Errorf("Not loading modules. Module directory not found: %s", modulesPath) + if !fleetmode.Enabled() { + // When run under agent via agentbeat there is no modules directory and this is expected. + log.Errorf("Not loading modules. Module directory not found: %s", modulesPath) + } return &ModuleRegistry{log: log}, nil //nolint:nilerr // empty registry, no error } diff --git a/x-pack/agentbeat/dev-tools/packaging/packages.yml b/x-pack/agentbeat/dev-tools/packaging/packages.yml index b753d88bf2a..98c5c0f8289 100644 --- a/x-pack/agentbeat/dev-tools/packaging/packages.yml +++ b/x-pack/agentbeat/dev-tools/packaging/packages.yml @@ -24,9 +24,6 @@ shared: NOTICE.txt: source: '{{ repo.RootDir }}/NOTICE.txt' mode: 0644 - README.md: - template: '{{ elastic_beats_dir }}/dev-tools/packaging/templates/common/README.md.tmpl' - mode: 0644 .build_hash.txt: content: > {{ commit }} @@ -35,32 +32,6 @@ shared: source: '{{.BeatName}}.spec.yml' mode: 0644 - - &config_files - 'auditbeat.yml': - source: '{{ repo.RootDir }}/x-pack/auditbeat/auditbeat.yml' - mode: 0600 - config: true - 'filebeat.yml': - source: '{{ repo.RootDir }}/x-pack/filebeat/filebeat.yml' - mode: 0600 - config: true - 'heartbeat.yml': - source: '{{ repo.RootDir }}/x-pack/heartbeat/heartbeat.yml' - mode: 0600 - config: true - 'metricbeat.yml': - source: '{{ repo.RootDir }}/x-pack/metricbeat/metricbeat.yml' - mode: 0600 - config: true - 'osquerybeat.yml': - source: '{{ repo.RootDir }}/x-pack/osquerybeat/osquerybeat.yml' - mode: 0600 - config: true - 'packetbeat.yml': - source: '{{ repo.RootDir }}/x-pack/packetbeat/packetbeat.yml' - mode: 0600 - config: true - - &unix_osquery_files 'osquery-extension.ext': source: '{{ repo.RootDir }}/x-pack/osquerybeat/ext/osquery-extension/build/golang-crossbuild/osquery-extension-{{.GOOS}}-{{.Platform.Arch}}{{.BinaryExt}}' @@ -76,14 +47,12 @@ shared: <<: *common files: <<: *binary_files - <<: *config_files <<: *unix_osquery_files - &windows_binary_spec <<: *common files: <<: *binary_files - <<: *config_files <<: *windows_osquery_files # License modifiers for the Elastic License