Compare commits

...

6 Commits

Author SHA1 Message Date
github-actions[bot]
9c3b45f5da Bump version to 2.12.8 (#21134)
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: ishitasequeira <46771830+ishitasequeira@users.noreply.github.com>
2024-12-11 20:26:59 +05:30
Blake Pettersson
7642db8ddf fix: add missing fields in listrepositories (#20991) (#21128)
This fixes a regression in 2.12. Before 2.12 githubAppInstallationID,
`githubAppID` and `gitHubAppEnterpriseBaseURL` were returned, but with
2.12 the repo is retrieved with getRepositories`, which does not
include those fields.

To fix this, add those missing fields to `ListRepositories`.

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
2024-12-11 13:35:07 +01:00
gcp-cherry-pick-bot[bot]
60d0786c82 fix: Allow to delete repos with invalid urls (#20921) (#20975) (#21117)
* fix: Allow to delete repos with invalid urls (#20921)

Fixes #20921

Normalization of repo url is attempted during repo deletion before comparison with existing repos. Before this change, it'd fail on invalid urls and return "", resulting in permission denied. This ended up in a state where people can add repos with invalid urls but couldn't delete them. Return raw repo url if url parsing failed. Add a test to validate the deletion can be performed and make sure it fails without the main change.

This needs to be cherry-picked to v2.11-2.13



* Don't modify the original NormalizeGitURL



---------

Signed-off-by: Andrii Korotkov <andrii.korotkov@verkada.com>
Co-authored-by: Andrii Korotkov <137232734+andrii-korotkov-verkada@users.noreply.github.com>
2024-12-10 16:29:11 +02:00
gcp-cherry-pick-bot[bot]
05c1dd7d60 fix: 20791 - sync multi-source application out of order source syncs (cherry-pick #21071) (#21078)
Signed-off-by: Ishita Sequeira <ishiseq29@gmail.com>
Co-authored-by: Ishita Sequeira <46771830+ishitasequeira@users.noreply.github.com>
2024-12-05 11:15:06 -07:00
gcp-cherry-pick-bot[bot]
b32d50da45 chore(deps): bump http-proxy-middleware from 2.0.4 to 2.0.7 in /ui (#20518) (#20891)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-21 08:44:28 -05:00
Eric Fletcher
57cef1d140 Add missing 2.12 upgrade to nav menu (#20657)
Signed-off-by: Eric Fletcher <fletch3555@users.noreply.github.com>
2024-11-05 20:06:49 +01:00
16 changed files with 106 additions and 59 deletions

View File

@@ -1 +1 @@
2.12.7
2.12.8

View File

@@ -5,7 +5,7 @@ kind: Kustomization
images:
- name: quay.io/argoproj/argocd
newName: quay.io/argoproj/argocd
newTag: v2.12.7
newTag: v2.12.8
resources:
- ./application-controller
- ./dex

View File

@@ -21280,7 +21280,7 @@ spec:
key: applicationsetcontroller.enable.scm.providers
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.12.7
image: quay.io/argoproj/argocd:v2.12.8
imagePullPolicy: Always
name: argocd-applicationset-controller
ports:
@@ -21398,7 +21398,7 @@ spec:
- argocd
- admin
- redis-initial-password
image: quay.io/argoproj/argocd:v2.12.7
image: quay.io/argoproj/argocd:v2.12.8
imagePullPolicy: IfNotPresent
name: secret-init
securityContext:
@@ -21651,7 +21651,7 @@ spec:
value: /helm-working-dir
- name: HELM_DATA_HOME
value: /helm-working-dir
image: quay.io/argoproj/argocd:v2.12.7
image: quay.io/argoproj/argocd:v2.12.8
imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
@@ -21703,7 +21703,7 @@ spec:
- -n
- /usr/local/bin/argocd
- /var/run/argocd/argocd-cmp-server
image: quay.io/argoproj/argocd:v2.12.7
image: quay.io/argoproj/argocd:v2.12.8
name: copyutil
securityContext:
allowPrivilegeEscalation: false
@@ -21993,7 +21993,7 @@ spec:
key: controller.ignore.normalizer.jq.timeout
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.12.7
image: quay.io/argoproj/argocd:v2.12.8
imagePullPolicy: Always
name: argocd-application-controller
ports:

View File

@@ -12,4 +12,4 @@ resources:
images:
- name: quay.io/argoproj/argocd
newName: quay.io/argoproj/argocd
newTag: v2.12.7
newTag: v2.12.8

View File

@@ -12,7 +12,7 @@ patches:
images:
- name: quay.io/argoproj/argocd
newName: quay.io/argoproj/argocd
newTag: v2.12.7
newTag: v2.12.8
resources:
- ../../base/application-controller
- ../../base/applicationset-controller

View File

@@ -22623,7 +22623,7 @@ spec:
key: applicationsetcontroller.enable.scm.providers
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.12.7
image: quay.io/argoproj/argocd:v2.12.8
imagePullPolicy: Always
name: argocd-applicationset-controller
ports:
@@ -22746,7 +22746,7 @@ spec:
- -n
- /usr/local/bin/argocd
- /shared/argocd-dex
image: quay.io/argoproj/argocd:v2.12.7
image: quay.io/argoproj/argocd:v2.12.8
imagePullPolicy: Always
name: copyutil
securityContext:
@@ -22828,7 +22828,7 @@ spec:
key: notificationscontroller.selfservice.enabled
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.12.7
image: quay.io/argoproj/argocd:v2.12.8
imagePullPolicy: Always
livenessProbe:
tcpSocket:
@@ -22947,7 +22947,7 @@ spec:
- argocd
- admin
- redis-initial-password
image: quay.io/argoproj/argocd:v2.12.7
image: quay.io/argoproj/argocd:v2.12.8
imagePullPolicy: IfNotPresent
name: secret-init
securityContext:
@@ -23228,7 +23228,7 @@ spec:
value: /helm-working-dir
- name: HELM_DATA_HOME
value: /helm-working-dir
image: quay.io/argoproj/argocd:v2.12.7
image: quay.io/argoproj/argocd:v2.12.8
imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
@@ -23280,7 +23280,7 @@ spec:
- -n
- /usr/local/bin/argocd
- /var/run/argocd/argocd-cmp-server
image: quay.io/argoproj/argocd:v2.12.7
image: quay.io/argoproj/argocd:v2.12.8
name: copyutil
securityContext:
allowPrivilegeEscalation: false
@@ -23604,7 +23604,7 @@ spec:
key: server.api.content.types
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.12.7
image: quay.io/argoproj/argocd:v2.12.8
imagePullPolicy: Always
livenessProbe:
httpGet:
@@ -23921,7 +23921,7 @@ spec:
key: controller.ignore.normalizer.jq.timeout
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.12.7
image: quay.io/argoproj/argocd:v2.12.8
imagePullPolicy: Always
name: argocd-application-controller
ports:

View File

@@ -1688,7 +1688,7 @@ spec:
key: applicationsetcontroller.enable.scm.providers
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.12.7
image: quay.io/argoproj/argocd:v2.12.8
imagePullPolicy: Always
name: argocd-applicationset-controller
ports:
@@ -1811,7 +1811,7 @@ spec:
- -n
- /usr/local/bin/argocd
- /shared/argocd-dex
image: quay.io/argoproj/argocd:v2.12.7
image: quay.io/argoproj/argocd:v2.12.8
imagePullPolicy: Always
name: copyutil
securityContext:
@@ -1893,7 +1893,7 @@ spec:
key: notificationscontroller.selfservice.enabled
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.12.7
image: quay.io/argoproj/argocd:v2.12.8
imagePullPolicy: Always
livenessProbe:
tcpSocket:
@@ -2012,7 +2012,7 @@ spec:
- argocd
- admin
- redis-initial-password
image: quay.io/argoproj/argocd:v2.12.7
image: quay.io/argoproj/argocd:v2.12.8
imagePullPolicy: IfNotPresent
name: secret-init
securityContext:
@@ -2293,7 +2293,7 @@ spec:
value: /helm-working-dir
- name: HELM_DATA_HOME
value: /helm-working-dir
image: quay.io/argoproj/argocd:v2.12.7
image: quay.io/argoproj/argocd:v2.12.8
imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
@@ -2345,7 +2345,7 @@ spec:
- -n
- /usr/local/bin/argocd
- /var/run/argocd/argocd-cmp-server
image: quay.io/argoproj/argocd:v2.12.7
image: quay.io/argoproj/argocd:v2.12.8
name: copyutil
securityContext:
allowPrivilegeEscalation: false
@@ -2669,7 +2669,7 @@ spec:
key: server.api.content.types
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.12.7
image: quay.io/argoproj/argocd:v2.12.8
imagePullPolicy: Always
livenessProbe:
httpGet:
@@ -2986,7 +2986,7 @@ spec:
key: controller.ignore.normalizer.jq.timeout
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.12.7
image: quay.io/argoproj/argocd:v2.12.8
imagePullPolicy: Always
name: argocd-application-controller
ports:

View File

@@ -21740,7 +21740,7 @@ spec:
key: applicationsetcontroller.enable.scm.providers
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.12.7
image: quay.io/argoproj/argocd:v2.12.8
imagePullPolicy: Always
name: argocd-applicationset-controller
ports:
@@ -21863,7 +21863,7 @@ spec:
- -n
- /usr/local/bin/argocd
- /shared/argocd-dex
image: quay.io/argoproj/argocd:v2.12.7
image: quay.io/argoproj/argocd:v2.12.8
imagePullPolicy: Always
name: copyutil
securityContext:
@@ -21945,7 +21945,7 @@ spec:
key: notificationscontroller.selfservice.enabled
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.12.7
image: quay.io/argoproj/argocd:v2.12.8
imagePullPolicy: Always
livenessProbe:
tcpSocket:
@@ -22045,7 +22045,7 @@ spec:
- argocd
- admin
- redis-initial-password
image: quay.io/argoproj/argocd:v2.12.7
image: quay.io/argoproj/argocd:v2.12.8
imagePullPolicy: IfNotPresent
name: secret-init
securityContext:
@@ -22298,7 +22298,7 @@ spec:
value: /helm-working-dir
- name: HELM_DATA_HOME
value: /helm-working-dir
image: quay.io/argoproj/argocd:v2.12.7
image: quay.io/argoproj/argocd:v2.12.8
imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
@@ -22350,7 +22350,7 @@ spec:
- -n
- /usr/local/bin/argocd
- /var/run/argocd/argocd-cmp-server
image: quay.io/argoproj/argocd:v2.12.7
image: quay.io/argoproj/argocd:v2.12.8
name: copyutil
securityContext:
allowPrivilegeEscalation: false
@@ -22672,7 +22672,7 @@ spec:
key: server.api.content.types
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.12.7
image: quay.io/argoproj/argocd:v2.12.8
imagePullPolicy: Always
livenessProbe:
httpGet:
@@ -22989,7 +22989,7 @@ spec:
key: controller.ignore.normalizer.jq.timeout
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.12.7
image: quay.io/argoproj/argocd:v2.12.8
imagePullPolicy: Always
name: argocd-application-controller
ports:

View File

@@ -805,7 +805,7 @@ spec:
key: applicationsetcontroller.enable.scm.providers
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.12.7
image: quay.io/argoproj/argocd:v2.12.8
imagePullPolicy: Always
name: argocd-applicationset-controller
ports:
@@ -928,7 +928,7 @@ spec:
- -n
- /usr/local/bin/argocd
- /shared/argocd-dex
image: quay.io/argoproj/argocd:v2.12.7
image: quay.io/argoproj/argocd:v2.12.8
imagePullPolicy: Always
name: copyutil
securityContext:
@@ -1010,7 +1010,7 @@ spec:
key: notificationscontroller.selfservice.enabled
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.12.7
image: quay.io/argoproj/argocd:v2.12.8
imagePullPolicy: Always
livenessProbe:
tcpSocket:
@@ -1110,7 +1110,7 @@ spec:
- argocd
- admin
- redis-initial-password
image: quay.io/argoproj/argocd:v2.12.7
image: quay.io/argoproj/argocd:v2.12.8
imagePullPolicy: IfNotPresent
name: secret-init
securityContext:
@@ -1363,7 +1363,7 @@ spec:
value: /helm-working-dir
- name: HELM_DATA_HOME
value: /helm-working-dir
image: quay.io/argoproj/argocd:v2.12.7
image: quay.io/argoproj/argocd:v2.12.8
imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
@@ -1415,7 +1415,7 @@ spec:
- -n
- /usr/local/bin/argocd
- /var/run/argocd/argocd-cmp-server
image: quay.io/argoproj/argocd:v2.12.7
image: quay.io/argoproj/argocd:v2.12.8
name: copyutil
securityContext:
allowPrivilegeEscalation: false
@@ -1737,7 +1737,7 @@ spec:
key: server.api.content.types
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.12.7
image: quay.io/argoproj/argocd:v2.12.8
imagePullPolicy: Always
livenessProbe:
httpGet:
@@ -2054,7 +2054,7 @@ spec:
key: controller.ignore.normalizer.jq.timeout
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.12.7
image: quay.io/argoproj/argocd:v2.12.8
imagePullPolicy: Always
name: argocd-application-controller
ports:

View File

@@ -128,6 +128,7 @@ nav:
- operator-manual/server-commands/additional-configuration-method.md
- Upgrading:
- operator-manual/upgrading/overview.md
- operator-manual/upgrading/2.11-2.12.md
- operator-manual/upgrading/2.10-2.11.md
- operator-manual/upgrading/2.9-2.10.md
- operator-manual/upgrading/2.8-2.9.md

View File

@@ -2210,7 +2210,7 @@ func getAmbiguousRevision(app *appv1.Application, syncReq *application.Applicati
ambiguousRevision := ""
if app.Spec.HasMultipleSources() {
for i, pos := range syncReq.SourcePositions {
if pos == int64(sourceIndex) {
if pos == int64(sourceIndex+1) {
ambiguousRevision = syncReq.Revisions[i]
}
}

View File

@@ -2919,7 +2919,7 @@ func TestGetAmbiguousRevision_MultiSource(t *testing.T) {
},
}
syncReq := &application.ApplicationSyncRequest{
SourcePositions: []int64{0, 1},
SourcePositions: []int64{1, 2},
Revisions: []string{"rev1", "rev2"},
}

View File

@@ -188,17 +188,20 @@ func (s *Server) ListRepositories(ctx context.Context, q *repositorypkg.RepoQuer
}
// remove secrets
items = append(items, &appsv1.Repository{
Repo: repo.Repo,
Type: rType,
Name: repo.Name,
Username: repo.Username,
Insecure: repo.IsInsecure(),
EnableLFS: repo.EnableLFS,
EnableOCI: repo.EnableOCI,
Proxy: repo.Proxy,
Project: repo.Project,
ForceHttpBasicAuth: repo.ForceHttpBasicAuth,
InheritedCreds: repo.InheritedCreds,
Repo: repo.Repo,
Type: rType,
Name: repo.Name,
Username: repo.Username,
Insecure: repo.IsInsecure(),
EnableLFS: repo.EnableLFS,
EnableOCI: repo.EnableOCI,
Proxy: repo.Proxy,
Project: repo.Project,
ForceHttpBasicAuth: repo.ForceHttpBasicAuth,
InheritedCreds: repo.InheritedCreds,
GithubAppId: repo.GithubAppId,
GithubAppInstallationId: repo.GithubAppInstallationId,
GitHubAppEnterpriseBaseURL: repo.GitHubAppEnterpriseBaseURL,
})
}
}

View File

@@ -21,6 +21,7 @@ import (
"github.com/argoproj/argo-cd/v2/common"
"github.com/argoproj/argo-cd/v2/pkg/apiclient/repository"
repositorypkg "github.com/argoproj/argo-cd/v2/pkg/apiclient/repository"
appsv1 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
fakeapps "github.com/argoproj/argo-cd/v2/pkg/client/clientset/versioned/fake"
appinformer "github.com/argoproj/argo-cd/v2/pkg/client/informers/externalversions"
@@ -1057,3 +1058,35 @@ func TestGetRepository(t *testing.T) {
})
}
}
func TestDeleteRepository(t *testing.T) {
repositories := map[string]string{
"valid": "https://bitbucket.org/workspace/repo.git",
// Check a wrongly formatter repo as well, see https://github.com/argoproj/argo-cd/issues/20921
"invalid": "git clone https://bitbucket.org/workspace/repo.git",
}
kubeclientset := fake.NewSimpleClientset(&argocdCM, &argocdSecret)
settingsMgr := settings.NewSettingsManager(context.Background(), kubeclientset, testNamespace)
for name, repo := range repositories {
t.Run(name, func(t *testing.T) {
repoServerClient := mocks.RepoServerServiceClient{}
repoServerClient.On("TestRepository", mock.Anything, mock.Anything).Return(&apiclient.TestRepositoryResponse{}, nil)
repoServerClientset := mocks.Clientset{RepoServerServiceClient: &repoServerClient}
enforcer := newEnforcer(kubeclientset)
db := &dbmocks.ArgoDB{}
db.On("DeleteRepository", context.TODO(), repo, "default").Return(nil)
db.On("ListRepositories", context.TODO()).Return([]*appsv1.Repository{{Repo: repo, Project: "default"}}, nil)
db.On("GetRepository", context.TODO(), repo, "default").Return(&appsv1.Repository{Repo: repo, Project: "default"}, nil)
appLister, projLister := newAppAndProjLister(defaultProj)
s := NewServer(&repoServerClientset, db, enforcer, newFixtures().Cache, appLister, projLister, testNamespace, settingsMgr)
resp, err := s.DeleteRepository(context.TODO(), &repository.RepoQuery{Repo: repo, AppProject: "default"})
require.NoError(t, err)
assert.Equal(t, repositorypkg.RepoResponse{}, *resp)
})
}
}

View File

@@ -5658,9 +5658,9 @@ http-proxy-agent@^5.0.0:
debug "4"
http-proxy-middleware@^2.0.0:
version "2.0.4"
resolved "https://registry.yarnpkg.com/http-proxy-middleware/-/http-proxy-middleware-2.0.4.tgz#03af0f4676d172ae775cb5c33f592f40e1a4e07a"
integrity sha512-m/4FxX17SUvz4lJ5WPXOHDUuCwIqXLfLHs1s0uZ3oYjhoXlx9csYxaOa0ElDEJ+h8Q4iJ1s+lTMbiCa4EXIJqg==
version "2.0.7"
resolved "https://registry.yarnpkg.com/http-proxy-middleware/-/http-proxy-middleware-2.0.7.tgz#915f236d92ae98ef48278a95dedf17e991936ec6"
integrity sha512-fgVY8AV7qU7z/MmXJ/rxwbrtQH4jBQ9m7kp3llF0liB7glmFeVZFBepQb32T3y8n8k2+AEYuMPCpinYW+/CuRA==
dependencies:
"@types/http-proxy" "^1.17.8"
http-proxy "^1.18.1"

View File

@@ -35,11 +35,21 @@ func IsTruncatedCommitSHA(sha string) bool {
// SameURL returns whether or not the two repository URLs are equivalent in location
func SameURL(leftRepo, rightRepo string) bool {
normalLeft := NormalizeGitURL(leftRepo)
normalRight := NormalizeGitURL(rightRepo)
normalLeft := NormalizeGitURLAllowInvalid(leftRepo)
normalRight := NormalizeGitURLAllowInvalid(rightRepo)
return normalLeft != "" && normalRight != "" && normalLeft == normalRight
}
// Similar to NormalizeGitURL, except returning an original url if the url is invalid.
// Needed to allow a deletion of repos with invalid urls. See https://github.com/argoproj/argo-cd/issues/20921.
func NormalizeGitURLAllowInvalid(repo string) string {
normalized := NormalizeGitURL(repo)
if normalized == "" {
return repo
}
return normalized
}
// NormalizeGitURL normalizes a git URL for purposes of comparison, as well as preventing redundant
// local clones (by normalizing various forms of a URL to a consistent location).
// Prefer using SameURL() over this function when possible. This algorithm may change over time