Skip to content

Commit ea84fc9

Browse files
Merge branch 'main' into dependabot/go_modules/github.com/elastic/go-elasticsearch/v8-8.11.0
2 parents 0a4ef9e + c588a73 commit ea84fc9

File tree

103 files changed

+2636
-1309
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+2636
-1309
lines changed

.buildkite/pipeline.yml

+1
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ steps:
191191
matrix:
192192
setup:
193193
k8s_version:
194+
- "1.29.0"
194195
- "1.28.0"
195196
- "1.27.3"
196197
- "1.26.6"

.github/ISSUE_TEMPLATE/flaky-test.md .github/ISSUE_TEMPLATE/flaky-test.yml

+9-11
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
---
21
name: "Flaky Test"
3-
about: "Report a flaky test (one that doesn't pass consistently)"
2+
description: "Report a flaky test (one that doesn't pass consistently)"
43
title: "[Flaky Test]: <test_case> – <short_error_message>"
54
labels: ["Team:Elastic-Agent", "flaky-test"]
6-
projects: ["elastic/1457"]
5+
projects: ["elastic/979", "elastic/1457"]
76
body:
87
- type: markdown
98
attributes:
@@ -37,19 +36,18 @@ body:
3736
attributes:
3837
label: OS
3938
description: "On which OS the test is failing"
40-
multiple: true
41-
options:
42-
- Linux
43-
- Mac
44-
- Windows
45-
default: 0
39+
multiple: true
40+
options:
41+
- Linux
42+
- Mac
43+
- Windows
44+
default: 0
4645
validations:
4746
required: true
4847
- type: textarea
4948
attributes:
5049
label: "Stacktrace and notes"
5150
description: "Detailed output of the test failure and your notes about possible cause."
52-
render: markdown
51+
render: markdown
5352
validations:
5453
required: true
55-
---

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,4 @@ fleet.yml.lock
5858
fleet.yml.old
5959
pkg/component/fake/component/component
6060
pkg/component/fake/shipper/shipper
61+
internal/pkg/agent/install/testblocking/testblocking

NOTICE.txt

