Skip to content

Commit a5cc14a

Browse files
authored
Merge branch 'master' into add-enable-field-in-automatedSync
2 parents c9d4963 + 20b1870 commit a5cc14a

40 files changed

+135
-62
lines changed

.github/workflows/release.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ jobs:
7777
- name: Set GORELEASER_PREVIOUS_TAG # Workaround, GoReleaser uses 'git-describe' to determine a previous tag. Our tags are created in release branches.
7878
run: |
7979
set -xue
80-
echo "GORELEASER_PREVIOUS_TAG=$(go run hack/get-previous-release/get-previous-version-for-release-notes.go ${{ github.ref_name }})" >> $GITHUB_ENV
80+
GORELEASER_PREVIOUS_TAG=$(go run hack/get-previous-release/get-previous-version-for-release-notes.go ${{ github.ref_name }}) || exit 1
81+
echo "GORELEASER_PREVIOUS_TAG=$GORELEASER_PREVIOUS_TAG" >> $GITHUB_ENV
8182
8283
- name: Set environment variables for ldflags
8384
id: set_ldflag

Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,7 @@ start-e2e-local: mod-vendor-local dep-ui-local cli-local
486486
ARGOCD_APPLICATIONSET_CONTROLLER_ALLOWED_SCM_PROVIDERS=http://127.0.0.1:8341,http://127.0.0.1:8342,http://127.0.0.1:8343,http://127.0.0.1:8344 \
487487
ARGOCD_E2E_TEST=true \
488488
ARGOCD_HYDRATOR_ENABLED=true \
489+
ARGOCD_CLUSTER_CACHE_EVENTS_PROCESSING_INTERVAL=1ms \
489490
goreman -f $(ARGOCD_PROCFILE) start ${ARGOCD_START}
490491
ls -lrt /tmp/coverage
491492

SECURITY-INSIGHTS.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ header:
33
expiration-date: '2024-10-31T00:00:00.000Z' # One year from initial release.
44
last-updated: '2023-10-27'
55
last-reviewed: '2023-10-27'
6-
commit-hash: 74a367d10e7110209610ba3ec225539ebe5f7522
6+
commit-hash: 226a670fe6b3c6769ff6d18e6839298a58e4577d
77
project-url: https://github.com/argoproj/argo-cd
8-
project-release: v2.14.0
8+
project-release: v3.1.0
99
changelog: https://github.com/argoproj/argo-cd/releases
1010
license: https://github.com/argoproj/argo-cd/blob/master/LICENSE
1111
project-lifecycle:

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.0.0
1+
3.1.0

docs/developer-guide/extensions/proxy-extensions.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Proxy Extensions
22

