Skip to content

Commit

Permalink
Merge branch 'main' into uninstall-kill-watcher
Browse files Browse the repository at this point in the history
  • Loading branch information
blakerouse committed Sep 20, 2023
2 parents b324949 + d2a3758 commit db958b5
Show file tree
Hide file tree
Showing 36 changed files with 327 additions and 144 deletions.
9 changes: 9 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,12 @@ steps:
agents:
provider: "gcp"
machineType: "n1-standard-8"

- wait: ~
continue_on_failure: true
- label: "Processing test results"
agents:
provider: "gcp"
plugins:
- junit-annotate#v2.4.1:
artifacts: build/TEST-go-*.xml
2 changes: 1 addition & 1 deletion .buildkite/scripts/steps/integration_tests.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
set -euxo pipefail
set -euo pipefail

source .buildkite/scripts/common.sh

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/govulncheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ jobs:
- id: govulncheck
uses: golang/govulncheck-action@v1
with:
go-version-input: 1.20.7
go-version-input: 1.20.8
go-package: ./...
2 changes: 1 addition & 1 deletion .go-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.20.7
1.20.8
8 changes: 4 additions & 4 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ linters-settings:

gosimple:
# Select the Go version to target. The default is '1.13'.
go: "1.20.7"
go: "1.20.8"

nakedret:
# make an issue if func has more lines of code than this setting and it has naked returns; default is 30
Expand All @@ -136,17 +136,17 @@ linters-settings:

staticcheck:
# Select the Go version to target. The default is '1.13'.
go: "1.20.7"
go: "1.20.8"
checks: ["all"]

stylecheck:
# Select the Go version to target. The default is '1.13'.
go: "1.20.7"
go: "1.20.8"
checks: ["all"]

unused:
# Select the Go version to target. The default is '1.13'.
go: "1.20.7"
go: "1.20.8"

gosec:
excludes:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG GO_VERSION=1.20.7
ARG GO_VERSION=1.20.8
FROM circleci/golang:${GO_VERSION}


Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.skaffold
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG GO_VERSION=1.20.7
ARG GO_VERSION=1.20.8
ARG crossbuild_image="docker.elastic.co/beats-dev/golang-crossbuild"
ARG AGENT_VERSION=8.9.0-SNAPSHOT
ARG AGENT_IMAGE="docker.elastic.co/beats/elastic-agent"
Expand Down
8 changes: 4 additions & 4 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2000,11 +2000,11 @@ Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-transpo

--------------------------------------------------------------------------------
Dependency : github.com/elastic/go-elasticsearch/v8
Version: v8.8.2
Version: v8.10.0
Licence type (autodetected): Apache-2.0
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/github.com/elastic/go-elasticsearch/v8@v8.8.2/LICENSE:
Contents of probable licence file $GOMODCACHE/github.com/elastic/go-elasticsearch/v8@v8.10.0/LICENSE:

Apache License
Version 2.0, January 2004
Expand Down Expand Up @@ -2423,11 +2423,11 @@ Contents of probable licence file $GOMODCACHE/github.com/elastic/go-licenser@v0.

--------------------------------------------------------------------------------
Dependency : github.com/elastic/go-sysinfo
Version: v1.11.0
Version: v1.11.1
Licence type (autodetected): Apache-2.0
--------------------------------------------------------------------------------

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


Apache License
Expand Down
40 changes: 40 additions & 0 deletions changelog/8.10.1.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// begin 8.10.1 relnotes

[[release-notes-8.10.1]]
== 8.10.1

Review important information about the 8.10.1 release.












[discrete]
[[enhancements-8.10.1]]
=== Enhancements


elastic-agent::

* Improve Logging During Agent Upgrades. {elastic-agent-pull}https://github.com/elastic/elastic-agent/pull/3382[#https://github.com/elastic/elastic-agent/pull/3382]




[discrete]
[[bug-fixes-8.10.1]]
=== Bug fixes


elastic-agent::

* Rollback Elastic Agent Upgrade If Upgraded Agent Process Crashes Immediately. {elastic-agent-pull}https://github.com/elastic/elastic-agent/pull/3166[#https://github.com/elastic/elastic-agent/pull/3166] {elastic-agent-issue}https://github.com/elastic/elastic-agent/issues/3124[#https://github.com/elastic/elastic-agent/issues/3124]

