Skip to content

Commit

Permalink
Merge remote-tracking branch 'elastic/8.3' into mergify/bp/8.3/pr-32421
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewkroh committed Jul 25, 2022
2 parents 4d218a6 + 877d7b3 commit 82d856a
Show file tree
Hide file tree
Showing 93 changed files with 2,338 additions and 445 deletions.
1 change: 1 addition & 0 deletions .ci/packaging.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@ def release(type){
dockerLogin(secret: "${DOCKERELASTIC_SECRET}", registry: "${DOCKER_REGISTRY}")
dir("${env.BEATS_FOLDER}") {
sh(label: "mage package ${type} ${env.BEATS_FOLDER} ${env.PLATFORMS}", script: 'mage package')
sh(label: "mage ironbank ${type} ${env.BEATS_FOLDER} ${env.PLATFORMS}", script: 'mage ironbank')
def folder = getBeatsName(env.BEATS_FOLDER)
uploadPackagesToGoogleBucket(
credentialsId: env.JOB_GCS_EXT_CREDENTIALS,
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/macos-auditbeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,12 @@ jobs:
run: cd ${{ env.BEAT_MODULE }} && mage build
- name: Run test
run: cd ${{ env.BEAT_MODULE }} && mage unitTest
- uses: v1v/otel-upload-test-artifact-action@v2
if: always()
continue-on-error: true
with:
jobName: "macos"
stepName: "Run test"
path: "${{ env.BEAT_MODULE }}/build/TEST*.xml"
type: "junit"
githubToken: ${{ secrets.GITHUB_TOKEN }}
9 changes: 9 additions & 0 deletions .github/workflows/macos-filebeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,12 @@ jobs:
run: cd ${{ env.BEAT_MODULE }} && mage build
- name: Run test
run: cd ${{ env.BEAT_MODULE }} && mage unitTest
- uses: v1v/otel-upload-test-artifact-action@v2
if: always()
continue-on-error: true
with:
jobName: "macos"
stepName: "Run test"
path: "${{ env.BEAT_MODULE }}/build/TEST*.xml"
type: "junit"
githubToken: ${{ secrets.GITHUB_TOKEN }}
9 changes: 9 additions & 0 deletions .github/workflows/macos-heartbeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,12 @@ jobs:
run: cd ${{ env.BEAT_MODULE }} && mage build
- name: Run test
run: cd ${{ env.BEAT_MODULE }} && mage unitTest
- uses: v1v/otel-upload-test-artifact-action@v2
if: always()
continue-on-error: true
with:
jobName: "macos"
stepName: "Run test"
path: "${{ env.BEAT_MODULE }}/build/TEST*.xml"
type: "junit"
githubToken: ${{ secrets.GITHUB_TOKEN }}
9 changes: 9 additions & 0 deletions .github/workflows/macos-metricbeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,12 @@ jobs:
run: cd ${{ env.BEAT_MODULE }} && mage build
- name: Run test
run: cd ${{ env.BEAT_MODULE }} && echo "See https://github.com/elastic/beats/issues/29038"
- uses: v1v/otel-upload-test-artifact-action@v2
if: always()
continue-on-error: true
with:
jobName: "macos"
stepName: "Run test"
path: "${{ env.BEAT_MODULE }}/build/TEST*.xml"
type: "junit"
githubToken: ${{ secrets.GITHUB_TOKEN }}
9 changes: 9 additions & 0 deletions .github/workflows/macos-packetbeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,12 @@ jobs:
run: cd ${{ env.BEAT_MODULE }} && mage build
- name: Run test
run: cd ${{ env.BEAT_MODULE }} && mage unitTest
- uses: v1v/otel-upload-test-artifact-action@v2
if: always()
continue-on-error: true
with:
jobName: "macos"
stepName: "Run test"
path: "${{ env.BEAT_MODULE }}/build/TEST*.xml"
type: "junit"
githubToken: ${{ secrets.GITHUB_TOKEN }}
9 changes: 9 additions & 0 deletions .github/workflows/macos-xpack-auditbeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,12 @@ jobs:
run: cd ${{ env.BEAT_MODULE }} && mage build
- name: Run test
run: cd ${{ env.BEAT_MODULE }} && mage unitTest
- uses: v1v/otel-upload-test-artifact-action@v2
if: always()
continue-on-error: true
with:
jobName: "macos"
stepName: "Run test"
path: "${{ env.BEAT_MODULE }}/build/TEST*.xml"
type: "junit"
githubToken: ${{ secrets.GITHUB_TOKEN }}
9 changes: 9 additions & 0 deletions .github/workflows/macos-xpack-filebeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,12 @@ jobs:
run: cd ${{ env.BEAT_MODULE }} && mage build
- name: Run test
run: cd ${{ env.BEAT_MODULE }} && mage unitTest
- uses: v1v/otel-upload-test-artifact-action@v2
if: always()
continue-on-error: true
with:
jobName: "macos"
stepName: "Run test"
path: "${{ env.BEAT_MODULE }}/build/TEST*.xml"
type: "junit"
githubToken: ${{ secrets.GITHUB_TOKEN }}
9 changes: 9 additions & 0 deletions .github/workflows/macos-xpack-functionbeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,12 @@ jobs:
run: cd ${{ env.BEAT_MODULE }} && mage build
- name: Run test
run: cd ${{ env.BEAT_MODULE }} && mage unitTest
- uses: v1v/otel-upload-test-artifact-action@v2
if: always()
continue-on-error: true
with:
jobName: "macos"
stepName: "Run test"
path: "${{ env.BEAT_MODULE }}/build/TEST*.xml"
type: "junit"
githubToken: ${{ secrets.GITHUB_TOKEN }}
9 changes: 9 additions & 0 deletions .github/workflows/macos-xpack-heartbeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,12 @@ jobs:
run: cd ${{ env.BEAT_MODULE }} && mage build
- name: Run test
run: cd ${{ env.BEAT_MODULE }} && mage unitTest
- uses: v1v/otel-upload-test-artifact-action@v2
if: always()
continue-on-error: true
with:
jobName: "macos"
stepName: "Run test"
path: "${{ env.BEAT_MODULE }}/build/TEST*.xml"
type: "junit"
githubToken: ${{ secrets.GITHUB_TOKEN }}
9 changes: 9 additions & 0 deletions .github/workflows/macos-xpack-metricbeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,12 @@ jobs:
run: cd ${{ env.BEAT_MODULE }} && mage build
- name: Run test
run: cd ${{ env.BEAT_MODULE }} && mage unitTest
- uses: v1v/otel-upload-test-artifact-action@v2
if: always()
continue-on-error: true
with:
jobName: "macos"
stepName: "Run test"
path: "${{ env.BEAT_MODULE }}/build/TEST*.xml"
type: "junit"
githubToken: ${{ secrets.GITHUB_TOKEN }}
9 changes: 9 additions & 0 deletions .github/workflows/macos-xpack-osquerybeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,12 @@ jobs:
run: cd ${{ env.BEAT_MODULE }} && mage build
- name: Run test
run: cd ${{ env.BEAT_MODULE }} && mage unitTest
- uses: v1v/otel-upload-test-artifact-action@v2
if: always()
continue-on-error: true
with:
jobName: "macos"
stepName: "Run test"
path: "${{ env.BEAT_MODULE }}/build/TEST*.xml"
type: "junit"
githubToken: ${{ secrets.GITHUB_TOKEN }}
9 changes: 9 additions & 0 deletions .github/workflows/macos-xpack-packetbeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,12 @@ jobs:
run: cd ${{ env.BEAT_MODULE }} && mage build
- name: Run test
run: cd ${{ env.BEAT_MODULE }} && mage unitTest
- uses: v1v/otel-upload-test-artifact-action@v2
if: always()
continue-on-error: true
with:
jobName: "macos"
stepName: "Run test"
path: "${{ env.BEAT_MODULE }}/build/TEST*.xml"
type: "junit"
githubToken: ${{ secrets.GITHUB_TOKEN }}
5 changes: 3 additions & 2 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,13 @@ https://github.com/elastic/beats/compare/v8.2.0\...main[Check the HEAD diff]

- Fix OS name reported by add_host_metadata on Windows 11. {issue}30833[30833] {pull}32259[32259]
- Fix race condition when reloading runners {pull}32309[32309]
- Fix race condition when stopping runners {pull}32433[32433]

*Auditbeat*

- auditd module: Fix parsing of audit rules where arguments are quoted (like file paths containing spaces). {pull}32421[32421]
- auditd module: Fix minimum AuditStatus length so that library can support kernels from 2.6.32. {pull}32421[32421]

- system/socket: Reduce memory usage of the dataset. {issue}32191[32191] {pull}32192[32192]

*Filebeat*

Expand All @@ -60,6 +61,7 @@ https://github.com/elastic/beats/compare/v8.2.0\...main[Check the HEAD diff]
*Metricbeat*

- update elasticsearch node_stats metricset to use keyword for cgroup memory instead of long {pull}32197[32197]
- Fix to ARN parsing for Cloudwatch resource names with leading slashes {pull}32446[32446]

*Packetbeat*

Expand All @@ -82,7 +84,6 @@ https://github.com/elastic/beats/compare/v8.2.0\...main[Check the HEAD diff]

*Auditbeat*


*Filebeat*


Expand Down
7 changes: 6 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -204,13 +204,18 @@ VERSION=${env.VERSION}-SNAPSHOT""")
notifyBuildResult(prComment: true,
slackComment: true,
analyzeFlakey: !isTag(), jobName: getFlakyJobName(withBranch: getFlakyBranch()),
githubIssue: isBranch() && currentBuild.currentResult != "SUCCESS",
githubIssue: isGitHubIssueEnabled(),
githubLabels: 'Team:Elastic-Agent-Data-Plane')
}
}
}
}

// When to create a GiHub issue
def isGitHubIssueEnabled() {
return isBranch() && currentBuild.currentResult != "SUCCESS" && currentBuild.currentResult != "ABORTED"
}

def runChecks() {
def mapParallelTasks = [:]
def content = readYaml(file: 'Jenkinsfile.yml')
Expand Down
4 changes: 2 additions & 2 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6492,11 +6492,11 @@ Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-agent-l

--------------------------------------------------------------------------------
Dependency : github.com/elastic/elastic-agent-system-metrics
Version: v0.4.3
Version: v0.4.2
Licence type (autodetected): Apache-2.0
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/github.com/elastic/[email protected].3/LICENSE.txt:
Contents of probable licence file $GOMODCACHE/github.com/elastic/[email protected].2/LICENSE.txt:

Apache License
Version 2.0, January 2004
Expand Down
3 changes: 0 additions & 3 deletions auditbeat/auditbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -747,9 +747,6 @@ output.elasticsearch:
# Strategy for fetching the topics metadata from the broker. Default is false.
#full: false

# The number of concurrent load-balanced Kafka output workers.
#worker: 1

# The number of times to retry publishing an event after a publishing failure.
# After the specified number of retries, events are typically dropped.
# Some Beats, such as Filebeat, ignore the max_retries setting and retry until
Expand Down
8 changes: 8 additions & 0 deletions auditbeat/magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,14 @@ func Package() {
mg.SerialDeps(devtools.Package, TestPackages)
}

// Package packages the Beat for IronBank distribution.
//
// Use SNAPSHOT=true to build snapshots.
func Ironbank() error {
fmt.Println(">> Ironbank: this module is not subscribed to the IronBank releases.")
return nil
}

// TestPackages tests the generated packages (i.e. file modes, owners, groups).
func TestPackages() error {
return devtools.TestPackages()
Expand Down
2 changes: 1 addition & 1 deletion deploy/kubernetes/auditbeat-kubernetes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ spec:
dnsPolicy: ClusterFirstWithHostNet
containers:
- name: auditbeat
image: docker.elastic.co/beats/auditbeat:8.3.2
image: docker.elastic.co/beats/auditbeat:8.3.3
args: [
"-c", "/etc/auditbeat.yml",
"-e",
Expand Down
2 changes: 1 addition & 1 deletion deploy/kubernetes/filebeat-kubernetes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ spec:
dnsPolicy: ClusterFirstWithHostNet
containers:
- name: filebeat
image: docker.elastic.co/beats/filebeat:8.3.2
image: docker.elastic.co/beats/filebeat:8.3.3
args: [
"-c", "/etc/filebeat.yml",
"-e",
Expand Down
2 changes: 1 addition & 1 deletion deploy/kubernetes/heartbeat-kubernetes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ spec:
dnsPolicy: ClusterFirstWithHostNet
containers:
- name: heartbeat
image: docker.elastic.co/beats/heartbeat:8.3.2
image: docker.elastic.co/beats/heartbeat:8.3.3
args: [
"-c", "/etc/heartbeat.yml",
"-e",
Expand Down
2 changes: 1 addition & 1 deletion deploy/kubernetes/metricbeat-kubernetes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ spec:
dnsPolicy: ClusterFirstWithHostNet
containers:
- name: metricbeat
image: docker.elastic.co/beats/metricbeat:8.3.2
image: docker.elastic.co/beats/metricbeat:8.3.3
args: [
"-c", "/etc/metricbeat.yml",
"-e",
Expand Down
19 changes: 17 additions & 2 deletions dev-tools/mage/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,9 @@ func unzip(sourceFile, destinationDir string) error {
return nil
}

// Tar compress a directory using tar + gzip algorithms
func Tar(src string, targetFile string) error {
// Tar compress a directory using tar + gzip algorithms but without adding
// the directory
func TarWithOptions(src string, targetFile string, trimSource bool) error {
fmt.Printf(">> creating TAR file from directory: %s, target: %s\n", src, targetFile)

f, err := os.Create(targetFile)
Expand Down Expand Up @@ -409,6 +410,15 @@ func Tar(src string, targetFile string) error {
// must provide real name
// (see https://golang.org/src/archive/tar/common.go?#L626)
header.Name = filepath.ToSlash(file)
// Replace the source folder in the files to be compressed
if trimSource {
header.Name = strings.ReplaceAll(filepath.ToSlash(file), filepath.ToSlash(src), "")
header.Name = strings.TrimPrefix(header.Name, "/")
if header.Name == "" {
fmt.Print(">> skipping root directory\n")
return nil
}
}

// write header
if err := tw.WriteHeader(header); err != nil {
Expand Down Expand Up @@ -441,6 +451,11 @@ func Tar(src string, targetFile string) error {
return nil
}

// Tar compress a directory using tar + gzip algorithms
func Tar(src string, targetFile string) error {
return TarWithOptions(src, targetFile, false)
}

func untar(sourceFile, destinationDir string) error {
file, err := os.Open(sourceFile)
if err != nil {
Expand Down
10 changes: 10 additions & 0 deletions dev-tools/mage/copy.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@ func Copy(src, dest string) error {
return copy.Execute()
}

// Copy copies a file and preserves the permissions.
func CopyFile(src, dest string) error {
copy := &CopyTask{Source: src, Dest: dest}
info, err := os.Stat(src)
if err != nil {
return errors.Wrapf(err, "copy failed: cannot stat source file %v", src)
}
return copy.fileCopy(src, dest, info)
}

// CopyTask copies a file or directory (recursively) and preserves the permissions.
type CopyTask struct {
Source string // Source directory or file.
Expand Down
Loading

0 comments on commit 82d856a

Please sign in to comment.