3-
!!! warning "Alpha Feature (Since 2.7.0)"
4-
This is an experimental, [alpha-quality](https://github.com/argoproj/argoproj/blob/main/community/feature-status.md#alpha)
5-
feature. It may be removed in future releases or modified in backwards-incompatible ways.
3+
!!! warning "Beta Feature (Since 2.7.0)"
4+
This feature is in the [Beta](https://github.com/argoproj/argoproj/blob/main/community/feature-status.md#beta) stage.
5+
It is generally considered stable, but there may be unhandled edge cases.
66

77
## Overview
88

docs/operator-manual/feature-maturity.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ to indicate their stability and maturity. These are the statuses of non-stable f
1717
| Feature | Introduced | Status |
1818
|-------------------------------------------|------------|--------|
1919
| [AppSet Progressive Syncs][2] | v2.6.0 | Alpha |
20-
| [Proxy Extensions][3] | v2.7.0 | Alpha |
20+
| [Proxy Extensions][3] | v2.7.0 | Beta |
2121
| [Skip Application Reconcile][4] | v2.7.0 | Alpha |
2222
| [AppSets in any Namespace][5] | v2.8.0 | Beta |
2323
| [Cluster Sharding: round-robin][6] | v2.8.0 | Alpha |

hack/get-previous-release/get-previous-version-for-release-notes.go

+43-46
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"os"
77
"os/exec"
88
"regexp"
9-
"strconv"
109
"strings"
1110
)
1211

@@ -52,61 +51,59 @@ func extractPatchAndRC(tag string) (string, string, error) {
5251
return patch, rc, nil
5352
}
5453

55-
func findPreviousTag(proposedTag string, tags []string) (string, error) {
56-
var previousTag string
57-
proposedMajor := semver.Major(proposedTag)
58-
proposedMinor := semver.MajorMinor(proposedTag)
59-
60-
proposedPatch, proposedRC, err := extractPatchAndRC(proposedTag)
61-
if err != nil {
62-
return "", err
54+
func removeInvalidTags(tags []string) []string {
55+
var validTags []string
56+
for _, tag := range tags {
57+
if _, _, err := extractPatchAndRC(tag); err == nil {
58+
validTags = append(validTags, tag)
59+
}
6360
}
61+
return validTags
62+
}
6463

65-
// If the current tag is a .0 patch release or a 1 release candidate, adjust to the previous minor release series.
66-
if (proposedPatch == "0" && proposedRC == "0") || proposedRC == "1" {
67-
proposedMinorInt, err := strconv.Atoi(strings.TrimPrefix(proposedMinor, proposedMajor+"."))
68-
if err != nil {
69-
return "", fmt.Errorf("invalid minor version: %v", err)
70-
}
71-
if proposedMinorInt > 0 {
72-
proposedMinor = fmt.Sprintf("%s.%d", proposedMajor, proposedMinorInt-1)
64+
func removeNewerOrEqualTags(proposedTag string, tags []string) []string {
65+
var validTags []string
66+
for _, tag := range tags {
67+
if semver.Compare(tag, proposedTag) < 0 {
68+
validTags = append(validTags, tag)
7369
}
7470
}
71+
return validTags
72+
}
7573

74+
func removeTagsFromSameMinorSeries(proposedTag string, tags []string) []string {
75+
var validTags []string
76+
proposedMinor := semver.MajorMinor(proposedTag)
7677
for _, tag := range tags {
77-
if tag == proposedTag {
78-
continue
79-
}
80-
tagMajor := semver.Major(tag)
81-
tagMinor := semver.MajorMinor(tag)
82-
tagPatch, tagRC, err := extractPatchAndRC(tag)
83-
if err != nil {
84-
continue
78+
if semver.MajorMinor(tag) != proposedMinor {
79+
validTags = append(validTags, tag)
8580
}
81+
}
82+
return validTags
83+
}
8684

87-
// Only bother considering tags with the same major and minor version.
88-
if tagMajor == proposedMajor && tagMinor == proposedMinor {
89-
// If it's a non-RC release...
90-
if proposedRC == "0" {
91-
// Only consider non-RC tags.
92-
if tagRC == "0" {
93-
if semver.Compare(tag, previousTag) > 0 {
94-
previousTag = tag
95-
}
96-
}
97-
} else {
98-
if tagRC != "0" && tagPatch == proposedPatch {
99-
if semver.Compare(tag, previousTag) > 0 {
100-
previousTag = tag
101-
}
102-
} else if tagRC == "0" {
103-
if semver.Compare(tag, previousTag) > 0 {
104-
previousTag = tag
105-
}
106-
}
107-
}
85+
func getMostRecentTag(tags []string) string {
86+
var mostRecentTag string
87+
for _, tag := range tags {
88+
if mostRecentTag == "" || semver.Compare(tag, mostRecentTag) > 0 {
89+
mostRecentTag = tag
10890
}
10991
}
92+
return mostRecentTag
93+
}
94+
95+
func findPreviousTag(proposedTag string, tags []string) (string, error) {
96+
tags = removeInvalidTags(tags)
97+
tags = removeNewerOrEqualTags(proposedTag, tags)
98+
99+
proposedPatch, proposedRC, _ := extractPatchAndRC(proposedTag) // Ignore the error, we already filtered out invalid tags.
100+
if proposedRC == "0" && proposedPatch == "0" {
101+
// If we're cutting the first patch of a new minor release series, don't consider tags in the same minor release
102+
// series. We want to compare to the latest tag in the previous minor release series.
103+
tags = removeTagsFromSameMinorSeries(proposedTag, tags)
104+
}
105+
106+
previousTag := getMostRecentTag(tags)
110107
if previousTag == "" {
111108
return "", fmt.Errorf("no matching tag found for tags: " + strings.Join(tags, ", "))
112109
}

hack/get-previous-release/get-previous-version-for-release-notes_test.go

+7
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,13 @@ func TestFindPreviousTagRules(t *testing.T) {
7676
{"Rule 3: 1 release candidate", "v2.14.0-rc1", "v2.13.0-rc3", false},
7777
// Rule 4: If we're releasing a non-1 release candidate, get the most recent rc tag on the current minor release series.
7878
{"Rule 4: non-1 release candidate", "v2.13.0-rc4", "v2.13.0-rc3", false},
79+
// Rule 5: If we're releasing a major version RC, get the most recent tag on the previous major release series.
80+
{"Rule 5: major version RC", "v3.0.0-rc1", "v2.13.0-rc3", false},
81+
// Rule 6: If we're releasing a major version, get the most recent tag on the previous major release series,
82+
// even if it's an RC.
83+
{"Rule 6: major version", "v3.0.0", "v2.13.0-rc3", false},
84+
// Rule 7: If the proposed tag already exists, don't return it.
85+
{"Rule 7: proposed tag already exists", "v2.12.5", "v2.12.4", false},
7986
}
8087

8188
for _, test := range tests {

hack/update-supported-versions.sh

+17-3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ argocd_minor_version=$(git rev-parse --abbrev-ref HEAD | sed 's/release-//')
77
argocd_major_version_num=$(echo "$argocd_minor_version" | sed -E 's/\.[0-9]+//')
88
argocd_minor_version_num=$(echo "$argocd_minor_version" | sed -E 's/[0-9]+\.//')
99

10-
for n in 0 1 2; do
11-
minor_version_num=$((argocd_minor_version_num - n))
10+
minor_version_decrement=0
11+
for _ in {1..3}; do
12+
minor_version_num=$((argocd_minor_version_num - minor_version_decrement))
1213
minor_version="${argocd_major_version_num}.${minor_version_num}"
1314
git checkout "release-$minor_version" > /dev/null || exit 1
1415

@@ -19,9 +20,22 @@ for n in 0 1 2; do
1920
jq --arg minor_version "$minor_version" --raw-input --slurp --raw-output \
2021
'split("\n")[:-1] | map(sub("\\.[0-9]+$"; "")) | join(", ") | "| \($minor_version) | \(.) |"')
2122
out+="$line\n"
23+
24+
minor_version_decrement=$((minor_version_decrement + 1))
25+
26+
# If we're at minor version 0, there's no further version back in this series. Instead, move to the latest version in
27+
# the previous major release series.
28+
if [ "$argocd_minor_version_num" -eq 0 ]; then
29+
argocd_major_version_num=$((argocd_major_version_num - 1))
30+
# Get the latest minor version in the previous series.
31+
argocd_minor_version_num=$(git tag -l "v$argocd_major_version_num.*" | sort -V | tail -n 1 | sed -E 's/\.[0-9]+$//' | sed -E 's/^v[0-9]+\.//')
32+
33+
# Don't decrement the minor version, since we're switching to the previous major release series. We want the latest
34+
# minor version in that series.
35+
minor_version_decrement=0
36+
fi
2237
done
2338

2439
git checkout "release-$argocd_minor_version"
2540

26-
2741
printf "$out" > docs/operator-manual/tested-kubernetes-versions.md

manifests/ha/base/redis-ha/chart/upstream.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1101,7 +1101,7 @@ spec:
11011101
fsGroup: 99
11021102
runAsNonRoot: true
11031103
runAsUser: 99
1104-
automountServiceAccountToken: false
1104+
automountServiceAccountToken: true
11051105
nodeSelector:
11061106
{}
11071107
tolerations:

manifests/ha/base/redis-ha/chart/values.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ redis-ha:
2121
checkInterval: 3s
2222
metrics:
2323
enabled: true
24+
serviceAccount:
25+
automountToken: true
2426
image:
2527
tag: 7.2.7-alpine
2628
sentinel:

manifests/ha/install-with-hydrator.yaml

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

manifests/ha/install.yaml

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

manifests/ha/namespace-install-with-hydrator.yaml

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

manifests/ha/namespace-install.yaml

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

test/e2e/fixture/account/actions.go

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package project
22

33
import (
4+
"time"
5+
46
"github.com/stretchr/testify/require"
57

68
"github.com/argoproj/argo-cd/v3/test/e2e/fixture"
@@ -81,5 +83,6 @@ func (a *Actions) runCli(args ...string) {
8183

8284
func (a *Actions) Then() *Consequences {
8385
a.context.t.Helper()
86+
time.Sleep(fixture.WhenThenSleepInterval)
8487
return &Consequences{a.context, a}
8588
}

test/e2e/fixture/account/consequences.go

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package project
33
import (
44
"context"
55
"errors"
6+
"time"
67

78
"github.com/stretchr/testify/require"
89

@@ -64,5 +65,6 @@ func (c *Consequences) Given() *Context {
6465
}
6566

6667
func (c *Consequences) When() *Actions {
68+
time.Sleep(fixture.WhenThenSleepInterval)
6769
return c.actions
6870
}

test/e2e/fixture/account/context.go

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package project
22

33
import (
44
"testing"
5+
"time"
56

67
"github.com/argoproj/argo-cd/v3/test/e2e/fixture"
78
"github.com/argoproj/argo-cd/v3/util/env"
@@ -45,5 +46,6 @@ func (c *Context) And(block func()) *Context {
4546
}
4647

4748
func (c *Context) When() *Actions {
49+
time.Sleep(fixture.WhenThenSleepInterval)
4850
return &Actions{context: c}
4951
}

test/e2e/fixture/admin/actions.go

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package admin
22

33
import (
4+
"time"
5+
46
"github.com/argoproj/argo-cd/v3/test/e2e/fixture"
57
)
68

@@ -63,5 +65,6 @@ func (a *Actions) runCliWithStdin(stdin string, args ...string) {
6365

6466
func (a *Actions) Then() *Consequences {
6567
a.context.t.Helper()
68+
time.Sleep(fixture.WhenThenSleepInterval)
6669
return &Consequences{a.context, a}
6770
}

test/e2e/fixture/admin/consequences.go

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
package admin
22

33
import (
4+
"time"
5+
6+
"github.com/argoproj/argo-cd/v3/test/e2e/fixture"
47
. "github.com/argoproj/argo-cd/v3/test/e2e/fixture/admin/utils"
58
)
69

@@ -33,5 +36,6 @@ func (c *Consequences) Given() *Context {
3336
}
3437

3538
func (c *Consequences) When() *Actions {
39+
time.Sleep(fixture.WhenThenSleepInterval)
3640
return c.actions
3741
}

test/e2e/fixture/admin/context.go

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package admin
22

33
import (
44
"testing"
5+
"time"
56

67
"github.com/argoproj/argo-cd/v3/test/e2e/fixture"
78
"github.com/argoproj/argo-cd/v3/util/env"
@@ -39,5 +40,6 @@ func (c *Context) And(block func()) *Context {
3940
}
4041

4142
func (c *Context) When() *Actions {
43+
time.Sleep(fixture.WhenThenSleepInterval)
4244
return &Actions{context: c}
4345
}

test/e2e/fixture/app/actions.go

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"os"
77
"slices"
88
"strconv"
9+
"time"
910

1011
rbacv1 "k8s.io/api/rbac/v1"
1112

@@ -492,6 +493,7 @@ func (a *Actions) And(block func()) *Actions {
492493

493494
func (a *Actions) Then() *Consequences {
494495
a.context.t.Helper()
496+
time.Sleep(fixture.WhenThenSleepInterval)
495497
return &Consequences{a.context, a, 15}
496498
}
497499

test/e2e/fixture/app/consequences.go

+1
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ func (c *Consequences) Given() *Context {
101101
}
102102

103103
func (c *Consequences) When() *Actions {
104+
time.Sleep(fixture.WhenThenSleepInterval)
104105
return c.actions
105106
}
106107

test/e2e/fixture/app/context.go

+1
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,7 @@ func (c *Context) And(block func()) *Context {
349349
}
350350

351351
func (c *Context) When() *Actions {
352+
time.Sleep(fixture.WhenThenSleepInterval)
352353
return &Actions{context: c}
353354
}
354355

0 commit comments

Comments
 (0)