// end 8.10.1 relnotes
25 changes: 25 additions & 0 deletions changelog/8.10.1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
version: 8.10.1
entries:
- kind: bug-fix
summary: Rollback Elastic Agent upgrade if upgraded Agent process crashes immediately.
description: ""
component: elastic-agent
pr:
- https://github.com/elastic/elastic-agent/pull/3166
issue:
- https://github.com/elastic/elastic-agent/issues/3124
timestamp: 1690917883
file:
name: 1690917883-crash-checker-pid-zero.yaml
checksum: 0a2ceec945ec5f1829bbf0d6d9f13f2f5b428885
- kind: enhancement
summary: Improve logging during Agent upgrades
description: ""
component: elastic-agent
pr:
- https://github.com/elastic/elastic-agent/pull/3382
issue: []
timestamp: 1694190260
file:
name: 1694190260-improve-upgrade-logging.yaml
checksum: 4d9c6f196e8fa89e834969c751237153b69b18e5
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,25 @@
# - security: impacts on the security of a product or a user’s deployment.
# - upgrade: important information for someone upgrading from a prior version
# - other: does not fit into any of the other categories
kind: bug-fix
kind: bug

# Change summary; a 80ish characters long description of the change.
summary: Rollback Elastic Agent upgrade if upgraded Agent process crashes immediately.
summary: Fixing deploy/kubernetes/creator_k8.sh script to correcly exclude configmaps

# Long description; in case the summary is not enough to describe the change
# this field accommodate a description without length limits.
# NOTE: This field will be rendered only for breaking-change and known-issue kinds at the moment.
#description:

# Affected component; usually one of "elastic-agent", "fleet-server", "filebeat", "metricbeat", "auditbeat", "all", etc.
component: elastic-agent
component:

# PR URL; optional; the PR number that added the changeset.
# If not present is automatically filled by the tooling finding the PR where this changelog fragment has been added.
# NOTE: the tooling supports backports, so it's able to fill the original PR number instead of the backport PR number.
# Please provide it if you are adding a fragment for a different PR.
pr: https://github.com/elastic/elastic-agent/pull/3166
#pr: https://github.com/owner/repo/1234

# Issue URL; optional; the GitHub issue related to this changeset (either closes or is part of).
# If not present is automatically filled by the tooling with the issue linked to the PR number.
issue: https://github.com/elastic/elastic-agent/issues/3124
#issue: https://github.com/owner/repo/1234
32 changes: 32 additions & 0 deletions changelog/fragments/1694700200-Upgrade-to-Go-1.20.8.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Kind can be one of:
# - breaking-change: a change to previously-documented behavior
# - deprecation: functionality that is being removed in a later release
# - bug-fix: fixes a problem in a previous version
# - enhancement: extends functionality but does not break or fix existing behavior
# - feature: new functionality
# - known-issue: problems that we are aware of in a given version
# - security: impacts on the security of a product or a user’s deployment.
# - upgrade: important information for someone upgrading from a prior version
# - other: does not fit into any of the other categories
kind: security

# Change summary; a 80ish characters long description of the change.
summary: Upgrade to Go 1.20.8.

# Long description; in case the summary is not enough to describe the change
# this field accommodate a description without length limits.
# NOTE: This field will be rendered only for breaking-change and known-issue kinds at the moment.
#description:

# Affected component; usually one of "elastic-agent", "fleet-server", "filebeat", "metricbeat", "auditbeat", "all", etc.
component: "elastic-agent"

# PR URL; optional; the PR number that added the changeset.
# If not present is automatically filled by the tooling finding the PR where this changelog fragment has been added.
# NOTE: the tooling supports backports, so it's able to fill the original PR number instead of the backport PR number.
# Please provide it if you are adding a fragment for a different PR.
pr: https://github.com/elastic/elastic-agent/pull/3393

# Issue URL; optional; the GitHub issue related to this changeset (either closes or is part of).
# If not present is automatically filled by the tooling with the issue linked to the PR number.
#issue: https://github.com/owner/repo/1234
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Kind can be one of:
# - breaking-change: a change to previously-documented behavior
# - deprecation: functionality that is being removed in a later release
# - bug-fix: fixes a problem in a previous version
# - enhancement: extends functionality but does not break or fix existing behavior
# - feature: new functionality
# - known-issue: problems that we are aware of in a given version
# - security: impacts on the security of a product or a user’s deployment.
# - upgrade: important information for someone upgrading from a prior version
# - other: does not fit into any of the other categories
kind: feature

# Change summary; a 80ish characters long description of the change.
summary: Improve uninstall by adding some pause between retries when removal is blocked by busy files

# Long description; in case the summary is not enough to describe the change
# this field accommodate a description without length limits.
# NOTE: This field will be rendered only for breaking-change and known-issue kinds at the moment.
#description:

