Skip to content

Commit 4339920

Browse files
committed
Merge remote-tracking branch 'upstream/main' into feature/gotestsum-skip
* upstream/main: Guard against `nil` pointer dereference (elastic#8107) Generate NOTICE.txt with only modules used by binaries (elastic#8053) Retry enrollment requests when an error is returned, add enrollment timeout (elastic#8056) Changelog for 8.17.6 version (elastic#8062) (elastic#8106) [main][Automation] Update versions (elastic#8098) Allow using beats receivers for self-monitoring (elastic#8031) Adding new configuration setting: `agent.upgrade.rollback.window` (elastic#8065) [Integration Testing] Allow tests to declare themselves as needing a FIPS environment (elastic#8083) fix(agentless): overcome SIGPIPE in agentless promotion pipeline (elastic#8094) ksm autosharing integration configuration update (elastic#8086)
2 parents 77dcc3f + eb9d202 commit 4339920

File tree

27 files changed

+21128
-45761
lines changed

27 files changed

+21128
-45761
lines changed

.buildkite/scripts/steps/run-agentless-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ extract_sha() {
3636
local env=$1
3737

3838
# Extract first matching SHA for the environment pattern
39-
yq eval ".services.agentless-controller.versions | to_entries | .[] | select(.key | test(\"^${env}.*\")) | .value" serverless-gitops/services/agentless-controller/versions.yaml | head -1
39+
yq eval ".services.agentless-controller.versions | with_entries(select(.key | test(\"^${env}.*\"))) | to_entries | .[0].value // \"\"" serverless-gitops/services/agentless-controller/versions.yaml
4040
}
4141

4242

NOTICE.txt

Lines changed: 20415 additions & 45406 deletions
Large diffs are not rendered by default.

_meta/config/common.reference.p2.yml.tmpl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,12 @@ inputs:
119119
# # duration will increase for subsequent retry attempts in a randomized exponential backoff manner.
120120
# retry_sleep_init_duration: 30s
121121

122+
# agent.upgrade
123+
# # rollback settings
124+
# rollback:
125+
# # duration in which an upgraded Agent may be manually rolled back.
126+
# window: 168h
127+
122128
# agent.process:
123129
# # timeout for creating new processes. when process is not successfully created by this timeout
124130
# # start operation is considered a failure

changelog/8.17.6.asciidoc

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// begin 8.17.6 relnotes
2+
3+
[[release-notes-8.17.6]]
4+
== 8.17.6
5+
6+
Review important information about the 8.17.6 release.
7+
8+
[discrete]
9+
[[new-features-8.17.6]]
10+
=== New features
11+
12+
The 8.17.6 release adds the following new and notable features.
13+
14+
15+
elastic-agent::
16+
17+
* Use `fullnameOverride` to set the fully qualified application names in the EDOT Kube-Stack Helm chart. {elastic-agent-pull}https://github.com/elastic/elastic-agent/pull/7754[#https://github.com/elastic/elastic-agent/pull/7754] {elastic-agent-issue}https://github.com/elastic/elastic-agent/issues/7381[#https://github.com/elastic/elastic-agent/issues/7381]
18+
19+
20+
21+
22+
23+
24+
25+
// end 8.17.6 relnotes

changelog/8.17.6.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: 8.17.6
2+
entries:
3+
- kind: feature
4+
summary: Set collectors fullnameOverride for edot kube-stack values.
5+
description: ""
6+
component: elastic-agent
7+
pr:
8+
- https://github.com/elastic/elastic-agent/pull/7754
9+
issue:
10+
- https://github.com/elastic/elastic-agent/issues/7381
11+
timestamp: 1744384247
12+
file:
13+
name: 1744384247-set-collector's-fullnameOverride-for-edot-kube-stack-values.yaml
14+
checksum: d7ccd1a2a660e7e0cc8bed5fc91570465b9ff639
Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,19 @@
88
# - security: impacts on the security of a product or a user’s deployment.
99
# - upgrade: important information for someone upgrading from a prior version
1010
# - other: does not fit into any of the other categories
11-
kind: feature
11+
kind: enhancement
1212

1313
# Change summary; a 80ish characters long description of the change.
14-
summary: set collectors fullnameOverride for edot kube-stack values
14+
summary: Retry enrollment requests on any error
1515

1616
# Long description; in case the summary is not enough to describe the change
1717
# this field accommodate a description without length limits.
1818
# NOTE: This field will be rendered only for breaking-change and known-issue kinds at the moment.
19-
#description:
19+
description: |
20+
If any error is encountered during an attempted enrollment, the elastic-agent
21+
will backoff and retry. Add a new --enroll-timeout flag and
22+
FLEET_ENROLL_TIMEOUT env var to set how long it tries for, default 10m. A
23+
negative value disables the timeout.
2024
2125
# Affected component; usually one of "elastic-agent", "fleet-server", "filebeat", "metricbeat", "auditbeat", "all", etc.
2226
component: elastic-agent
@@ -25,8 +29,8 @@ component: elastic-agent
2529
# If not present is automatically filled by the tooling finding the PR where this changelog fragment has been added.
2630
# NOTE: the tooling supports backports, so it's able to fill the original PR number instead of the backport PR number.
2731
# Please provide it if you are adding a fragment for a different PR.
28-
pr: https://github.com/elastic/elastic-agent/pull/7754
32+
pr: https://github.com/elastic/elastic-agent/pull/8056
2933

3034
# Issue URL; optional; the GitHub issue related to this changeset (either closes or is part of).
3135
# 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/7381
36+
#issue: https://github.com/owner/repo/1234
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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: Adds a new configuration setting, `agent.upgrade.rollback.window`
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+
The value of the `agent.upgrade.rollback.window` setting determines the period after upgrading
21+
Elastic Agent when a rollback to the previous version can be triggered. This is an optional
22+
setting, with a default value of `168h` (7 days). The value can be any string that is parseable
23+
by https://pkg.go.dev/time#ParseDuration.
24+
25+
# Affected component; usually one of "elastic-agent", "fleet-server", "filebeat", "metricbeat", "auditbeat", "all", etc.
26+
component: elastic-agent
27+
28+
# PR URL; optional; the PR number that added the changeset.
29+
# If not present is automatically filled by the tooling finding the PR where this changelog fragment has been added.
30+
# NOTE: the tooling supports backports, so it's able to fill the original PR number instead of the backport PR number.
31+
# Please provide it if you are adding a fragment for a different PR.
32+
pr: https://github.com/elastic/elastic-agent/pull/8065
33+
34+
# Issue URL; optional; the GitHub issue related to this changeset (either closes or is part of).
35+
# If not present is automatically filled by the tooling with the issue linked to the PR number.
36+
issue: https://github.com/elastic/elastic-agent/issues/6881
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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: other
12+
13+
# Change summary; a 80ish characters long description of the change.
14+
summary: NOTICE.txt now contains only those modules that are used by the Elastic Agent binaries.
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+
Only those modules that the Elastic Agent binaries for various platforms directly
21+
or indirectly depend on are now included in the NOTICE.txt file . Modules used for development
22+
tooling are now excluded from NOTICE.txt.
23+
24+
# Affected component; usually one of "elastic-agent", "fleet-server", "filebeat", "metricbeat", "auditbeat", "all", etc.
25+
component: elastic-agent
26+
27+
# PR URL; optional; the PR number that added the changeset.
28+
# If not present is automatically filled by the tooling finding the PR where this changelog fragment has been added.
29+
# NOTE: the tooling supports backports, so it's able to fill the original PR number instead of the backport PR number.
30+
# Please provide it if you are adding a fragment for a different PR.
31+
pr: https://github.com/elastic/elastic-agent/pull/8053
32+
33+
# Issue URL; optional; the GitHub issue related to this changeset (either closes or is part of).
34+
# If not present is automatically filled by the tooling with the issue linked to the PR number.
35+
#issue: https://github.com/owner/repo/1234

deploy/helm/elastic-agent/examples/fleet-managed-ksm-sharding/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ In this example we will perform two Helm chart installations, one installing ela
2222
--set kubernetes.state.agentAsSidecar.enabled=true \
2323
-n kube-system
2424
```
25-
3. In the associated policy from the previous steps install the Kubernetes integration and **enable only** the "Collect Kubernetes metrics from kube-state-metrics".
25+
3. In the associated policy from the previous steps install the Kubernetes integration and **enable only** the "Collect Kubernetes metrics from kube-state-metrics" input. For all associated data streams, update the **Host** destination to `localhost:8080` (instead of the default `kube-state-metrics:8080`), and disable the **Leader Election** option.
2626
4. Follow again [this guide](https://www.elastic.co/guide/en/fleet/current/install-fleet-managed-elastic-agent.html#elastic-agent-installation-steps) to set up a different agent policy and enroll an agent to it. Extract again the Fleet URL (`--url=$NEW_FLEET_URL`) and Enrollment token (`--enrollment-token=$NEW_FLEET_TOKEN`).
2727
5. Install elastic-agent as a Daemonset without kube-state-metrics.
2828
```console

dev-tools/mage/target/common/notice.go

Lines changed: 56 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ import (
99
"errors"
1010
"fmt"
1111
"io"
12+
"maps"
1213
"os"
1314
"os/exec"
15+
"slices"
1416
"strings"
1517

1618
"github.com/magefile/mage/sh"
@@ -36,17 +38,25 @@ func Notice() (err error) {
3638
return err
3739
}
3840

41+
modules, err := getDependentModules()
42+
if err != nil {
43+
return fmt.Errorf("unable to fetch list of dependent modules: %w", err)
44+
}
45+
slices.Sort(modules)
46+
3947
// piping output of the first command to the second
4048
// similar to former Makefile implementation
4149
//
42-
// go list -m -json all | go run go.elastic.co/go-licence-detector \
50+
// go list -m -json {modules} | go run go.elastic.co/go-licence-detector \
4351
// -includeIndirect \
4452
// -rules dev-tools/notice/rules.json \
4553
// -overrides dev-tools/notice/overrides.json \
4654
// -noticeTemplate dev-tools/notice/NOTICE.txt.tmpl \
4755
// -noticeOut NOTICE.txt \
4856
// -depsOut ""
49-
listCmd := exec.Command("go", "list", "-m", "-json", "all")
57+
listCmdArgs := []string{"list", "-m", "-json"}
58+
listCmdArgs = append(listCmdArgs, modules...)
59+
listCmd := exec.Command("go", listCmdArgs...)
5060
licDetectCmd := exec.Command("go", "run", "go.elastic.co/go-licence-detector",
5161
"-includeIndirect",
5262
"-rules", "dev-tools/notice/rules.json",
@@ -133,3 +143,47 @@ func Notice() (err error) {
133143

134144
return nil
135145
}
146+
147+
// getDependentModules returns the unique list paths of modules that the
148+
// github.com/elastic/elastic-agent module recursively depends on. If
149+
// additionalTags are specified, only files that would be compiled with
150+
// those build tags + "linux,darwin,windows" are examined.
151+
// Equivalent to running the following on the command line:
152+
// go list -deps -f "{{with .Module}}{{if not .Main}}{{.Path}}{{end}}{{end}}" -tags "linux,darwin,windows,{additionalTags...}"
153+
func getDependentModules(additionalTags ...string) ([]string, error) {
154+
tags := append([]string{"linux", "darwin", "windows"}, additionalTags...)
155+
156+
cmdArgs := []string{
157+
"list",
158+
"-deps",
159+
"-f",
160+
"{{with .Module}}{{if not .Main}}{{.Path}}{{end}}{{end}}",
161+
"-tags",
162+
strings.Join(tags, ","),
163+
}
164+
165+
cmd := exec.Command("go", cmdArgs...)
166+
fmt.Printf(">> %s\n", strings.Join(cmd.Args, " "))
167+
168+
output, err := cmd.Output()
169+
if err != nil {
170+
var exitErr *exec.ExitError
171+
if errors.As(err, &exitErr) { // double pointer is necessary because Error() is defined on *exec.ExitError receiver
172+
fmt.Println(string(exitErr.Stderr))
173+
}
174+
return nil, err
175+
}
176+
177+
// Parse out list of modules from command output, while also
178+
// de-duplicating the list.
179+
modulesMap := map[string]struct{}{}
180+
for _, line := range bytes.Split(output, []byte("\n")) {
181+
if len(line) > 0 {
182+
modulesMap[string(line)] = struct{}{}
183+
}
184+
}
185+
186+
// Convert to list and return
187+
modules := slices.Collect(maps.Keys(modulesMap))
188+
return modules, nil
189+
}

0 commit comments

Comments
 (0)