Skip to content

Commit 0346c58

Browse files
Merge remote-tracking branch 'upstream/main' into service-monitoring
2 parents f1d0e5a + 840676d commit 0346c58

33 files changed

+710
-223
lines changed

.agent-versions.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"testVersions": [
3+
"8.14.1",
34
"8.14.1-SNAPSHOT",
4-
"8.14.0",
55
"8.13.5-SNAPSHOT",
66
"8.13.4",
77
"7.17.22-SNAPSHOT",

.buildkite/pipeline.yml

+48
Original file line numberDiff line numberDiff line change
@@ -232,3 +232,51 @@ steps:
232232
image: "family/core-ubuntu-2204"
233233
env:
234234
- GH_VERSION=2.4.0
235+
236+
# Trigger for pull requests
237+
- label: "Trigger Integration tests for Pull request"
238+
if: |
239+
(build.pull_request.id != null && !build.env("GITHUB_PR_LABELS") =~ /skip-it/) ||
240+
build.env("GITHUB_PR_TRIGGER_COMMENT") =~ /.*extended.*/
241+
242+
plugins:
243+
- monorepo-diff#v1.0.1:
244+
diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD"
245+
watch:
246+
- path:
247+
- internal/
248+
- dev-tools/
249+
- pkg/
250+
- testing/
251+
- version/
252+
- specs/
253+
- .agent-versions.json
254+
- .go-version
255+
- .package-version
256+
- go.mod
257+
- go.sum
258+
- magefile.go
259+
- main.go
260+
261+
- .buildkite/integration.pipeline.yml
262+
- .buildkite/pipeline.yml
263+
- .buildkite/scripts/
264+
- .buildkite/hooks/
265+
266+
config:
267+
trigger: "elastic-agent-extended-testing"
268+
build:
269+
commit: "${BUILDKITE_COMMIT}"
270+
branch: "${BUILDKITE_BRANCH}"
271+
env:
272+
- BUILDKITE_PULL_REQUEST=${BUILDKITE_PULL_REQUEST}
273+
- BUILDKITE_PULL_REQUEST_BASE_BRANCH=${BUILDKITE_PULL_REQUEST_BASE_BRANCH}
274+
- GITHUB_PR_LABELS=${GITHUB_PR_LABELS}
275+
276+
# Trigger for branches
277+
- label: "Triggering Integration tests for branches"
278+
if: build.pull_request.id == null
279+
trigger: "elastic-agent-extended-testing"
280+
build:
281+
commit: "${BUILDKITE_COMMIT}"
282+
branch: "${BUILDKITE_BRANCH}"

.buildkite/pull-requests.json

+2-19
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,13 @@
99
"set_commit_status": true,
1010
"build_on_commit": true,
1111
"build_on_comment": true,
12-
"trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it))|^/test$",
13-
"always_trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it))|^/test$",
12+
"trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it|extended))|^/test\\W*(?:extended|)",
13+
"always_trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it|extended))|^/test\\W*(?:extended|)",
1414
"skip_ci_labels": [ "skip-ci" ],
1515
"skip_target_branches": [ ],
1616
"skip_ci_on_only_changed": [ "^.ci/", "^changelog", "^docs/", "\\.md$", "^docker-compose.yml", "^.pre-commit-config.yaml", "skaffold.yaml", "^Dockerfile.skaffold", "^Dockerfile"],
1717
"always_require_ci_on_changed": [ ]
1818
},
19-
{
20-
"enabled": true,
21-
"build_drafts": false,
22-
"pipelineSlug": "elastic-agent-extended-testing",
23-
"allow_org_users": true,
24-
"allowed_repo_permissions": ["admin", "write"],
25-
"allowed_list": ["dependabot[bot]", "mergify[bot]", "github-actions[bot]"],
26-
"set_commit_status": true,
27-
"build_on_commit": true,
28-
"build_on_comment": true,
29-
"trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:extended))|^/test extended$",
30-
"always_trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:extended))|^/test extended$",
31-
"skip_ci_labels": [ "skip-ci", "skip-it" ],
32-
"skip_target_branches": [ ],
33-
"skip_ci_on_only_changed": [ "^.ci/", "^changelog", "^docs/", "\\.md$", "^sonar-project.properties", "^docker-compose.yml", "^.pre-commit-config.yaml", "skaffold.yaml", "^Dockerfile.skaffold", "^Dockerfile"],
34-
"always_require_ci_on_changed": [ ]
35-
},
3619
{
3720
"enabled": true,
3821
"pipelineSlug": "elastic-agent-package",

NOTICE.txt

+32-32
Original file line numberDiff line numberDiff line change
@@ -2220,6 +2220,36 @@ Contents of probable licence file $GOMODCACHE/github.com/elastic/go-licenser@v0.
22202220
limitations under the License.
22212221

22222222

2223+
--------------------------------------------------------------------------------
2224+
Dependency : github.com/elastic/go-service
2225+
Version: v0.0.0-20240611154109-f44f756f194f
2226+
Licence type (autodetected): Zlib
2227+
--------------------------------------------------------------------------------
2228+
2229+
Contents of probable licence file $GOMODCACHE/github.com/elastic/go-service@v0.0.0-20240611154109-f44f756f194f/LICENSE:
2230+
2231+
Copyright (c) 2015 Daniel Theophanes
2232+
2233+
This software is provided 'as-is', without any express or implied
2234+
warranty. In no event will the authors be held liable for any damages
2235+
arising from the use of this software.
2236+
2237+
Permission is granted to anyone to use this software for any purpose,
2238+
including commercial applications, and to alter it and redistribute it
2239+
freely, subject to the following restrictions:
2240+
2241+
1. The origin of this software must not be misrepresented; you must not
2242+
claim that you wrote the original software. If you use this software
2243+
in a product, an acknowledgment in the product documentation would be
2244+
appreciated but is not required.
2245+
2246+
2. Altered source versions must be plainly marked as such, and must not be
2247+
misrepresented as being the original software.
2248+
2249+
3. This notice may not be removed or altered from any source
2250+
distribution.
2251+
2252+
22232253
--------------------------------------------------------------------------------
22242254
Dependency : github.com/elastic/go-sysinfo
22252255
Version: v1.14.0
@@ -3782,36 +3812,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
37823812
SOFTWARE.
37833813

37843814

3785-
--------------------------------------------------------------------------------
3786-
Dependency : github.com/kardianos/service
3787-
Version: v1.2.1-0.20210728001519-a323c3813bc7
3788-
Licence type (autodetected): Zlib
3789-
--------------------------------------------------------------------------------
3790-
3791-
Contents of probable licence file $GOMODCACHE/github.com/kardianos/service@v1.2.1-0.20210728001519-a323c3813bc7/LICENSE:
3792-
3793-
Copyright (c) 2015 Daniel Theophanes
3794-
3795-
This software is provided 'as-is', without any express or implied
3796-
warranty. In no event will the authors be held liable for any damages
3797-
arising from the use of this software.
3798-
3799-
Permission is granted to anyone to use this software for any purpose,
3800-
including commercial applications, and to alter it and redistribute it
3801-
freely, subject to the following restrictions:
3802-
3803-
1. The origin of this software must not be misrepresented; you must not
3804-
claim that you wrote the original software. If you use this software
3805-
in a product, an acknowledgment in the product documentation would be
3806-
appreciated but is not required.
3807-
3808-
2. Altered source versions must be plainly marked as such, and must not be
3809-
misrepresented as being the original software.
3810-
3811-
3. This notice may not be removed or altered from any source
3812-
distribution.
3813-
3814-
38153815
--------------------------------------------------------------------------------
38163816
Dependency : github.com/magefile/mage
38173817
Version: v1.15.0
@@ -16815,11 +16815,11 @@ Contents of probable licence file $GOMODCACHE/github.com/elastic/go-windows@v1.0
1681516815

1681616816
--------------------------------------------------------------------------------
1681716817
Dependency : github.com/elastic/gosigar
16818-
Version: v0.14.2
16818+
Version: v0.14.3
1681916819
Licence type (autodetected): Apache-2.0
1682016820
--------------------------------------------------------------------------------
1682116821

16822-
Contents of probable licence file $GOMODCACHE/github.com/elastic/gosigar@v0.14.2/LICENSE:
16822+
Contents of probable licence file $GOMODCACHE/github.com/elastic/gosigar@v0.14.3/LICENSE:
1682316823

1682416824
Apache License
1682516825
Version 2.0, January 2004
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: Capture early errors on Windows in Application eventlog.
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/elastic/elastic-agent/pull/4846
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/4627
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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 unprivileged mode support (beta)
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 new --unprivileged installation option. This option installs the Elastic Agent as a non-root or non-Administrator
21+
user that has limited permissions on the host.
22+
23+
# Affected component; usually one of "elastic-agent", "fleet-server", "filebeat", "metricbeat", "auditbeat", "all", etc.
24+
component: elastic-agent
25+
26+
# PR URL; optional; the PR number that added the changeset.
27+
# If not present is automatically filled by the tooling finding the PR where this changelog fragment has been added.
28+
# NOTE: the tooling supports backports, so it's able to fill the original PR number instead of the backport PR number.
29+
# Please provide it if you are adding a fragment for a different PR.
30+
#pr: https://github.com/owner/repo/1234
31+
32+
# Issue URL; optional; the GitHub issue related to this changeset (either closes or is part of).
33+
# If not present is automatically filled by the tooling with the issue linked to the PR number.
34+
#issue: https://github.com/owner/repo/1234
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
kind: bug-fix
2+
summary: Increase removal timeout when uninstall
3+
component: "elastic-agent"

go.mod

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ require (
1919
github.com/elastic/elastic-transport-go/v8 v8.6.0
2020
github.com/elastic/go-elasticsearch/v8 v8.14.0
2121
github.com/elastic/go-licenser v0.4.1
22+
github.com/elastic/go-service v0.0.0-20240611154109-f44f756f194f
2223
github.com/elastic/go-sysinfo v1.14.0
2324
github.com/elastic/go-ucfg v0.8.8
2425
github.com/elastic/mock-es v0.0.0-20240605193845-b5546a703d6f
@@ -36,7 +37,6 @@ require (
3637
github.com/jedib0t/go-pretty/v6 v6.4.6
3738
github.com/joeshaw/multierror v0.0.0-20140124173710-69b34d4ec901
3839
github.com/josephspurrier/goversioninfo v0.0.0-20190209210621-63e6d1acd3dd
39-
github.com/kardianos/service v1.2.1-0.20210728001519-a323c3813bc7
4040
github.com/magefile/mage v1.15.0
4141
github.com/mitchellh/gox v1.0.1
4242
github.com/mitchellh/hashstructure v1.1.0
@@ -134,7 +134,7 @@ require (
134134
github.com/elastic/go-elasticsearch/v7 v7.17.10 // indirect
135135
github.com/elastic/go-structform v0.0.10 // indirect
136136
github.com/elastic/go-windows v1.0.1 // indirect
137-
github.com/elastic/gosigar v0.14.2 // indirect
137+
github.com/elastic/gosigar v0.14.3 // indirect
138138
github.com/elastic/pkcs8 v1.0.0 // indirect
139139
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
140140
github.com/evanphx/json-patch v5.6.0+incompatible // indirect

go.sum

+4-4
Original file line numberDiff line numberDiff line change
@@ -816,6 +816,8 @@ github.com/elastic/go-elasticsearch/v8 v8.14.0/go.mod h1:WRvnlGkSuZyp83M2U8El/LG
816816
github.com/elastic/go-licenser v0.3.1/go.mod h1:D8eNQk70FOCVBl3smCGQt/lv7meBeQno2eI1S5apiHQ=
817817
github.com/elastic/go-licenser v0.4.1 h1:1xDURsc8pL5zYT9R29425J3vkHdt4RT5TNEMeRN48x4=
818818
github.com/elastic/go-licenser v0.4.1/go.mod h1:V56wHMpmdURfibNBggaSBfqgPxyT1Tldns1i87iTEvU=
819+
github.com/elastic/go-service v0.0.0-20240611154109-f44f756f194f h1:kMtsJ3zfcBBR6wfbf5yUExmvWLru6R7zSLaJIfSjU3g=
820+
github.com/elastic/go-service v0.0.0-20240611154109-f44f756f194f/go.mod h1:3lVNFcuNMdWJrSpGF5SMPUVuC+qOYobfPIrMQUoizrk=
819821
github.com/elastic/go-structform v0.0.10 h1:oy08o/Ih2hHTkNcRY/1HhaYvIp5z6t8si8gnCJPDo1w=
820822
github.com/elastic/go-structform v0.0.10/go.mod h1:CZWf9aIRYY5SuKSmOhtXScE5uQiLZNqAFnwKR4OrIM4=
821823
github.com/elastic/go-sysinfo v1.1.1/go.mod h1:i1ZYdU10oLNfRzq4vq62BEwD2fH8KaWh6eh0ikPT9F0=
@@ -828,8 +830,8 @@ github.com/elastic/go-windows v1.0.0/go.mod h1:TsU0Nrp7/y3+VwE82FoZF8gC/XFg/Elz6
828830
github.com/elastic/go-windows v1.0.1 h1:AlYZOldA+UJ0/2nBuqWdo90GFCgG9xuyw9SYzGUtJm0=
829831
github.com/elastic/go-windows v1.0.1/go.mod h1:FoVvqWSun28vaDQPbj2Elfc0JahhPB7WQEGa3c814Ss=
830832
github.com/elastic/gojsonschema v1.2.1/go.mod h1:biw5eBS2Z4T02wjATMRSfecfjCmwaDPvuaqf844gLrg=
831-
github.com/elastic/gosigar v0.14.2 h1:Dg80n8cr90OZ7x+bAax/QjoW/XqTI11RmA79ZwIm9/4=
832-
github.com/elastic/gosigar v0.14.2/go.mod h1:iXRIGg2tLnu7LBdpqzyQfGDEidKCfWcCMS0WKyPWoMs=
833+
github.com/elastic/gosigar v0.14.3 h1:xwkKwPia+hSfg9GqrCUKYdId102m9qTJIIr7egmK/uo=
834+
github.com/elastic/gosigar v0.14.3/go.mod h1:iXRIGg2tLnu7LBdpqzyQfGDEidKCfWcCMS0WKyPWoMs=
833835
github.com/elastic/mock-es v0.0.0-20240605193845-b5546a703d6f h1:qo0Nn9G+p7HbG+CmiWwSoiKJ/cyRq59TRn9Z2PRHTi8=
834836
github.com/elastic/mock-es v0.0.0-20240605193845-b5546a703d6f/go.mod h1:mVdKBYYwt30xRFjCegbcURHh+3LWOCkQM33fgWbUiRI=
835837
github.com/elastic/package-spec/v2 v2.6.0/go.mod h1:ks9/FaVOS+vCrGRQcDvXAd2FlmB84mrLikbRiO6ACuk=
@@ -1281,8 +1283,6 @@ github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfV
12811283
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
12821284
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
12831285
github.com/k0kubun/go-ansi v0.0.0-20180517002512-3bf9e2903213/go.mod h1:vNUNkEQ1e29fT/6vq2aBdFsgNPmy8qMdSay1npru+Sw=
1284-
github.com/kardianos/service v1.2.1-0.20210728001519-a323c3813bc7 h1:oohm9Rk9JAxxmp2NLZa7Kebgz9h4+AJDcc64txg3dQ0=
1285-
github.com/kardianos/service v1.2.1-0.20210728001519-a323c3813bc7/go.mod h1:CIMRFEJVL+0DS1a3Nx06NaMn4Dz63Ng6O7dl0qH0zVM=
12861286
github.com/karrick/godirwalk v1.15.6/go.mod h1:j4mkqPuvaLI8mp1DroR3P6ad7cyYd4c1qeJ3RV7ULlk=
12871287
github.com/karrick/godirwalk v1.16.1 h1:DynhcF+bztK8gooS0+NDJFrdNZjJ3gzVzC545UNA9iw=
12881288
github.com/karrick/godirwalk v1.16.1/go.mod h1:j4mkqPuvaLI8mp1DroR3P6ad7cyYd4c1qeJ3RV7ULlk=

internal/pkg/agent/application/coordinator/diagnostics_test.go

+5
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,7 @@ type fakeAgentInfo struct {
633633
snapshot bool
634634
version string
635635
unprivileged bool
636+
isStandalone bool
636637
}
637638

638639
func (a fakeAgentInfo) AgentID() string {
@@ -663,5 +664,9 @@ func (a fakeAgentInfo) Unprivileged() bool {
663664
return a.unprivileged
664665
}
665666

667+
func (a fakeAgentInfo) IsStandalone() bool {
668+
return a.isStandalone
669+
}
670+
666671
func (a fakeAgentInfo) ReloadID(ctx context.Context) error { panic("implement me") }
667672
func (a fakeAgentInfo) SetLogLevel(ctx context.Context, level string) error { panic("implement me") }

internal/pkg/agent/application/gateway/fleet/fleet_gateway.go

+4
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,10 @@ func (f *FleetGateway) execute(ctx context.Context) (*fleetapi.CheckinResponse,
329329
// convert components into checkin components structure
330330
components := f.convertToCheckinComponents(state.Components)
331331

332+
f.log.Debugf("correcting agent loglevel from %s to %s using coordinator state", ecsMeta.Elastic.Agent.LogLevel, state.LogLevel.String())
333+
// Fix loglevel with the current log level used by coordinator
334+
ecsMeta.Elastic.Agent.LogLevel = state.LogLevel.String()
335+
332336
// checkin
333337
cmd := fleetapi.NewCheckinCmd(f.agentInfo, f.client)
334338
req := &fleetapi.CheckinRequest{

0 commit comments

Comments
 (0)