+956-370
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Kind can be one of:
2+
# - breaking-change: a change to previously-documented behavior
3+
# - deprecation: functionality that is being removed in a later release
4+
# - bug-fix: fixes a problem in a previous version
5+
# - enhancement: extends functionality but does not break or fix existing behavior
6+
# - feature: new functionality
7+
# - known-issue: problems that we are aware of in a given version
8+
# - security: impacts on the security of a product or a user’s deployment.
9+
# - upgrade: important information for someone upgrading from a prior version
10+
# - other: does not fit into any of the other categories
11+
kind: bug-fix
12+
13+
# Change summary; a 80ish characters long description of the change.
14+
summary: Fix component control protocol to allow checkin to be chunked across multiple messages
15+
16+
# Long description; in case the summary is not enough to describe the change
17+
# this field accommodate a description without length limits.
18+
# NOTE: This field will be rendered only for breaking-change and known-issue kinds at the moment.
19+
#description:
20+
21+
# Affected component; usually one of "elastic-agent", "fleet-server", "filebeat", "metricbeat", "auditbeat", "all", etc.
22+
component:
23+
24+
# PR URL; optional; the PR number that added the changeset.
25+
# If not present is automatically filled by the tooling finding the PR where this changelog fragment has been added.
26+
# NOTE: the tooling supports backports, so it's able to fill the original PR number instead of the backport PR number.
27+
# Please provide it if you are adding a fragment for a different PR.
28+
pr: https://github.com/elastic/elastic-agent/pull/3884
29+
30+
# Issue URL; optional; the GitHub issue related to this changeset (either closes or is part of).
31+
# If not present is automatically filled by the tooling with the issue linked to the PR number.
32+
issue: https://github.com/elastic/elastic-agent/issues/2460
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Kind can be one of:
2+
# - breaking-change: a change to previously-documented behavior
3+
# - deprecation: functionality that is being removed in a later release
4+
# - bug-fix: fixes a problem in a previous version
5+
# - enhancement: extends functionality but does not break or fix existing behavior
6+
# - feature: new functionality
7+
# - known-issue: problems that we are aware of in a given version
8+
# - security: impacts on the security of a product or a user’s deployment.
9+
# - upgrade: important information for someone upgrading from a prior version
10+
# - other: does not fit into any of the other categories
11+
kind: feature
12+
13+
# Change summary; a 80ish characters long description of the change.
14+
summary: Add mTLS flags to install/enroll
15+
16+
# Long description; in case the summary is not enough to describe the change
17+
# this field accommodate a description without length limits.
18+
# NOTE: This field will be rendered only for breaking-change and known-issue kinds at the moment.
19+
description: |
20+
Add mTLS flags to the install/enroll commands to allow fleet-server to
21+
use client certs when connecting to Elasticsearch, and to allow
22+
elastic-agent to use client certs when connecting to fleet-server.
23+
Fleet-server will use the CAs passed in `--certificate-authorities` to
24+
validate any client certs. Agent client certs do not influence auth in
25+
fleet-server, an enrollment token, or API key is still required.
26+
27+
# Affected component; a word indicating the component this changeset affects.
28+
component:
29+
30+
# PR URL; optional; the PR number that added the changeset.
31+
# If not present is automatically filled by the tooling finding the PR where this changelog fragment has been added.
32+
# NOTE: the tooling supports backports, so it's able to fill the original PR number instead of the backport PR number.
33+
# Please provide it if you are adding a fragment for a different PR.
34+
#pr: https://github.com/owner/repo/1234
35+
36+
# Issue URL; optional; the GitHub issue related to this changeset (either closes or is part of).
37+
# If not present is automatically filled by the tooling with the issue linked to the PR number.
38+
#issue: https://github.com/owner/repo/1234
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Kind can be one of:
2+
# - breaking-change: a change to previously-documented behavior
3+
# - deprecation: functionality that is being removed in a later release
4+
# - bug-fix: fixes a problem in a previous version
5+
# - enhancement: extends functionality but does not break or fix existing behavior
6+
# - feature: new functionality
7+
# - known-issue: problems that we are aware of in a given version
8+
# - security: impacts on the security of a product or a user’s deployment.
9+
# - upgrade: important information for someone upgrading from a prior version
10+
# - other: does not fit into any of the other categories
11+
kind: enhancement
12+
13+
# Change summary; a 80ish characters long description of the change.
14+
summary: add error descriptors to inspect command, config methods
15+
16+
# Long description; in case the summary is not enough to describe the change
17+
# this field accommodate a description without length limits.
18+
# NOTE: This field will be rendered only for breaking-change and known-issue kinds at the moment.
19+
#description:
20+
21+
# Affected component; usually one of "elastic-agent", "fleet-server", "filebeat", "metricbeat", "auditbeat", "all", etc.
22+
component: config
23+
24+
# PR URL; optional; the PR number that added the changeset.
25+
# If not present is automatically filled by the tooling finding the PR where this changelog fragment has been added.
26+
# NOTE: the tooling supports backports, so it's able to fill the original PR number instead of the backport PR number.
27+
# Please provide it if you are adding a fragment for a different PR.
28+
#pr: https://github.com/owner/repo/1234
29+
30+
# Issue URL; optional; the GitHub issue related to this changeset (either closes or is part of).
31+
# If not present is automatically filled by the tooling with the issue linked to the PR number.
32+
#issue: https://github.com/owner/repo/1234
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Kind can be one of:
2+
# - breaking-change: a change to previously-documented behavior
3+
# - deprecation: functionality that is being removed in a later release
4+
# - bug-fix: fixes a problem in a previous version
5+
# - enhancement: extends functionality but does not break or fix existing behavior
6+
# - feature: new functionality
7+
# - known-issue: problems that we are aware of in a given version
8+
# - security: impacts on the security of a product or a user’s deployment.
9+
# - upgrade: important information for someone upgrading from a prior version
10+
# - other: does not fit into any of the other categories
11+
kind: feature
12+
13+
# Change summary; a 80ish characters long description of the change.
14+
summary: fix creation of directories when unpacking tar.gz packages
15+
16+
# Long description; in case the summary is not enough to describe the change
17+
# this field accommodate a description without length limits.
18+
# NOTE: This field will be rendered only for breaking-change and known-issue kinds at the moment.
19+
#description:
20+
21+
# Affected component; a word indicating the component this changeset affects.
22+
component: elastic-agent
23+
24+
# PR URL; optional; the PR number that added the changeset.
25+
# If not present is automatically filled by the tooling finding the PR where this changelog fragment has been added.
26+
# NOTE: the tooling supports backports, so it's able to fill the original PR number instead of the backport PR number.
27+
# Please provide it if you are adding a fragment for a different PR.
28+
#pr: https://github.com/owner/repo/1234
29+
30+
# Issue URL; optional; the GitHub issue related to this changeset (either closes or is part of).
31+
# If not present is automatically filled by the tooling with the issue linked to the PR number.
32+
#issue: https://github.com/owner/repo/1234