# Affected component; a word indicating the component this changeset affects.
component: elastic-agent

# PR URL; optional; the PR number that added the changeset.
# If not present is automatically filled by the tooling finding the PR where this changelog fragment has been added.
# NOTE: the tooling supports backports, so it's able to fill the original PR number instead of the backport PR number.
# Please provide it if you are adding a fragment for a different PR.
#pr: https://github.com/owner/repo/1234

# Issue URL; optional; the GitHub issue related to this changeset (either closes or is part of).
# If not present is automatically filled by the tooling with the issue linked to the PR number.
#issue: https://github.com/owner/repo/1234
2 changes: 1 addition & 1 deletion deploy/kubernetes/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ $(ALL):
ifdef WITHOUTCONFIG
@echo "Generating [email protected]"
@rm -f [email protected]
@for f in $(shell ls $@/*.yaml | grep -v daemonset-configmap); do \
@for f in $(shell ls $@/*.yaml | grep -v configmap ); do \
sed -e "s/%VERSION%/VERSION/g" -e "s/%BRANCH%/${BRANCH_VERSION}/g" $$f >> [email protected]; \
echo --- >> [email protected]; \
done
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ require (
github.com/elastic/elastic-agent-libs v0.3.14
github.com/elastic/elastic-agent-system-metrics v0.6.1
github.com/elastic/elastic-transport-go/v8 v8.3.0
github.com/elastic/go-elasticsearch/v8 v8.8.2
github.com/elastic/go-elasticsearch/v8 v8.10.0
github.com/elastic/go-licenser v0.4.1
github.com/elastic/go-sysinfo v1.11.0
github.com/elastic/go-sysinfo v1.11.1
github.com/elastic/go-ucfg v0.8.6
github.com/fatih/color v1.15.0
github.com/gofrs/flock v0.8.1
Expand Down
9 changes: 5 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -785,12 +785,13 @@ github.com/elastic/elastic-agent-system-metrics v0.6.1 h1:LCN1lvQTkdUuU/rKlpKyVM
github.com/elastic/elastic-agent-system-metrics v0.6.1/go.mod h1:Bj8XM/uNKm553blQHkGNEICRLGnVEtw8yttmV5vBngA=
github.com/elastic/elastic-integration-corpus-generator-tool v0.5.0/go.mod h1:uf9N86y+UACGybdEhZLpwZ93XHWVhsYZAA4c2T2v6YM=
github.com/elastic/elastic-package v0.77.0/go.mod h1:Xeqx0OOVnKBfFoSHsHmKI74RxgRGiDhU6yXEu8BkJJM=
github.com/elastic/elastic-transport-go/v8 v8.0.0-20230329154755-1a3c63de0db6/go.mod h1:87Tcz8IVNe6rVSLdBux1o/PEItLtyabHU3naC7IoqKI=
github.com/elastic/elastic-transport-go/v8 v8.3.0 h1:DJGxovyQLXGr62e9nDMPSxRyWION0Bh6d9eCFBriiHo=
github.com/elastic/elastic-transport-go/v8 v8.3.0/go.mod h1:87Tcz8IVNe6rVSLdBux1o/PEItLtyabHU3naC7IoqKI=
github.com/elastic/go-elasticsearch/v7 v7.17.7/go.mod h1:OJ4wdbtDNk5g503kvlHLyErCgQwwzmDtaFC4XyOxXA4=
github.com/elastic/go-elasticsearch/v8 v8.0.0-20210317102009-a9d74cec0186/go.mod h1:xe9a/L2aeOgFKKgrO3ibQTnMdpAeL0GC+5/HpGScSa4=
github.com/elastic/go-elasticsearch/v8 v8.8.2 h1:3ITzPlRNadzDnbLTnMRjrAN4j4G3LvFo5gCIWDPS6pY=
github.com/elastic/go-elasticsearch/v8 v8.8.2/go.mod h1:GU1BJHO7WeamP7UhuElYwzzHtvf9SDmeVpSSy9+o6Qg=
github.com/elastic/go-elasticsearch/v8 v8.10.0 h1:ALg3DMxSrx07YmeMNcfPf7cFh1Ep2+Qa19EOXTbwr2k=
github.com/elastic/go-elasticsearch/v8 v8.10.0/go.mod h1:NGmpvohKiRHXI0Sw4fuUGn6hYOmAXlyCphKpzVBiqDE=
github.com/elastic/go-licenser v0.3.1/go.mod h1:D8eNQk70FOCVBl3smCGQt/lv7meBeQno2eI1S5apiHQ=
github.com/elastic/go-licenser v0.4.0/go.mod h1:V56wHMpmdURfibNBggaSBfqgPxyT1Tldns1i87iTEvU=
github.com/elastic/go-licenser v0.4.1 h1:1xDURsc8pL5zYT9R29425J3vkHdt4RT5TNEMeRN48x4=
Expand All @@ -799,8 +800,8 @@ github.com/elastic/go-structform v0.0.10 h1:oy08o/Ih2hHTkNcRY/1HhaYvIp5z6t8si8gn
github.com/elastic/go-structform v0.0.10/go.mod h1:CZWf9aIRYY5SuKSmOhtXScE5uQiLZNqAFnwKR4OrIM4=
github.com/elastic/go-sysinfo v1.1.1/go.mod h1:i1ZYdU10oLNfRzq4vq62BEwD2fH8KaWh6eh0ikPT9F0=
github.com/elastic/go-sysinfo v1.7.1/go.mod h1:i1ZYdU10oLNfRzq4vq62BEwD2fH8KaWh6eh0ikPT9F0=
github.com/elastic/go-sysinfo v1.11.0 h1:QW+6BF1oxBoAprH3w2yephF7xLkrrSXj7gl2xC2BM4w=
github.com/elastic/go-sysinfo v1.11.0/go.mod h1:6KQb31j0QeWBDF88jIdWSxE8cwoOB9tO4Y4osN7Q70E=
github.com/elastic/go-sysinfo v1.11.1 h1:g9mwl05njS4r69TisC+vwHWTSKywZFYYUu3so3T/Lao=
github.com/elastic/go-sysinfo v1.11.1/go.mod h1:6KQb31j0QeWBDF88jIdWSxE8cwoOB9tO4Y4osN7Q70E=
github.com/elastic/go-ucfg v0.8.6 h1:stUeyh2goTgGX+/wb9gzKvTv0YB0231LTpKUgCKj4U0=
github.com/elastic/go-ucfg v0.8.6/go.mod h1:4E8mPOLSUV9hQ7sgLEJ4bvt0KhMuDJa8joDT2QGAEKA=
github.com/elastic/go-windows v1.0.0/go.mod h1:TsU0Nrp7/y3+VwE82FoZF8gC/XFg/Elz6CcloAxnPgU=
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/agent/application/upgrade/cleanup.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
// cleanNonMatchingVersionsFromDownloads will remove files that do not have the passed version number from the downloads directory.
func cleanNonMatchingVersionsFromDownloads(log *logger.Logger, version string) error {
downloadsPath := paths.Downloads()
log.Debugw("Cleaning up non-matching downloaded versions", "version", version, "downloads.path", downloadsPath)
log.Infow("Cleaning up non-matching downloaded versions", "version", version, "downloads.path", downloadsPath)

files, err := os.ReadDir(downloadsPath)
if os.IsNotExist(err) {
Expand Down
8 changes: 3 additions & 5 deletions internal/pkg/agent/application/upgrade/crash_checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ package upgrade
import (
"context"
"fmt"
"os"
"sync"
"time"

Expand Down Expand Up @@ -53,7 +52,7 @@ func NewCrashChecker(ctx context.Context, ch chan error, log *logger.Logger, che
return nil, err
}

log.Debugf("running checks using '%s' controller", c.sc.Name())
log.Infof("running checks using '%s' controller", c.sc.Name())

return c, nil
}
Expand All @@ -62,9 +61,8 @@ func NewCrashChecker(ctx context.Context, ch chan error, log *logger.Logger, che
func (ch *CrashChecker) Run(ctx context.Context) {
defer ch.sc.Close()

ch.log.Debug("Crash checker started")
ch.log.Info("Crash checker started")
for {
ch.log.Debugf("watcher having PID: %d", os.Getpid())
t := time.NewTimer(ch.checkInterval)

select {
Expand All @@ -77,7 +75,7 @@ func (ch *CrashChecker) Run(ctx context.Context) {
ch.log.Error(err)
}

ch.log.Debugf("retrieved service PID [%d]", pid)
ch.log.Infof("retrieved service PID [%d]", pid)
ch.q.Push(pid)

// We decide if the Agent process has crashed in either of
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/agent/application/upgrade/error_checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func NewErrorChecker(ch chan error, log *logger.Logger, checkInterval time.Durat

// Run runs the checking loop.
func (ch *ErrorChecker) Run(ctx context.Context) {
ch.log.Debug("Error checker started")
ch.log.Info("Error checker started")
for {
t := time.NewTimer(ch.checkInterval)
select {
Expand Down
Loading

0 comments on commit db958b5

Please sign in to comment.