Skip to content

Commit d9dab7b

Browse files
Fix TestFleetManagedUpgrade test + cleanup (#2809)
* add changelog * fix changelog * remove changelog * Fix upgrade tests * Making names consistent * Running make notice * Fix versions * Update elastic-agent-libs dependency --------- Co-authored-by: Alex Kristiansen <alex.kristiansen@elastic.co>
1 parent 7371b4d commit d9dab7b

File tree

6 files changed

+295
-304
lines changed

6 files changed

+295
-304
lines changed

NOTICE.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1367,11 +1367,11 @@ SOFTWARE
13671367

13681368
--------------------------------------------------------------------------------
13691369
Dependency : github.com/elastic/elastic-agent-libs
1370-
Version: v0.3.9
1370+
Version: v0.3.9-0.20230608184016-1f368a55a6ac
13711371
Licence type (autodetected): Apache-2.0
13721372
--------------------------------------------------------------------------------
13731373

1374-
Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-agent-libs@v0.3.9/LICENSE:
1374+
Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-agent-libs@v0.3.9-0.20230608184016-1f368a55a6ac/LICENSE:
13751375

13761376
Apache License
13771377
Version 2.0, January 2004

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ require (
1515
github.com/elastic/e2e-testing v1.99.2-0.20221205111528-ade3c840d0c0
1616
github.com/elastic/elastic-agent-autodiscover v0.6.1
1717
github.com/elastic/elastic-agent-client/v7 v7.1.2
18-
github.com/elastic/elastic-agent-libs v0.3.9
18+
github.com/elastic/elastic-agent-libs v0.3.9-0.20230608184016-1f368a55a6ac
1919
github.com/elastic/elastic-agent-system-metrics v0.6.1
2020
github.com/elastic/go-elasticsearch/v8 v8.8.0
2121
github.com/elastic/go-licenser v0.4.1

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -397,8 +397,8 @@ github.com/elastic/elastic-agent-autodiscover v0.6.1 h1:vXR+3QVDL7Ij7IMKul13iIiD
397397
github.com/elastic/elastic-agent-autodiscover v0.6.1/go.mod h1:yXYKFAG+Py+TcE4CCR8EAbJiYb+6Dz9sCDoWgOveqtU=
398398
github.com/elastic/elastic-agent-client/v7 v7.1.2 h1:p6KvvDMoFCBPvchxcx9cRXpRjsDaii0m/wE3lqQxpmM=
399399
github.com/elastic/elastic-agent-client/v7 v7.1.2/go.mod h1:G3Mk1pHXxvj3wC5FvsGUlPOsvapTB5SfrUmWiJDXT6Q=
400-
github.com/elastic/elastic-agent-libs v0.3.9 h1:2xbZUOM20Q9ni3dkNjj8r274fub22SuLqi6SedknV7g=
401-
github.com/elastic/elastic-agent-libs v0.3.9/go.mod h1:Fy5QqIOax0EOVeQJ2l5Ux+GmJsX549Obllru5R1bHLI=
400+
github.com/elastic/elastic-agent-libs v0.3.9-0.20230608184016-1f368a55a6ac h1:0tNQuC+Tz+j9/O6Oq5LH+ccvpmEQOFAaSyxaNREAdXM=
401+
github.com/elastic/elastic-agent-libs v0.3.9-0.20230608184016-1f368a55a6ac/go.mod h1:Fy5QqIOax0EOVeQJ2l5Ux+GmJsX549Obllru5R1bHLI=
402402
github.com/elastic/elastic-agent-system-metrics v0.6.1 h1:LCN1lvQTkdUuU/rKlpKyVMDU/G/I8/iZWCaW6K+mo4o=
403403
github.com/elastic/elastic-agent-system-metrics v0.6.1/go.mod h1:Bj8XM/uNKm553blQHkGNEICRLGnVEtw8yttmV5vBngA=
404404
github.com/elastic/elastic-package v0.36.0/go.mod h1:TUyhRXtf+kazrUthMF+5FtngcFJZtsgty0o/nnl8UFU=

pkg/version/version_parser.go

+21
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,27 @@ func (psv ParsedSemVer) Less(other ParsedSemVer) bool {
107107
return false
108108
}
109109

110+
func (psv ParsedSemVer) GetPreviousMinor() (*ParsedSemVer, error) {
111+
major := psv.Major()
112+
minor := psv.Minor()
113+
114+
if minor > 0 {
115+
// We have at least one previous minor version in the current
116+
// major version series
117+
return NewParsedSemVer(major, minor-1, 0, "", ""), nil
118+
}
119+
120+
// We are at the first minor of the current major version series. To
121+
// figure out the previous minor, we need to rely on knowledge of
122+
// the release versions from the past major series'.
123+
switch major {
124+
case 8:
125+
return NewParsedSemVer(7, 17, 10, "", ""), nil
126+
}
127+
128+
return nil, fmt.Errorf("unable to determine previous minor version for [%s]", psv.String())
129+
}
130+
110131
func (psv ParsedSemVer) String() string {
111132
b := new(strings.Builder)
112133
b.WriteString(psv.CoreVersion())

testing/integration/upgrade_retry_download_test.go

-237
This file was deleted.

0 commit comments

Comments
 (0)