control_v2.proto

+1-2
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,7 @@ message ComponentUnitState {
133133
message ComponentVersionInfo {
134134
// Name of the component.
135135
string name = 1;
136-
// Version of the component.
137-
string version = 2;
136+
// 2 reserved - used to be used for version of component.
138137
// Extra meta information about the version.
139138
map<string, string> meta = 3;
140139
}

dev-tools/cmd/buildfleetcfg/buildfleetcfg.go

+1-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dev-tools/licenses/license_generate.go

+3-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dev-tools/mage/common.go

+4-5
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import (
1919
"errors"
2020
"fmt"
2121
"io"
22-
"io/ioutil"
2322
"log"
2423
"net/http"
2524
"os"
@@ -118,7 +117,7 @@ func joinMaps(args ...map[string]interface{}) map[string]interface{} {
118117
}
119118

120119
func expandFile(src, dst string, args ...map[string]interface{}) error {
121-
tmplData, err := ioutil.ReadFile(src)
120+
tmplData, err := os.ReadFile(src)
122121
if err != nil {
123122
return fmt.Errorf("failed reading from template %v, %w", src, err)
124123
}
@@ -133,7 +132,7 @@ func expandFile(src, dst string, args ...map[string]interface{}) error {
133132
return err
134133
}
135134

136-
if err = ioutil.WriteFile(createDir(dst), []byte(output), 0644); err != nil {
135+
if err = os.WriteFile(createDir(dst), []byte(output), 0644); err != nil {
137136
return fmt.Errorf("failed to write rendered template: %w", err)
138137
}
139138

@@ -236,13 +235,13 @@ func FindReplace(file string, re *regexp.Regexp, repl string) error {
236235
return err
237236
}
238237

239-
contents, err := ioutil.ReadFile(file)
238+
contents, err := os.ReadFile(file)
240239
if err != nil {
241240
return err
242241
}
243242

244243
out := re.ReplaceAllString(string(contents), repl)
245-
return ioutil.WriteFile(file, []byte(out), info.Mode().Perm())
244+
return os.WriteFile(file, []byte(out), info.Mode().Perm())
246245
}
247246

248247
// MustFindReplace invokes FindReplace and panics if an error occurs.

dev-tools/mage/config.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ package mage
77
import (
88
"bytes"
99
"fmt"
10-
"io/ioutil"
1110
"os"
1211
"path/filepath"
1312
"regexp"
@@ -159,7 +158,7 @@ func makeConfigTemplate(destination string, mode os.FileMode, confParams ConfigF
159158
}
160159
}
161160

162-
data, err := ioutil.ReadFile(confFile.Template)
161+
data, err := os.ReadFile(confFile.Template)
163162
if err != nil {
164163
return errors.Wrapf(err, "failed to read config template %q", confFile.Template)
165164
}

dev-tools/mage/copy.go

+23-11
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
package mage
66

77
import (
8+
"fmt"
89
"io"
9-
"io/ioutil"
10+
"io/fs"
1011
"os"
1112
"path/filepath"
1213
"regexp"
@@ -41,7 +42,7 @@ func (t *CopyTask) Execute() error {
4142
return errors.Wrapf(err, "copy failed: cannot stat source file %v", t.Source)
4243
}
4344

44-
return errors.Wrap(t.recursiveCopy(t.Source, t.Dest, info), "copy failed")
45+
return errors.Wrap(t.recursiveCopy(t.Source, t.Dest, fs.FileInfoToDirEntry(info)), "copy failed")
4546
}
4647

4748
func (t *CopyTask) init() error {
@@ -64,14 +65,14 @@ func (t *CopyTask) isExcluded(src string) bool {
6465
return false
6566
}
6667

67-
func (t *CopyTask) recursiveCopy(src, dest string, info os.FileInfo) error {
68-
if info.IsDir() {
69-
return t.dirCopy(src, dest, info)
68+
func (t *CopyTask) recursiveCopy(src, dest string, entry fs.DirEntry) error {
69+
if entry.IsDir() {
70+
return t.dirCopy(src, dest, entry)
7071
}
71-
return t.fileCopy(src, dest, info)
72+
return t.fileCopy(src, dest, entry)
7273
}
7374

74-
func (t *CopyTask) fileCopy(src, dest string, info os.FileInfo) error {
75+
func (t *CopyTask) fileCopy(src, dest string, entry fs.DirEntry) error {
7576
if t.isExcluded(src) {
7677
return nil
7778
}
@@ -82,6 +83,11 @@ func (t *CopyTask) fileCopy(src, dest string, info os.FileInfo) error {
8283
}
8384
defer srcFile.Close()
8485

86+
info, err := entry.Info()
87+
if err != nil {
88+
return fmt.Errorf("converting dir entry: %w", err)
89+
}
90+
8591
if !info.Mode().IsRegular() {
8692
return errors.Errorf("failed to copy source file because it is not a " +
8793
"regular file")
@@ -104,28 +110,34 @@ func (t *CopyTask) fileCopy(src, dest string, info os.FileInfo) error {
104110
return destFile.Close()
105111
}
106112

107-
func (t *CopyTask) dirCopy(src, dest string, info os.FileInfo) error {
113+
func (t *CopyTask) dirCopy(src, dest string, entry fs.DirEntry) error {
108114
if t.isExcluded(src) {
109115
return nil
110116
}
111117

118+
info, err := entry.Info()
119+
if err != nil {
120+
return fmt.Errorf("converting dir entry: %w", err)
121+
}
122+
112123
mode := t.DirMode
113124
if mode == 0 {
114125
mode = info.Mode()
115126
}
127+
116128
if err := os.MkdirAll(dest, mode&os.ModePerm); err != nil {
117129
return errors.Wrap(err, "failed creating dirs")
118130
}
119131

120-
contents, err := ioutil.ReadDir(src)
132+
contents, err := os.ReadDir(src)
121133
if err != nil {
122134
return errors.Wrapf(err, "failed to read dir %v", src)
123135
}
124136

125-
for _, info := range contents {
137+
for _, entry := range contents {
126138
srcFile := filepath.Join(src, info.Name())
127139
destFile := filepath.Join(dest, info.Name())
128-
if err = t.recursiveCopy(srcFile, destFile, info); err != nil {
140+
if err = t.recursiveCopy(srcFile, destFile, entry); err != nil {
129141
return errors.Wrapf(err, "failed to copy %v to %v", srcFile, destFile)
130142
}
131143
}

0 commit comments

Comments
 (0)