Compare commits

...

624 Commits

Author SHA1 Message Date
Alexandre Gaudreault
0e4115e6fd test 2024-08-12 12:16:38 -04:00
Ilia Lazebnik
539a3e33fa chore(deps): bump dex to 2.41.1 (#19484)
Signed-off-by: drfaust92 <ilia.lazebnik@gmail.com>
2024-08-12 09:39:49 -04:00
github-actions[bot]
0e0a9ebdf1 [Bot] docs: Update Snyk reports (#19475)
Signed-off-by: CI <ci@argoproj.com>
Co-authored-by: CI <ci@argoproj.com>
2024-08-11 09:22:39 -04:00
l2h
dad6fa22d5 feat: Implement graceful shutdown in application-controller (#19465)
* Implement graceful shutdown in argocd-application-controller

Signed-off-by: leehosu <hosu4549@gmail.com>

* Implement code to pass waitGroup to Run function

Signed-off-by: leehosu <hosu4549@gmail.com>

* Add retuen nil

Signed-off-by: leehosu <hosu4549@gmail.com>

* Add log for lean shutdown

Signed-off-by: leehosu <hosu4549@gmail.com>

* collect e2e coverage from app-controller

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* Remove select {}

Signed-off-by: leehosu <hosu4549@gmail.com>

* Add ctx.done() about application-controller

Signed-off-by: leehosu <hosu4549@gmail.com>

* simplify

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

---------

Signed-off-by: leehosu <hosu4549@gmail.com>
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-08-10 20:17:26 -04:00
Michael Crenshaw
bdb2608993 chore: remove dead code (#19460)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-08-09 16:57:00 -04:00
Michael Crenshaw
1dd2821631 feat: collect and log hydration commands (#19346)
* feat: collect and log hydration commands

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* fix tests

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* don't actually log for now

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* add helm test, handle random values file path

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* fix test

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* simplify; only return commands on success; only return helm template command, not helm dependency

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* kustomize test

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* only return commands on success, to match Helm

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* fix import order

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* simplify, since we're not collecting non-template Helm commands

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* lint

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* fixes from comments

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

---------

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-08-09 16:06:58 +00:00
Michael Crenshaw
5ccea0d4ab chore: remove dead Helm version code (#19449)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-08-09 08:37:18 -04:00
TomasR
992716b12c fix: datasource in dashboard.json (#19426)
Other panels have properly set `"uid": "$datasource"`, but for some reason, this doesn't.
Let's fix it.

Signed-off-by: TomasR <linux@rohlik.xyz>
2024-08-09 14:52:51 +05:30
Doug Goldstein
d56206fb4e doc: fix typo in generators post selector (#19448)
Fix typo in the word

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
2024-08-08 18:18:41 -06:00
Leonardo Luz Almeida
b21768d9d9 docs: Improve AppProject roles documentation (#19445)
* docs: Improve AppProject roles documentation

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* add notes

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* small change

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* fix typo

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* address comment

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

---------

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
2024-08-08 20:03:36 +00:00
Maryam Tavakkoli
3091db84d3 docs: Add Relex Solutions to USERS.md (#19444)
Signed-off-by: Maryam Tavakkoli <maryam_tavakkoli@hotmail.com>
2024-08-08 13:36:35 -04:00
dependabot[bot]
f17c6c1dde chore(deps): bump sigstore/cosign-installer from 3.5.0 to 3.6.0 (#19433)
Bumps [sigstore/cosign-installer](https://github.com/sigstore/cosign-installer) from 3.5.0 to 3.6.0.
- [Release notes](https://github.com/sigstore/cosign-installer/releases)
- [Commits](59acb6260d...4959ce089c)

---
updated-dependencies:
- dependency-name: sigstore/cosign-installer
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-08 10:24:53 -04:00
dependabot[bot]
a21980cde6 chore(deps): bump docker/build-push-action from 6.5.0 to 6.6.1 (#19432)
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 6.5.0 to 6.6.1.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](5176d81f87...16ebe778df)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-08 10:24:22 -04:00
dependabot[bot]
80e85967e5 chore(deps): bump library/golang from 1.22.5 to 1.22.6 (#19434)
Bumps library/golang from 1.22.5 to 1.22.6.

---
updated-dependencies:
- dependency-name: library/golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-08 04:51:19 +00:00
Dmitry Khodorov
ed14baab81 fix(appset): missing permissions for cluster install (#19059) (#19430)
Signed-off-by: Dmitry Khodorov <el1191@woyd.ru>
2024-08-08 00:33:33 -04:00
KangManJoo
1a94032408 chore: improve error logs (#10592) (#19260)
* chore: wrapped all errors and add context in account.go

Signed-off-by: KangManJoo <eogns47@konkuk.ac.kr>

* chore: rollback error msg

Signed-off-by: KangManJoo <eogns47@konkuk.ac.kr>

* chore: To align the test code error messages with the actual error message returned.

Signed-off-by: KangManJoo <eogns47@konkuk.ac.kr>

---------

Signed-off-by: KangManJoo <eogns47@konkuk.ac.kr>
2024-08-08 00:32:37 -04:00
Kevin
74bbc4f7f1 feat: Add source namespaces output to printProject function (#19365)
Signed-off-by: Juwon Hwang (Kevin) <juwon8891@gmail.com>
2024-08-07 20:39:16 -04:00
Vinícius Fernandes
6205f97772 docs: update users.md (#19282)
* Update USERS.md

Signed-off-by: Vinícius Fernandes <vinaumpt@gmail.com>

* Update USERS.md

Fix ordering.

Signed-off-by: Vinícius Fernandes <vinaumpt@gmail.com>

---------

Signed-off-by: Vinícius Fernandes <vinaumpt@gmail.com>
Co-authored-by: Soumya Ghosh Dastidar <44349253+gdsoumya@users.noreply.github.com>
2024-08-07 20:36:41 -04:00
Robin Lieb
4f64f0f2f2 feat: move basic auth for for Azure DevOps to webhooks lib (#19407)
Signed-off-by: Robin Lieb <robin.j.lieb@gmail.com>
2024-08-07 16:25:23 +00:00
dependabot[bot]
da1e95dbe1 chore(deps): bump actions/upload-artifact from 4.3.5 to 4.3.6 (#19415)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.3.5 to 4.3.6.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](89ef406dd8...834a144ee9)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-07 10:19:02 -04:00
dependabot[bot]
658311d554 chore(deps): bump github.com/go-playground/webhooks/v6 (#19418)
Bumps [github.com/go-playground/webhooks/v6](https://github.com/go-playground/webhooks) from 6.3.0 to 6.4.0.
- [Release notes](https://github.com/go-playground/webhooks/releases)
- [Commits](https://github.com/go-playground/webhooks/compare/v6.3.0...v6.4.0)

---
updated-dependencies:
- dependency-name: github.com/go-playground/webhooks/v6
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-07 10:18:37 -04:00
dependabot[bot]
8a8c28fcb4 chore(deps): bump golang.org/x/net from 0.27.0 to 0.28.0 (#19421)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.27.0 to 0.28.0.
- [Commits](https://github.com/golang/net/compare/v0.27.0...v0.28.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-07 10:17:20 -04:00
Michael Crenshaw
82e5363634 fix: handle logging empty args in strings (#19324)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-08-06 16:41:35 -04:00
Michael Crenshaw
21ed19b366 feat(helm): support --kube-version, --api-versions, and --namespace (#19325) (#19328)
* feat(helm): support `--kube-version`, `--api-versions`, and `--namespace` (#19325)

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* codegen

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* handle kube and api versions per-source

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* lint

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* fix nil ref error

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* fix nil ref error due to not handling multi-source in verify path

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* change casing to be more consistent with helm

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* Kustomize too

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* simplify verify path

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* add e2e tests for kustomize

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* reorder for consistency, and add more tests

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* Update docs/operator-manual/application.yaml

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

---------

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>
Co-authored-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>
2024-08-06 10:56:36 -04:00
Regina Voloshin
a96e665598 fixing dubious ownership error (#19400)
Signed-off-by: reggie-k <regina.voloshin@codefresh.io>
2024-08-06 17:47:31 +03:00
Bernhard Rode
d61f18df22 chore: add Robert Bosch GmbH (#19388)
Signed-off-by: Bernhard Rode <rbo2abt@bosch.com>
2024-08-06 13:14:26 +05:30
Georgi Dimitrov
79ce7c811b chore: add Skribble to USERS.md (#19361)
* Update USERS.md

Add Skribble AG

Signed-off-by: Georgi Dimitrov <122033253+georgi-at-skribble@users.noreply.github.com>

* Update USERS.md

Reorder to match alphabetical order

Signed-off-by: Georgi Dimitrov <122033253+georgi-at-skribble@users.noreply.github.com>

---------

Signed-off-by: Georgi Dimitrov <122033253+georgi-at-skribble@users.noreply.github.com>
2024-08-06 08:47:20 +05:30
dependabot[bot]
2db38409ee chore(deps): bump golang.org/x/oauth2 from 0.21.0 to 0.22.0 (#19378)
Bumps [golang.org/x/oauth2](https://github.com/golang/oauth2) from 0.21.0 to 0.22.0.
- [Commits](https://github.com/golang/oauth2/compare/v0.21.0...v0.22.0)

---
updated-dependencies:
- dependency-name: golang.org/x/oauth2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-05 10:59:40 +03:00
dependabot[bot]
e04d7cb578 chore(deps-dev): bump @types/node from 20.14.12 to 22.1.0 in /ui-test (#19376)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.14.12 to 22.1.0.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-05 09:14:10 +03:00
dependabot[bot]
34d06096e5 chore(deps): bump actions/upload-artifact from 4.3.4 to 4.3.5 (#19380)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.3.4 to 4.3.5.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](0b2256b8c0...89ef406dd8)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-05 09:13:49 +03:00
dependabot[bot]
5403f956e4 chore(deps): bump golang.org/x/time from 0.5.0 to 0.6.0 (#19377)
Bumps [golang.org/x/time](https://github.com/golang/time) from 0.5.0 to 0.6.0.
- [Commits](https://github.com/golang/time/compare/v0.5.0...v0.6.0)

---
updated-dependencies:
- dependency-name: golang.org/x/time
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-05 09:11:54 +03:00
dependabot[bot]
e9d6431780 chore(deps): bump golang.org/x/sync from 0.7.0 to 0.8.0 (#19379)
Bumps [golang.org/x/sync](https://github.com/golang/sync) from 0.7.0 to 0.8.0.
- [Commits](https://github.com/golang/sync/compare/v0.7.0...v0.8.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sync
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-05 09:11:40 +03:00
pengbanban
dc544da6ae chore: fix function names (#19371)
Signed-off-by: pengbanban <pengbanban@aliyun.com>
2024-08-04 12:48:46 -07:00
github-actions[bot]
5188ea2969 [Bot] docs: Update Snyk reports (#19367)
Signed-off-by: CI <ci@argoproj.com>
Co-authored-by: CI <ci@argoproj.com>
2024-08-04 17:51:25 +00:00
Aleksander Korzynski
e83abdace8 docs: add Priceline to USERS.md (#19364)
Signed-off-by: Aleksander Korzynski <89802643+akorzy-pl@users.noreply.github.com>
2024-08-03 20:51:40 +05:30
itaiatu
f110570512 feat: Add custom health check for cluster-api AWSManagedControlPlane (#19304)
* add custom health check for awsmanagedcontrolplane

Signed-off-by: Iulian Taiatu <itaiatu@adobe.com>

* chore(deps): bump github.com/aws/aws-sdk-go from 1.55.3 to 1.55.4 (#19295)

Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.55.3 to 1.55.4.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.55.3...v1.55.4)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: Iulian Taiatu <itaiatu@adobe.com>

* add new line at the end of health_test.yaml file

Signed-off-by: Iulian Taiatu <itaiatu@adobe.com>

---------

Signed-off-by: Iulian Taiatu <itaiatu@adobe.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-02 10:54:00 -07:00
Andrii Korotkov
4a7a82cdba chore: Update kustomize to v5.4.3 (#19133) (#19357)
Fixes #19133

A critical vulnerability CVE-2024-24790 was discovered in previous version of kustomize due to stdlib dependency. Bump the version to one without this vulnerability.

Signed-off-by: Andrii Korotkov <andrii.korotkov@verkada.com>
2024-08-02 11:42:47 -04:00
Alexander Matyushentsev
b5a3712303 fix: ArgoCD 2.11 - Loop of PATCH calls to Application objects (#19340)
Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
2024-08-01 14:55:55 -04:00
Michael Crenshaw
db02eaa7e0 feat(askpass): make askpass socket path configurable (#19313)
* feat(askpass): make askpass socket path configurable

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* remove unused const

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* remove unnecessary fmt call

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

---------

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-08-01 13:12:41 -04:00
Alexandre Gaudreault
6ee584594a feat(rbac): allow validation of fine-grained policy in project (#19338)
Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>
2024-08-01 10:37:25 -04:00
dependabot[bot]
60c53c6fc4 chore(deps): bump tj-actions/changed-files from 44.5.6 to 44.5.7 (#19331)
Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 44.5.6 to 44.5.7.
- [Release notes](https://github.com/tj-actions/changed-files/releases)
- [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md)
- [Commits](6b2903bdce...c65cd88342)

---
updated-dependencies:
- dependency-name: tj-actions/changed-files
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-01 04:00:20 +00:00
Alexander Matyushentsev
26fb098ae8 feat!: disable profile endpoint by default (#19327)
* feat: disable metrics endpoint by default

Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>

* support managing the profile endpoint in argocd-cmd-params-cm

Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>

* return 401 if profile endpoint is disabled

Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>

---------

Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
2024-07-31 23:13:33 +00:00
Andrii Korotkov
267f243a89 fix: Put app to the operation queue after refresh queue processing to avoid race condition - Fixes [#18500] (#18694)
Adding app to the operation queue and refresh queue could cause waiting for resource for minutes to tens of minutes.
Sync state operates on resources gathered from reconciliation, so if the app operation event is processed before the refresh one (when triggered on resource update/creation), the refresh doesn’t help sync to progress and it essentially needs to wait for another app refresh.

The fix seems to be to schedule app operation event after refresh event is finished processing. There’s one place where operation event is scheduled without refresh event (which can be kept there), and one place where refresh even is scheduled without the operation one during the app deletion handling 3e2cfb1387/controller/appcontroller.go (L2177). It’s probably safe to schedule operation even after that, since it has some code to check that app was deleted. If not, an update can be made to have refresh queue storing a tuple with app key and bool whether to enqueue app operation.

If there are issues: try keeping both old places to add to app operation queue and new addition after refresh.

Note on cherry pick: add to as many releases as you can. This can be a significant performance boost.

Signed-off-by: Andrii Korotkov <andrii.korotkov@verkada.com>
2024-07-31 14:56:26 -07:00
Michael Crenshaw
8362ecc94b chore: mark generated files as generated to suppress diffs in PRs (#19321)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-07-31 17:51:55 +00:00
Jacco Mook
3658f8ec37 Implement workaround for namespaced app navigation bug (#17800)
Signed-off-by: jacco <jaccomook.98@gmail.com>
2024-07-31 17:48:37 +03:00
dependabot[bot]
d9337a3849 chore(deps): bump github.com/aws/aws-sdk-go from 1.55.4 to 1.55.5 (#19317)
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.55.4 to 1.55.5.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.55.4...v1.55.5)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-31 09:18:38 -04:00
Pavel
0894ddc89e fix(#19306): close redis cache gzip writer (#19307)
* close redis cache writer

flush is not enough, we need to close the writer too

Signed-off-by: Pavel Aborilov <aborilov@gmail.com>

* test compressed redis value

Signed-off-by: Pavel Aborilov <aborilov@gmail.com>

---------

Signed-off-by: Pavel Aborilov <aborilov@gmail.com>
2024-07-31 08:57:46 +05:30
Clif Houck
42de68d67f feat(5388): Allow multiple external URLs for SSO access (#18927)
* Add new field to the documentation

Signed-off-by: Thibault Jamet <tjamet@users.noreply.github.com>
Signed-off-by: Clif Houck <me@clifhouck.com>

* Fix codeql issue

codeql restricts logging fields from user input. Remove log to avoid complex escapes

Signed-off-by: Thibault Jamet <tjamet@users.noreply.github.com>
Signed-off-by: Clif Houck <me@clifhouck.com>

* Add a test to ensure validity of the documented cm

Currently, the documented configmap is invalid and raises error at the
time of applying it.

Ensure the configmap is valid with a unit test

Signed-off-by: Thibault Jamet <tjamet@users.noreply.github.com>
Signed-off-by: Clif Houck <me@clifhouck.com>

* rename additionalURLs for URLs

Signed-off-by: Thibault Jamet <tjamet@users.noreply.github.com>
Signed-off-by: Clif Houck <me@clifhouck.com>

* Allow responses redirected from SSO to alternate URLs

Signed-off-by: Thibault Jamet <tjamet@users.noreply.github.com>
Signed-off-by: Clif Houck <me@clifhouck.com>

* Consider dex enabled when there are additional URLs configured

Signed-off-by: Thibault Jamet <tjamet@users.noreply.github.com>
Signed-off-by: Clif Houck <me@clifhouck.com>

* Parse new URLs config from argocd-cm

Signed-off-by: Thibault Jamet <tjamet@users.noreply.github.com>
Signed-off-by: Clif Houck <me@clifhouck.com>

* Detect additional SSO URLs from requests

With HTTP servers, the `url` field of `http.Requests` does not contain
the host nor the protocol.

To work around this, consider `request.Host` and
`request.URL.RequestURI()`

Signed-off-by: Thibault Jamet <tjamet@users.noreply.github.com>
Signed-off-by: Clif Houck <me@clifhouck.com>

* Handle logout properly

Currently, while login is correctly handled, when logging out from
an alternate URL, we are redirected to the main URL.

Fix this by applying the same principles as for the login part

Signed-off-by: Thibault Jamet <tjamet@users.noreply.github.com>
Signed-off-by: Clif Houck <me@clifhouck.com>

* Fix ClientApp.oath2Config

Signed-off-by: Clif Houck <me@clifhouck.com>

* Fix test compile time error

Signed-off-by: Clif Houck <me@clifhouck.com>

* Fix TestDocumentedArgoCDConfigMapIsValid to parse in the same way as other spots in the codebase

Signed-off-by: Clif Houck <me@clifhouck.com>

* Fix warning messages for external URLs when attemping to load them from config map

Signed-off-by: Clif Houck <me@clifhouck.com>

* Revert change to IsDexConfigured since Dex does not use URLs setting

Signed-off-by: Clif Houck <me@clifhouck.com>

* Remove unnecessary receiver nil check in favor of fixing test

Signed-off-by: Clif Houck <me@clifhouck.com>

* Fix typo

Signed-off-by: Clif Houck <me@clifhouck.com>

* Add a unit test for RedirectURLForRequest

Signed-off-by: Clif Houck <me@clifhouck.com>

* Rename settings.URLs to AdditionalURLs

Signed-off-by: Clif Houck <me@clifhouck.com>

* Fix use of URLs in TestClientApp_HandleLogin

Signed-off-by: Clif Houck <me@clifhouck.com>

* Renamed urls to additionalUrls

Signed-off-by: Clif Houck <me@clifhouck.com>

* Integrate settings.AdditionalURLs with dex config and test settings.RedirectAdditionalURLs

Signed-off-by: Clif Houck <me@clifhouck.com>

* Reload ArgoCDServer when settings.AdditionalURLs changes

Signed-off-by: Clif Houck <me@clifhouck.com>

* Add note about additionalUrls to user-managament docs

Signed-off-by: Clif Houck <me@clifhouck.com>

* Add G-Research

Signed-off-by: Clif Houck <me@clifhouck.com>

* Change G-Research URL to point to open-source page

Signed-off-by: Clif Houck <me@clifhouck.com>

* Update docs/operator-manual/argocd-cm.yaml

Correct misspelling of additionalUrls

Co-authored-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>
Signed-off-by: Clif Houck <me@clifhouck.com>

* Update util/settings/settings.go

Fix incorrect key for additionalUrls

Co-authored-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>
Signed-off-by: Clif Houck <me@clifhouck.com>

* Update util/settings/settings.go

Fix key name

Co-authored-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>
Signed-off-by: Clif Houck <me@clifhouck.com>

* fix additional urls config key in test config

Signed-off-by: Clif Houck <me@clifhouck.com>

---------

Signed-off-by: Thibault Jamet <tjamet@users.noreply.github.com>
Signed-off-by: Clif Houck <me@clifhouck.com>
Co-authored-by: Thibault Jamet <tjamet@users.noreply.github.com>
Co-authored-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>
2024-07-30 22:57:33 +00:00
Michael Crenshaw
2edc1bad9a chore(deps): bump expr from 1.15.2 to 1.16.9 (#19277)
* chore(deps): bump expr from 1.15.2 to 1.16.9

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* fix test, make tests nicer

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

---------

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-07-30 17:58:04 -04:00
Michael Crenshaw
234c7ecdf9 feat: gracefully shut down repo-server on SIGTERM (#19309)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-07-30 14:44:47 -04:00
Rajat Toshniwal
f8a4399033 fix(#19271): update Content-Disposition filename extension to .log (#19272)
* fix: update Content-Disposition filename extension to .log

Downloaded log files to have the extension ".log" instead of ".txt"

Signed-off-by: Rajat Toshniwal <rnt.rajat@gmail.com>

* chore: update log file extension for downloaded logs

Signed-off-by: Rajat Toshniwal <rnt.rajat@gmail.com>

* Update docs/operator-manual/upgrading/2.12-2.13.md

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

---------

Signed-off-by: Rajat Toshniwal <rnt.rajat@gmail.com>
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-07-30 17:19:52 +00:00
vfaergestad
ad7438312f feat: Adding author/creator as a template key for Pull Request Generator (#18974)
Signed-off-by: Vegard Færgestad <vegardf@mnemonic.no>
Co-authored-by: Vegard Færgestad <vegardf@mnemonic.no>
2024-07-30 12:31:58 -04:00
Kevin
6a18c21ea8 docs: update users.md (#19292)
Signed-off-by: Juwon Hwang (Kevin) <juwon8891@gmail.com>
2024-07-30 11:25:54 -04:00
dependabot[bot]
2a0a0ea1cc chore(deps): bump golangci/golangci-lint-action from 6.0.1 to 6.1.0 (#19297)
Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 6.0.1 to 6.1.0.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](a4f60bb28d...aaa42aa062)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-30 11:25:22 -04:00
dependabot[bot]
3c7b6886bf chore(deps): bump docker/setup-buildx-action from 3.5.0 to 3.6.1 (#19296)
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 3.5.0 to 3.6.1.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](aa33708b10...988b5a0280)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-30 11:24:59 -04:00
dependabot[bot]
44b1dfce90 chore(deps): bump github.com/aws/aws-sdk-go from 1.55.3 to 1.55.4 (#19295)
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.55.3 to 1.55.4.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.55.3...v1.55.4)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-30 08:21:36 -04:00
Hazar Guney
3996a18bc9 Add Instruqt (#19299)
Signed-off-by: Hazar Guney <hazar+github@instruqt.com>
2024-07-30 10:58:58 +02:00
shangchengbabaiban
592e0b5879 chore: fix some comments (#19290) 2024-07-29 22:04:12 -04:00
Michael Crenshaw
7878ddf086 chore: fix lint (#19293) 2024-07-29 22:02:27 -04:00
Kevin
e2c5a555ce docs: Notification Controller is not included in Argo CD Core install (#19267)
Signed-off-by: Juwon Hwang (Kevin) <juwon8891@gmail.com>
2024-07-29 10:15:44 -06:00
github-actions[bot]
348f5013ff [Bot] docs: Update Snyk reports (#19278)
Signed-off-by: CI <ci@argoproj.com>
Co-authored-by: CI <ci@argoproj.com>
2024-07-29 11:44:17 -04:00
Doug Goldstein
34b411cca7 feat: implement source refs for helm set-file (#17941)
In multi-source applications helm values files can come from other repos
if you use the ref syntax but it is not possible for the --set-file
param to take files from other repos via the ref syntax. This extends
the behavior to cover set-file parameters as well as the values files.
fixes #13220, refs #17822

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
2024-07-29 11:43:52 -04:00
kahoulei
75e73834bf feat: Add ignore-resources-tracking annotation to ignore resources update (#18343)
* feat: Add ignore-resources-tracking annotation to ignore resources update

Signed-off-by: kahoulei <kahou.lei@okta.com>

* add doc

Signed-off-by: kahoulei <kahou.lei@okta.com>

* update annotation doc

Signed-off-by: kahoulei <kahou.lei@okta.com>

* refactor annotation usage base on comment feedback

Signed-off-by: kahoulei <kahou.lei@okta.com>

* update annotation

Signed-off-by: kahoulei <kahou.lei@okta.com>

* do not store boolean in resourceInfo

Signed-off-by: kahoulei <kahou.lei@okta.com>

* typo

Signed-off-by: kahoulei <kahou.lei@okta.com>

* update logic

Signed-off-by: kahoulei <kahou.lei@okta.com>

* refactor

Signed-off-by: kahoulei <kahou.lei@okta.com>

* add comment

Signed-off-by: kahoulei <kahou.lei@okta.com>

* add tests

Signed-off-by: kahoulei <kahou.lei@okta.com>

* update doc

Signed-off-by: kahoulei <kahou.lei@okta.com>

* update code base on comment feedback

Signed-off-by: kahoulei <kahou.lei@okta.com>

* update annotation doc

Signed-off-by: kahoulei <kahou.lei@okta.com>

* fix goimport

Signed-off-by: kahoulei <kahou.lei@okta.com>

* fix golint

Signed-off-by: kahoulei <kahou.lei@okta.com>

* update comments

Signed-off-by: kahoulei <kahou.lei@okta.com>

* update docs

Signed-off-by: kahoulei <kahou.lei@okta.com>

* update annotation name

Signed-off-by: kahoulei <kahou.lei@okta.com>

* rename annotation

Signed-off-by: kahoulei <kahou.lei@okta.com>

* lint check

Signed-off-by: kahoulei <kahou.lei@okta.com>

---------

Signed-off-by: kahoulei <kahou.lei@okta.com>
Co-authored-by: kahoulei <kahou.lei@okta.com>
Co-authored-by: Ishita Sequeira <46771830+ishitasequeira@users.noreply.github.com>
2024-07-29 11:26:50 -04:00
dependabot[bot]
6cc898ff37 chore(deps): bump code.gitea.io/sdk/gitea from 0.18.0 to 0.19.0 (#19287)
Bumps code.gitea.io/sdk/gitea from 0.18.0 to 0.19.0.

---
updated-dependencies:
- dependency-name: code.gitea.io/sdk/gitea
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-29 10:07:07 -04:00
dependabot[bot]
2769dd3931 chore(deps): bump ossf/scorecard-action from 2.3.3 to 2.4.0 (#19286)
Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 2.3.3 to 2.4.0.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](dc50aa9510...62b2cac7ed)

---
updated-dependencies:
- dependency-name: ossf/scorecard-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-29 08:52:05 -04:00
Iskander Sitdikov
8b1bddd5f7 fix: Pre-process KubeVersion before passing it to kustomize (#19258)
It should be done in the same way as for plugins.

Signed-off-by: Iskander Sitdikov <thoughteer@zerion.io>
2024-07-26 19:03:59 -04:00
dependabot[bot]
473a695585 chore(deps): bump github.com/xanzy/go-gitlab from 0.91.1 to 0.107.0 (#19227)
* chore(deps): bump github.com/xanzy/go-gitlab from 0.91.1 to 0.107.0

Bumps [github.com/xanzy/go-gitlab](https://github.com/xanzy/go-gitlab) from 0.91.1 to 0.107.0.
- [Changelog](https://github.com/xanzy/go-gitlab/blob/main/releases_test.go)
- [Commits](https://github.com/xanzy/go-gitlab/compare/v0.91.1...v0.107.0)

---
updated-dependencies:
- dependency-name: github.com/xanzy/go-gitlab
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix type

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* handle empty labels list

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-07-26 19:03:08 -04:00
dependabot[bot]
aa2b331153 chore(deps): bump github.com/prometheus/client_golang (#19242)
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.18.0 to 1.19.1.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.18.0...v1.19.1)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-26 16:59:29 -04:00
dependabot[bot]
0019042c9d chore(deps): bump @babel/traverse from 7.14.7 to 7.25.0 in /ui (#19270)
Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.14.7 to 7.25.0.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.25.0/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-26 19:58:20 +00:00
Dillen Padhiar
8e5bf5dadc test: minor fix for Numaplane CRD Health Checks (#19241)
* test: small improvement for Numaplane CRD Health Checks

Signed-off-by: Dillen Padhiar <dillen_padhiar@intuit.com>

* fix: correct reason check

Signed-off-by: Dillen Padhiar <dillen_padhiar@intuit.com>

---------

Signed-off-by: Dillen Padhiar <dillen_padhiar@intuit.com>
Co-authored-by: Ishita Sequeira <46771830+ishitasequeira@users.noreply.github.com>
2024-07-26 15:51:39 -04:00
dependabot[bot]
d894d22a63 chore(deps): bump github.com/go-openapi/runtime from 0.26.0 to 0.28.0 (#19244)
Bumps [github.com/go-openapi/runtime](https://github.com/go-openapi/runtime) from 0.26.0 to 0.28.0.
- [Release notes](https://github.com/go-openapi/runtime/releases)
- [Commits](https://github.com/go-openapi/runtime/compare/v0.26.0...v0.28.0)

---
updated-dependencies:
- dependency-name: github.com/go-openapi/runtime
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-26 15:25:22 -04:00
dependabot[bot]
3ec6604149 chore(deps): bump github.com/redis/go-redis/v9 from 9.0.5 to 9.6.1 (#19247)
Bumps [github.com/redis/go-redis/v9](https://github.com/redis/go-redis) from 9.0.5 to 9.6.1.
- [Release notes](https://github.com/redis/go-redis/releases)
- [Changelog](https://github.com/redis/go-redis/blob/master/CHANGELOG.md)
- [Commits](https://github.com/redis/go-redis/compare/v9.0.5...v9.6.1)

---
updated-dependencies:
- dependency-name: github.com/redis/go-redis/v9
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-26 15:24:08 -04:00
dependabot[bot]
7c41233419 chore(deps): bump github.com/ktrysmt/go-bitbucket from 0.9.67 to 0.9.80 (#19246)
Bumps [github.com/ktrysmt/go-bitbucket](https://github.com/ktrysmt/go-bitbucket) from 0.9.67 to 0.9.80.
- [Release notes](https://github.com/ktrysmt/go-bitbucket/releases)
- [Commits](https://github.com/ktrysmt/go-bitbucket/compare/v0.9.67...v0.9.80)

---
updated-dependencies:
- dependency-name: github.com/ktrysmt/go-bitbucket
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-26 15:22:57 -04:00
dependabot[bot]
11629d18d3 chore(deps): bump github.com/gorilla/websocket from 1.5.0 to 1.5.3 (#19245)
Bumps [github.com/gorilla/websocket](https://github.com/gorilla/websocket) from 1.5.0 to 1.5.3.
- [Release notes](https://github.com/gorilla/websocket/releases)
- [Commits](https://github.com/gorilla/websocket/compare/v1.5.0...v1.5.3)

---
updated-dependencies:
- dependency-name: github.com/gorilla/websocket
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-26 15:21:40 -04:00
dependabot[bot]
25c2f2fbc6 chore(deps): bump github.com/coreos/go-oidc/v3 from 3.10.0 to 3.11.0 (#19249)
Bumps [github.com/coreos/go-oidc/v3](https://github.com/coreos/go-oidc) from 3.10.0 to 3.11.0.
- [Release notes](https://github.com/coreos/go-oidc/releases)
- [Commits](https://github.com/coreos/go-oidc/compare/v3.10.0...v3.11.0)

---
updated-dependencies:
- dependency-name: github.com/coreos/go-oidc/v3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-26 05:10:18 +00:00
dependabot[bot]
714d1ad01f chore(deps): bump github.com/aws/aws-sdk-go from 1.55.2 to 1.55.3 (#19248)
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.55.2 to 1.55.3.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.55.2...v1.55.3)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-26 05:01:38 +00:00
thisishwan2
889c36cd21 chore: improve error logs(#10592) (#19197)
* chore: improve error logs

Signed-off-by: thisishwan2 <feel000617@gmail.com>

* chore: format change

Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Signed-off-by: thisishwan2 <112103038+thisishwan2@users.noreply.github.com>
Signed-off-by: thisishwan2 <feel000617@gmail.com>

* chore: change format message

Signed-off-by: thisishwan2 <feel000617@gmail.com>

* chore: Rollback of error formats for generateParamsForGitFiles function

Signed-off-by: thisishwan2 <feel000617@gmail.com>

---------

Signed-off-by: thisishwan2 <feel000617@gmail.com>
Signed-off-by: thisishwan2 <112103038+thisishwan2@users.noreply.github.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-07-26 03:03:52 +00:00
dependabot[bot]
929e85553d chore(deps): bump golang.org/x/net from 0.25.0 to 0.27.0 (#19226)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.25.0 to 0.27.0.
- [Commits](https://github.com/golang/net/compare/v0.25.0...v0.27.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-26 01:22:13 +00:00
dependabot[bot]
dcfa738f1c chore(deps): bump github.com/bradleyfalzon/ghinstallation/v2 (#19230)
Bumps [github.com/bradleyfalzon/ghinstallation/v2](https://github.com/bradleyfalzon/ghinstallation) from 2.6.0 to 2.11.0.
- [Release notes](https://github.com/bradleyfalzon/ghinstallation/releases)
- [Commits](https://github.com/bradleyfalzon/ghinstallation/compare/v2.6.0...v2.11.0)

---
updated-dependencies:
- dependency-name: github.com/bradleyfalzon/ghinstallation/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-26 01:12:36 +00:00
dependabot[bot]
4c158faf32 chore(deps): bump oras.land/oras-go/v2 from 2.3.0 to 2.5.0 (#19234)
Bumps [oras.land/oras-go/v2](https://github.com/oras-project/oras-go) from 2.3.0 to 2.5.0.
- [Release notes](https://github.com/oras-project/oras-go/releases)
- [Commits](https://github.com/oras-project/oras-go/compare/v2.3.0...v2.5.0)

---
updated-dependencies:
- dependency-name: oras.land/oras-go/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-25 20:41:53 -04:00
dependabot[bot]
be042e2dcf chore(deps): bump github.com/casbin/casbin/v2 from 2.97.0 to 2.98.0 (#19235)
Bumps [github.com/casbin/casbin/v2](https://github.com/casbin/casbin) from 2.97.0 to 2.98.0.
- [Release notes](https://github.com/casbin/casbin/releases)
- [Changelog](https://github.com/casbin/casbin/blob/master/.releaserc.json)
- [Commits](https://github.com/casbin/casbin/compare/v2.97.0...v2.98.0)

---
updated-dependencies:
- dependency-name: github.com/casbin/casbin/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-25 23:26:35 +00:00
dependabot[bot]
2465ebbab0 chore(deps): bump github.com/prometheus/client_model from 0.5.0 to 0.6.1 (#19232)
Bumps [github.com/prometheus/client_model](https://github.com/prometheus/client_model) from 0.5.0 to 0.6.1.
- [Release notes](https://github.com/prometheus/client_model/releases)
- [Commits](https://github.com/prometheus/client_model/compare/v0.5.0...v0.6.1)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_model
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-25 23:18:48 +00:00
dependabot[bot]
a03bda68f2 chore(deps): bump github.com/cyphar/filepath-securejoin (#19225)
Bumps [github.com/cyphar/filepath-securejoin](https://github.com/cyphar/filepath-securejoin) from 0.2.4 to 0.3.1.
- [Release notes](https://github.com/cyphar/filepath-securejoin/releases)
- [Changelog](https://github.com/cyphar/filepath-securejoin/blob/main/CHANGELOG.md)
- [Commits](https://github.com/cyphar/filepath-securejoin/compare/v0.2.4...v0.3.1)

---
updated-dependencies:
- dependency-name: github.com/cyphar/filepath-securejoin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-25 23:18:24 +00:00
dependabot[bot]
fec106a260 chore(deps): bump google.golang.org/grpc from 1.59.0 to 1.65.0 (#19229)
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.59.0 to 1.65.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.59.0...v1.65.0)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-25 19:12:31 -04:00
dependabot[bot]
58f16c1c58 chore(deps): bump golang.org/x/sync from 0.5.0 to 0.7.0 (#19219)
Bumps [golang.org/x/sync](https://github.com/golang/sync) from 0.5.0 to 0.7.0.
- [Commits](https://github.com/golang/sync/compare/v0.5.0...v0.7.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sync
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-25 22:51:16 +00:00
dependabot[bot]
dba8086f4a chore(deps): bump github.com/aws/aws-sdk-go from 1.50.8 to 1.55.2 (#19218)
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.50.8 to 1.55.2.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.50.8...v1.55.2)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-25 21:00:52 +00:00
odubajDT
ddc0b0fd3f feat: Introduce KeptnWorkloadVersion custom resource (#15951)
Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-07-25 21:00:02 +00:00
dependabot[bot]
f1018e88a0 chore(deps): bump github.com/itchyny/gojq from 0.12.13 to 0.12.16 (#19224)
Bumps [github.com/itchyny/gojq](https://github.com/itchyny/gojq) from 0.12.13 to 0.12.16.
- [Release notes](https://github.com/itchyny/gojq/releases)
- [Changelog](https://github.com/itchyny/gojq/blob/main/CHANGELOG.md)
- [Commits](https://github.com/itchyny/gojq/compare/v0.12.13...v0.12.16)

---
updated-dependencies:
- dependency-name: github.com/itchyny/gojq
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-25 20:11:27 +00:00
dependabot[bot]
8952273d1f chore(deps): bump github.com/spf13/cobra from 1.7.0 to 1.8.1 (#19231)
Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 1.7.0 to 1.8.1.
- [Release notes](https://github.com/spf13/cobra/releases)
- [Commits](https://github.com/spf13/cobra/compare/v1.7.0...v1.8.1)

---
updated-dependencies:
- dependency-name: github.com/spf13/cobra
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-25 16:08:00 -04:00
dependabot[bot]
f05de86401 chore(deps): bump github.com/go-logr/logr from 1.4.1 to 1.4.2 (#19228)
Bumps [github.com/go-logr/logr](https://github.com/go-logr/logr) from 1.4.1 to 1.4.2.
- [Release notes](https://github.com/go-logr/logr/releases)
- [Changelog](https://github.com/go-logr/logr/blob/master/CHANGELOG.md)
- [Commits](https://github.com/go-logr/logr/compare/v1.4.1...v1.4.2)

---
updated-dependencies:
- dependency-name: github.com/go-logr/logr
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-25 19:26:34 +00:00
dependabot[bot]
e85d97bbc1 chore(deps): bump github.com/gosimple/slug from 1.13.1 to 1.14.0 (#19222)
Bumps [github.com/gosimple/slug](https://github.com/gosimple/slug) from 1.13.1 to 1.14.0.
- [Release notes](https://github.com/gosimple/slug/releases)
- [Commits](https://github.com/gosimple/slug/compare/v1.13.1...v1.14.0)

---
updated-dependencies:
- dependency-name: github.com/gosimple/slug
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-25 19:24:46 +00:00
dependabot[bot]
b95347c5e3 chore(deps): bump github.com/felixge/httpsnoop from 1.0.3 to 1.0.4 (#19221)
Bumps [github.com/felixge/httpsnoop](https://github.com/felixge/httpsnoop) from 1.0.3 to 1.0.4.
- [Release notes](https://github.com/felixge/httpsnoop/releases)
- [Commits](https://github.com/felixge/httpsnoop/compare/v1.0.3...v1.0.4)

---
updated-dependencies:
- dependency-name: github.com/felixge/httpsnoop
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-25 19:24:28 +00:00
dependabot[bot]
1cef4de066 chore(deps): bump github.com/cespare/xxhash/v2 from 2.2.0 to 2.3.0 (#19220)
Bumps [github.com/cespare/xxhash/v2](https://github.com/cespare/xxhash) from 2.2.0 to 2.3.0.
- [Commits](https://github.com/cespare/xxhash/compare/v2.2.0...v2.3.0)

---
updated-dependencies:
- dependency-name: github.com/cespare/xxhash/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-25 19:24:17 +00:00
dependabot[bot]
30f05e8726 chore(deps): bump golang.org/x/oauth2 from 0.13.0 to 0.21.0 (#19217)
Bumps [golang.org/x/oauth2](https://github.com/golang/oauth2) from 0.13.0 to 0.21.0.
- [Commits](https://github.com/golang/oauth2/compare/v0.13.0...v0.21.0)

---
updated-dependencies:
- dependency-name: golang.org/x/oauth2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-25 19:20:53 +00:00
Michael Crenshaw
21fe286f6e chore(refactor): move util function to util package (#19192)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-07-25 10:33:16 -04:00
Michael Crenshaw
25909f1671 chore(ci): allow more go dependabot updates (#19190)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-07-25 10:32:01 -04:00
Michael Crenshaw
6f94113935 chore(ci): group otel updates (#19187)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-07-25 10:31:40 -04:00
Michael Crenshaw
56bb5734de chore(deps): bump node images and types (#19188)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-07-25 10:31:26 -04:00
Andreas
326cc4a06b feat(health): Added KeptnMetric (#19210)
Signed-off-by: asamonik <49288593+asamonik@users.noreply.github.com>
2024-07-25 10:26:06 -04:00
Andreas
e26c105e52 feat(health): Added Keptn Analysis (#19211)
Signed-off-by: asamonik <49288593+asamonik@users.noreply.github.com>
2024-07-25 10:23:26 -04:00
dependabot[bot]
20f55285cd chore(deps): bump github.com/casbin/govaluate from 1.1.0 to 1.2.0 (#19205)
Bumps [github.com/casbin/govaluate](https://github.com/casbin/govaluate) from 1.1.0 to 1.2.0.
- [Release notes](https://github.com/casbin/govaluate/releases)
- [Changelog](https://github.com/casbin/govaluate/blob/master/.releaserc.json)
- [Commits](https://github.com/casbin/govaluate/compare/v1.1.0...v1.2.0)

---
updated-dependencies:
- dependency-name: github.com/casbin/govaluate
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-25 10:21:13 -04:00
dependabot[bot]
9026f14a0b chore(deps): bump github.com/gorilla/handlers from 1.5.1 to 1.5.2 (#19206)
Bumps [github.com/gorilla/handlers](https://github.com/gorilla/handlers) from 1.5.1 to 1.5.2.
- [Release notes](https://github.com/gorilla/handlers/releases)
- [Commits](https://github.com/gorilla/handlers/compare/v1.5.1...v1.5.2)

---
updated-dependencies:
- dependency-name: github.com/gorilla/handlers
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-25 10:20:51 -04:00
William Parr
67776ad864 fix(applicationset): ensure that older applicationStatus is updated with new required values (#19165)
Signed-off-by: wparr-circle <william.parr@circle.com>
2024-07-25 10:10:33 -04:00
Tobias Verbeke
3406078b89 fix: add Open Analytics (#19214)
Signed-off-by: Tobias Verbeke <tobias.verbeke@openanalytics.eu>
2024-07-25 01:52:40 -10:00
vaboston
58b56767bc docs: add LeFigaro to USERS.md (#19212)
Signed-off-by: Valentin Bouin <vbouin@lefigaro.fr>
Co-authored-by: Valentin Bouin <vbouin@lefigaro.fr>
2024-07-24 22:48:59 -10:00
Michael Crenshaw
d0313c5ba4 Revert "feat: removed legacy app tracking label (#13203)" (#19196)
This reverts commit 4d8436b7e1.

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-07-24 19:10:38 +00:00
dependabot[bot]
9ca2c53d1d chore(deps): bump library/redis in /test/container (#19172)
Bumps library/redis from `fb534a3` to `5a82749`.

---
updated-dependencies:
- dependency-name: library/redis
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-24 20:32:08 +03:00
Dillen Padhiar
ba32783a40 fix: bug fixes and improvements for Numaplane CRD health checks (#19168)
* fix: bugs and improvements for Numaplane CRD health checks

Signed-off-by: Dillen Padhiar <dillen_padhiar@intuit.com>

* test: update paused PipelineRollout test case

Signed-off-by: Dillen Padhiar <dillen_padhiar@intuit.com>

* test: add new cases for isbservicerollout and numaflowcontrollerrollout

Signed-off-by: Dillen Padhiar <dillen_padhiar@intuit.com>

---------

Signed-off-by: Dillen Padhiar <dillen_padhiar@intuit.com>
Co-authored-by: pasha-codefresh <pavel@codefresh.io>
2024-07-24 17:25:34 +00:00
Yevhen Tienkaiev
85a782e91e Fix target for external urls (#19124)
Signed-off-by: Dan Garfield <dan@codefresh.io>
2024-07-24 17:25:11 +00:00
dependabot[bot]
3daaca9211 chore(deps): bump google.golang.org/protobuf from 1.33.0 to 1.34.2 (#18934)
Bumps google.golang.org/protobuf from 1.33.0 to 1.34.2.

---
updated-dependencies:
- dependency-name: google.golang.org/protobuf
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-24 10:44:15 -04:00
Rajesh Muthusamy
3bc3d22b2a docs: Update USERS.md added Name Cognizant (#19186)
* docs Update USERS.md added Company name Cognizant

added Company name Cognizant

Signed-off-by: Rajesh Muthusamy <m.rajesh2005@gmail.com>

* docs: Update to USERS.md added company name Cognizant

Added Company name Cognizant to USERS.md

Signed-off-by: Rajesh Muthusamy <m.rajesh2005@gmail.com>

* Remove dupe line

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

---------

Signed-off-by: Rajesh Muthusamy <m.rajesh2005@gmail.com>
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-07-24 14:25:17 +00:00
pasha-codefresh
e36248cb22 Merge commit from fork
* feat: verify rbac on each message and not just during handshake

Signed-off-by: pashakostohrys <pavel@codefresh.io>

* cover with tests

Signed-off-by: pashakostohrys <pavel@codefresh.io>

* fix: linter and e2e tests

Signed-off-by: pashakostohrys <pavel@codefresh.io>

* fix: linter and e2e tests

Signed-off-by: pashakostohrys <pavel@codefresh.io>

---------

Signed-off-by: pashakostohrys <pavel@codefresh.io>
2024-07-24 12:18:15 +03:00
dependabot[bot]
e647690860 chore(deps-dev): bump typescript from 5.5.3 to 5.5.4 in /ui-test (#19154)
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 5.5.3 to 5.5.4.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v5.5.3...v5.5.4)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ishita Sequeira <46771830+ishitasequeira@users.noreply.github.com>
2024-07-23 12:32:33 -04:00
Arthur Outhenin-Chalandre
edf631c979 feat(kustomize): add support for helm args to pass api and kube versions (#16583)
Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@ledger.fr>
2024-07-23 11:30:11 -04:00
dependabot[bot]
77a8100d3a chore(deps): bump docker/setup-qemu-action from 3.0.0 to 3.2.0 (#19155)
Bumps [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) from 3.0.0 to 3.2.0.
- [Release notes](https://github.com/docker/setup-qemu-action/releases)
- [Commits](68827325e0...49b3bc8e6b)

---
updated-dependencies:
- dependency-name: docker/setup-qemu-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-23 14:25:44 +00:00
rumstead
975449c8d8 docs(appset): adding examples to argocd-cmd-params-cm for reconciling and git globbing (#19166)
Signed-off-by: rumstead <37445536+rumstead@users.noreply.github.com>
2024-07-23 14:02:46 +00:00
fsl
560c7c2cde chore: fix ui vuln (#19153)
Signed-off-by: fsl <1171313930@qq.com>
2024-07-23 10:00:05 -04:00
github-actions[bot]
5eafab12bc [Bot] docs: Update Snyk reports (#19127)
Signed-off-by: CI <ci@argoproj.com>
Co-authored-by: CI <ci@argoproj.com>
2024-07-23 09:36:08 -04:00
dependabot[bot]
386d848178 chore(deps): bump docker/login-action from 3.2.0 to 3.3.0 (#19156)
Bumps [docker/login-action](https://github.com/docker/login-action) from 3.2.0 to 3.3.0.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](0d4c9c5ea7...9780b0c442)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-23 09:30:17 -04:00
dependabot[bot]
66eac6dd80 chore(deps): bump docker/setup-buildx-action from 3.4.0 to 3.5.0 (#19157)
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 3.4.0 to 3.5.0.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](4fd812986e...aa33708b10)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-23 09:29:25 -04:00
dependabot[bot]
555dbba268 chore(deps): bump docker/build-push-action from 6.4.1 to 6.5.0 (#19158)
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 6.4.1 to 6.5.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](1ca370b3a9...5176d81f87)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-23 09:28:38 -04:00
appiepollo14
ff3e36c3ce fix: Fixes x509 cert issue by passing trusted certs via CM for BitBucketServer and GitLab (#19002)
* Fixes https://github.com/argoproj/argo-cd/issues/9607
for BitBucketServer by allowing to pass a CM holding trusted certificates. Refactors implementation for GitLab.

Signed-off-by: asjervanasten <asjer94@live.com>

* Fixes https://github.com/argoproj/argo-cd/issues/9607
for BitBucketServer by allowing to pass a CM holding trusted certificates. Refactors implementation for GitLab.

Signed-off-by: asjervanasten <asjer94@live.com>

* Implemented review feedback. Util class for retrieving Secret and CM, renamed caRef.

Signed-off-by: asjervanasten <asjer94@live.com>

---------

Signed-off-by: asjervanasten <asjer94@live.com>
2024-07-23 07:09:08 -04:00
Kolawole Olowoporoku
834223a59c docs: update users.md (#19161)
* Update USERS.md

Signed-off-by: Kolawole Olowoporoku <79517443+kollzey@users.noreply.github.com>

* Update USERS.md

Signed-off-by: Kolawole Olowoporoku <79517443+kollzey@users.noreply.github.com>

* Update USERS.md

chore: remove whitespace

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

---------

Signed-off-by: Kolawole Olowoporoku <79517443+kollzey@users.noreply.github.com>
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
Co-authored-by: Blake Pettersson <blake.pettersson@gmail.com>
2024-07-23 01:02:40 -10:00
fsl
3d77d9ced0 fix: enable logging for the controller runtime (#19129)
Signed-off-by: fsl <1171313930@qq.com>
2024-07-22 20:04:21 -04:00
Michael Crenshaw
65fddab260 chore: use .mockery.yaml for all mocks (#19149)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-07-22 20:03:50 -04:00
Michael Crenshaw
745ec52d9c chore(deps): bump go-github from v35 to v63 (#19152)
* chore(deps): bump go-github from v35 to v63

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* use old default

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* fix test

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

---------

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-07-22 19:49:09 -04:00
Michael Crenshaw
4c34678c24 docs: document built-in resource actions (#19145)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-07-22 18:17:24 -04:00
Reinier Timmer
9dd1083c98 fix: update job name for manual cronjob creation (#19137)
* fix: update job name for manual cronjob creation

Changes the name of Job resources when manually starting a CronJob from ArgoCD to be in accordance to kubernetes CronJob spec.

Signed-off-by: Reinier Timmer <reinier.timmer@ah.nl>

* docs: added upgrading note for changed Job name format

Signed-off-by: Reinier Timmer <reinier.timmer@ah.nl>

* docs: update Argo CD name based on suggestion

Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Signed-off-by: Reinier Timmer <reinier.timmer@ah.nl>

---------

Signed-off-by: Reinier Timmer <reinier.timmer@ah.nl>
Co-authored-by: pasha-codefresh <pavel@codefresh.io>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-07-22 17:15:15 -04:00
Cheng Fang
f6c06046e6 docs(rbac): add role and effect to the sample policy formats (#19151)
Signed-off-by: Cheng Fang <cfang@redhat.com>
2024-07-22 17:11:52 -04:00
Kevin
13be1aec2c chore: wrap error when setting new revision manifests (#19148)
Signed-off-by: Juwon Hwang (Kevin) <juwon8891@gmail.com>
2024-07-22 14:36:29 -04:00
pasha-codefresh
c9c7989f8c Merge commit from fork
* feat: limit payload size

Signed-off-by: pashakostohrys <pavel@codefresh.io>

* cover with tests and provide ability to define variable from CM

Signed-off-by: pashakostohrys <pavel@codefresh.io>

* cover with tests and provide ability to define variable from CM

Signed-off-by: pashakostohrys <pavel@codefresh.io>

* improve error message and add documentation

Signed-off-by: pashakostohrys <pavel@codefresh.io>

* fix tests

Signed-off-by: pashakostohrys <pavel@codefresh.io>

* fix comments

Signed-off-by: pashakostohrys <pavel@codefresh.io>

* fix linter

Signed-off-by: pashakostohrys <pavel@codefresh.io>

---------

Signed-off-by: pashakostohrys <pavel@codefresh.io>
2024-07-22 17:08:17 +03:00
Matthieu Simon
5d21725225 docs: fix typo on 2.13 upgrade manual (#19139)
Signed-off-by: tieum <matthieu@bluegreen.sh>
2024-07-22 03:32:05 -10:00
Michael Crenshaw
505998298f chore(deps): bump protoc from 3.17.3 to (3.).27.2 (#19120)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-07-21 23:04:47 -04:00
Jellyfrog
f26b76a7aa feat(health): support for some rds.crossplane.io resources (#19076)
Signed-off-by: Jellyfrog <Jellyfrog@users.noreply.github.com>
2024-07-21 23:03:06 -04:00
Julio
f9078f78b6 feat(appset): add key title to PR generator (#16447) (#17907)
Signed-off-by: ggjulio <juligonz@student.42.fr>
2024-07-21 22:36:39 -04:00
thecooldrop
a7cb6ed9bb fix: tree output with app selector permission denied. (#18990)
* Fix: wrong application name passed into function

The application name which was passed into the function
was a namespace-qualified name for the application, but
actually a simple non-qualified name was needed.

This leads to issue on the kube-apiserver side
where qualified app name is used to retrieve
the resource from a lister, leading to a cache-miss
basically, since app was looked up by namespace/namespace/appname
key, instead of namespace/appname key.

Signed-off-by: TheCoolDrop <vanio.begic123@gmail.com>

* chore: Fix the name of the application used with tree=detailed output

Signed-off-by: TheCoolDrop <vanio.begic123@gmail.com>

---------

Signed-off-by: TheCoolDrop <vanio.begic123@gmail.com>
2024-07-21 22:32:15 -04:00
dependabot[bot]
64b76f2fa0 chore(deps): bump tj-actions/changed-files from 44.5.5 to 44.5.6 (#19116)
Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 44.5.5 to 44.5.6.
- [Release notes](https://github.com/tj-actions/changed-files/releases)
- [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md)
- [Commits](cc733854b1...6b2903bdce)

---
updated-dependencies:
- dependency-name: tj-actions/changed-files
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-19 11:44:37 -04:00
Andrii Korotkov
c59cb52b27 chore: Use more optimal iterate hierarchy v2 (#18929) (#18972)
Closes #18929
Helps with #18500
Use iterate hierarchy v2 to have a roughly linear performance for getting the resource tree instead of up to quadratic.

Signed-off-by: Andrii Korotkov <andrii.korotkov@verkada.com>
2024-07-19 11:37:13 -04:00
dependabot[bot]
22e498e9ca chore(deps): bump softprops/action-gh-release from 2.0.7 to 2.0.8 (#19117)
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 2.0.7 to 2.0.8.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](fb2d03176f...c062e08bd5)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-19 08:28:09 -04:00
Dillen Padhiar
ea725a9c7c fix: Numaplane CRD health checks - bug fixes (#19099)
* fix: Numaplane CRD health checks - phase check for Healthy

Signed-off-by: Dillen Padhiar <dillen_padhiar@intuit.com>

* fix: return diff message when phase is Failed

Signed-off-by: Dillen Padhiar <dillen_padhiar@intuit.com>

* fix: NumaflowControllerRollout test

Signed-off-by: Dillen Padhiar <dillen_padhiar@intuit.com>

* fix: return statements added

Signed-off-by: Dillen Padhiar <dillen_padhiar@intuit.com>

---------

Signed-off-by: Dillen Padhiar <dillen_padhiar@intuit.com>
2024-07-18 15:11:07 -04:00
yyzxw
b6960973b7 chore: replace deprecated func (#18291)
Signed-off-by: xiaowu.zhu <xiaowu.zhu@daocloud.io>
Co-authored-by: Dan Garfield <dan@codefresh.io>
2024-07-18 12:59:52 -04:00
dependabot[bot]
bb1bb3f4eb chore(deps-dev): bump @types/node from 20.14.10 to 20.14.11 in /ui-test (#19092)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.14.10 to 20.14.11.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-18 08:23:32 -04:00
dependabot[bot]
530bcd7cf6 chore(deps): bump chromedriver from 126.0.4 to 126.0.5 in /ui-test (#19100)
Bumps [chromedriver](https://github.com/giggio/node-chromedriver) from 126.0.4 to 126.0.5.
- [Commits](https://github.com/giggio/node-chromedriver/compare/126.0.4...126.0.5)

---
updated-dependencies:
- dependency-name: chromedriver
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-18 08:22:50 -04:00
dependabot[bot]
07db0e0937 chore(deps): bump docker/build-push-action from 6.4.0 to 6.4.1 (#19102)
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 6.4.0 to 6.4.1.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](a254f8ca60...1ca370b3a9)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-18 07:46:28 -04:00
dependabot[bot]
54646ed55c chore(deps): bump softprops/action-gh-release from 2.0.6 to 2.0.7 (#19101)
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 2.0.6 to 2.0.7.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](a74c6b72af...fb2d03176f)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-18 07:46:05 -04:00
Dillen Padhiar
d6bc02b195 feat: health checks for Numaplane CRDs (#19077)
* feat: health checks for Numaplane CRDs

Signed-off-by: Dillen Padhiar <dillen_padhiar@intuit.com>

* test: update health_test for NumaflowController

Signed-off-by: Dillen Padhiar <dillen_padhiar@intuit.com>

---------

Signed-off-by: Dillen Padhiar <dillen_padhiar@intuit.com>
Co-authored-by: Dan Garfield <dan@codefresh.io>
2024-07-17 20:17:09 +03:00
Adrian Berger
824d0dced7 feat: Add custom resource health for flux resources (#19082)
* feat: Add custom resource health for flux resources

Signed-off-by: Adrian Berger <adrian.berger@bedag.ch>

* chore: Update upgrade docs

Signed-off-by: Adrian Berger <adrian.berger@bedag.ch>

---------

Signed-off-by: Adrian Berger <adrian.berger@bedag.ch>
Signed-off-by: Dan Garfield <dan@codefresh.io>
Co-authored-by: Dan Garfield <dan@codefresh.io>
2024-07-17 20:16:57 +03:00
Andrii Korotkov
a06cdb3880 docs: Add an explanation of using ignoring differences for app of apps pattern (#18945)
Some fields updates trigger app of apps being out of sync on a regular basis, or prevent from persistently modifying some behaviors like auto sync without doing the change in the code. This update shows how to do this using ignore differences configuration.

Signed-off-by: Andrii Korotkov <andrii.korotkov@verkada.com>
Co-authored-by: Dan Garfield <dan@codefresh.io>
2024-07-17 16:23:53 +00:00
Cyril Duchon-Doris
484e83d210 chore: add My Job Glasses to users of argo-cd (#19095)
Signed-off-by: Cyril Duchon-Doris <Startouf@users.noreply.github.com>
2024-07-17 03:07:31 -10:00
Arthur Outhenin-Chalandre
30a1623e38 fix(applicationset): use requeue after if generate app errors out (#18761)
The `GenerateApplications` can call to external resources like Github
API for instance which might be rate limited or fail. If those requests
somehow fail we should requeue them after some time like (same
reason as e98d3b2a87/applicationset/controllers/applicationset_controller.go (L154)).

For instance, in our environments we were rate limited by Github and the ArgoCD
applicationset controller was logging the following error about every
second or less for every application set using the pull request generator
that we have:
```
time="2024-06-21T14:17:15Z" level=error msg="error generating params" error="error listing repos: error listing pull requests for LedgerHQ/xxx: GET https://api.github.com/repos/LedgerHQ/xxx/pulls?per_page=100: 403 API rate limit exceeded for installation ID xxx. If you reach out to GitHub Support for help, please include the request ID xxx and timestamp 2024-06-xx xxx UTC. [rate reset in 8m18s]" generator="&{0xc000d652c0 0x289a100 {0xc00087bdd0}  [] true}"
time="2024-06-21T14:17:15Z" level=error msg="error generating application from params" applicationset=argocd/xxx error="error listing repos: error listing pull requests for LedgerHQ/xxxx: GET https://api.github.com/repos/LedgerHQ/xxx/pulls?per_page=100: 403 API rate limit exceeded for installation ID xxx. If you reach out to GitHub Support for help, please include the request ID xxx and timestamp 2024-06-xx xxx UTC. [rate reset in 8m18s]" generator="{nil nil nil nil nil &PullRequestGenerator{Github:&PullRequestGeneratorGithub{Owner:LedgerHQ,Repo:xxx,API:,TokenRef:nil,AppSecretName:xxxx,Labels:[argocd/preview],},GitLab:nil,Gitea:nil,BitbucketServer:nil,Filters:[]PullRequestGeneratorFilter{},RequeueAfterSeconds:*1800,Template:ApplicationSetTemplate{ApplicationSetTemplateMeta:ApplicationSetTemplateMeta{Name:,Namespace:,Labels:map[string]string{},Annotations:map[string]string{},Finalizers:[],},Spec:ApplicationSpec{Source:nil,Destination:ApplicationDestination{Server:,Namespace:,Name:,},Project:,SyncPolicy:nil,IgnoreDifferences:[]ResourceIgnoreDifferences{},Info:[]Info{},RevisionHistoryLimit:nil,Sources:[]ApplicationSource{},},},Bitbucket:nil,AzureDevOps:nil,} nil nil nil nil}"
```

Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@ledger.fr>
2024-07-16 17:56:36 -04:00
Michael Crenshaw
45b7593e82 docs(appset): clarify global sync policy config (#19085)
* docs(appset): clarify global sync policy config

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* clarify

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* clarify

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

---------

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-07-16 13:58:41 -04:00
dependabot[bot]
32e6ca2337 chore(deps): bump docker/build-push-action from 6.3.0 to 6.4.0 (#19079)
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 6.3.0 to 6.4.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](1a162644f9...a254f8ca60)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-16 10:52:06 -04:00
Leonardo Luz Almeida
c5d0acf7ec feat: forward the Argo CD logged in user to the proxy extension (#19075)
* feat: forward the Argo CD logged in user to the proxy extension

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* Add docs

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

---------

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
2024-07-16 09:40:08 -04:00
Michael Crenshaw
7af5793c5b chore(deps): bump Dex from 2.38.0 to 2.40.0 (#19057)
* chore(deps): bump Dex from 2.38.0 to 2.40.0

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* docs

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

---------

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-07-15 21:35:38 -04:00
Michael Crenshaw
4f22dbda14 docs: update release cadence doc w/ future releases (#19065)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-07-15 21:34:34 -04:00
Rachel Sheikh
c14143635c fix(cli): add optional password setting for headless redis client (#19035) (#19039)
* chore: add optional password setting for headless redis client

Signed-off-by: Rachel Sheikh <rsheikh@squareup.com>

* fix: remove import cycle

Signed-off-by: Rachel Sheikh <rsheikh@squareup.com>

* fix: add shared SetOptionalRedisPasswordFromKubeConfig method

Signed-off-by: Rachel Sheikh <rsheikh@squareup.com>

* fix: export redis consts

Signed-off-by: Rachel Sheikh <rsheikh@squareup.com>

* test: add test cases for SetOptionalRedisPasswordFromKubeConfig()

Signed-off-by: Rachel Sheikh <rsheikh@squareup.com>

* chore: go mod tidy

Signed-off-by: Rachel Sheikh <rsheikh@squareup.com>

* fix: use require instead of assert

Signed-off-by: Rachel Sheikh <rsheikh@squareup.com>

* fix: Update common/common.go

Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Signed-off-by: Rachel Sheikh <sheikhrachel97@gmail.com>

---------

Signed-off-by: Rachel Sheikh <rsheikh@squareup.com>
Signed-off-by: Rachel Sheikh <sheikhrachel97@gmail.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-07-15 15:09:49 -04:00
Adrian Berger
7fdddbe59b feat: Add custom resource actions for flux resources (#18922)
* feat: Add custom resource actions for flux resources
Signed-off-by: Adrian Berger <adrian.berger@bedag.ch>

* chore: Add upgrade docs, change annotation text

Signed-off-by: Adrian Berger <adrian.berger@bedag.ch>

---------

Signed-off-by: Adrian Berger <adrian.berger@bedag.ch>
2024-07-15 13:44:32 -04:00
github-actions[bot]
dfaacef76f [Bot] docs: Update Snyk reports (#19046)
Signed-off-by: CI <ci@argoproj.com>
Co-authored-by: CI <ci@argoproj.com>
2024-07-15 11:11:27 -04:00
Andy Goldstein
7631d207e3 fix(controller): incorrect pruning of cluster-level resources and watches deadlock (#19040)
This update includes critical fixes that resolve an issue where
cluster-scoped resources could have been accidentally deleted during an
application sync if pruning is enabled.

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2024-07-15 15:02:07 +00:00
Matthieu MOREL
ed336c222e testifylint: fixes with upstream version (#19049)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-07-15 11:01:48 -04:00
lrost
c6f2d2896d docs: Add organisation to USERS.MD (#19050)
* Update USERS.md

Added Lely

Signed-off-by: lrost <luukrost@gmail.com>

* added municipality of The Hague

---------

Signed-off-by: lrost <luukrost@gmail.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-07-15 10:24:17 -04:00
Javier Solana
e7760b5e93 feat: Allow return the client without performing a matchRepository (#18053)
* return the client without performing a matchRepository operation when the application'plugin be configured by its name

Signed-off-by: Javier Solana <javier.solana@cabify.com>

* add CheckPluginConfiguration pre-flight operation

Signed-off-by: Javier Solana <javier.solana@cabify.com>

* fix lint

Signed-off-by: Javier Solana <javier.solana@cabify.com>

* Missing comment

Signed-off-by: Javier Solana <javier.solana@cabify.com>

* remove WithFields
Signed-off-by: Javier Solana <javier.solana@cabify.com>

* fix captLocal
Signed-off-by: Javier Solana <javier.solana@cabify.com>

---------

Signed-off-by: Javier Solana <javier.solana@cabify.com>
Co-authored-by: Javier Solana <javier.solana@cabify.com>
2024-07-15 09:02:25 -04:00
Jellyfrog
7f338e910f feat(health): support for aws.crossplane.io resources (#19029)
* feat(health): support for iam.aws.crossplane.io resources

Signed-off-by: Jellyfrog <Jellyfrog@users.noreply.github.com>

* feat(health): support for bucket s3.aws.crossplane.io resource

Signed-off-by: Jellyfrog <Jellyfrog@users.noreply.github.com>

---------

Signed-off-by: Jellyfrog <Jellyfrog@users.noreply.github.com>
2024-07-12 10:46:06 -04:00
Blake Pettersson
da7467bea7 chore: add issue template for proposing new dev-tools (#19001)
A while back @csantanapr proposed to add devcontainers to the Argo CD
tree (see #17286). After a few rounds in the contributors' meeting it
was proposed to add an issue template, so that for tools like this
there would at least be two maintainers that commit to keeping it
up-to-date.

See [proposal](https://docs.google.com/document/d/1mvfnaeCQgVpCixHchjMPtoW5WdtzLAp8cIr3nWFUSiU/edit)
for context.

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
2024-07-11 18:25:29 +02:00
dependabot[bot]
10ce884f7c chore(deps): bump actions/setup-go from 5.0.1 to 5.0.2 (#19020)
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 5.0.1 to 5.0.2.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](cdcb360436...0a12ed9d6a)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-11 11:17:36 -04:00
Jellyfrog
9712642eea fix: filename typo (#19028) 2024-07-11 14:29:19 +00:00
dependabot[bot]
79e43e85ab chore(deps): bump library/golang in /test/container (#19021)
Bumps library/golang from `e94e015` to `a7c0d04`.

---
updated-dependencies:
- dependency-name: library/golang
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-11 10:07:51 +03:00
dependabot[bot]
f7e7c2fc44 chore(deps): bump actions/setup-node from 4.0.2 to 4.0.3 (#19008)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 4.0.2 to 4.0.3.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](60edb5dd54...1e60f620b9)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-10 21:08:16 -04:00
appiepollo14
de76937242 Fixes https://github.com/argoproj/argo-cd/issues/18845 (#18854)
Signed-off-by: asjervanasten <asjer94@live.com>
2024-07-10 16:09:54 +00:00
dependabot[bot]
57baaad030 chore(deps): bump library/node from 22.4.0 to 22.4.1 in /ui-test (#19007)
Bumps library/node from 22.4.0 to 22.4.1.

---
updated-dependencies:
- dependency-name: library/node
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-10 11:11:01 +03:00
dependabot[bot]
2b340f7139 chore(deps): bump bitnami/kubectl in /test/container (#19005)
Bumps bitnami/kubectl from `225dae6` to `dc190b7`.

---
updated-dependencies:
- dependency-name: bitnami/kubectl
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-10 11:08:20 +03:00
dependabot[bot]
fdf05670aa chore(deps): bump library/node from 22.4.0 to 22.4.1 in /test/container (#19006)
Bumps library/node from 22.4.0 to 22.4.1.

---
updated-dependencies:
- dependency-name: library/node
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-10 11:07:59 +03:00
Andrii Korotkov
69908ceadd chore: Fix comparison_with_nothing_ms (#18923) (#18975)
The timing started before reconciliation timing started including get from the queue, leading to very big times reported, not making sense for what's actually going on.

Signed-off-by: Andrii Korotkov <andrii.korotkov@verkada.com>
2024-07-09 21:15:10 -04:00
Ishita Sequeira
19e3c1ae49 fix: pass refSources when calling GetAppDetails (#18962)
* Get refSources when calling GetAppDetails

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>

* fix lint errors

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>

* fix unit tests

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>

* fix unit tests

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>

---------

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>
2024-07-09 10:42:54 -04:00
Gergely Fábián
aa2837deac chore: bump go version to 1.22.5 (#18997)
Signed-off-by: Gergely Fábián <gergo.fb@gmail.com>
2024-07-09 15:08:41 +03:00
github-actions[bot]
9347d8d587 [Bot] docs: Update Snyk reports (#18967)
Signed-off-by: CI <ci@argoproj.com>
Co-authored-by: CI <ci@argoproj.com>
2024-07-08 14:44:46 +00:00
dependabot[bot]
c69dd943bc chore(deps): bump actions/upload-artifact from 4.3.3 to 4.3.4 (#18978)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.3.3 to 4.3.4.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](65462800fd...0b2256b8c0)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-08 10:33:56 -04:00
dependabot[bot]
af1217ffad chore(deps): bump actions/download-artifact from 4.1.7 to 4.1.8 (#18979)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4.1.7 to 4.1.8.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](65a9edc588...fa0a91b85d)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-08 10:33:33 -04:00
dependabot[bot]
a071f93b71 chore(deps-dev): bump @types/node from 20.14.9 to 20.14.10 in /ui-test (#18977)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.14.9 to 20.14.10.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-08 14:10:29 +03:00
dependabot[bot]
ddb809f3ce chore(deps): bump bitnami/kubectl in /test/container (#18976)
Bumps bitnami/kubectl from `031d565` to `225dae6`.

---
updated-dependencies:
- dependency-name: bitnami/kubectl
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-08 14:08:19 +03:00
dependabot[bot]
b9099935bc chore(deps): bump github.com/rs/cors from 1.9.0 to 1.11.0 (#18963)
Bumps [github.com/rs/cors](https://github.com/rs/cors) from 1.9.0 to 1.11.0.
- [Commits](https://github.com/rs/cors/compare/v1.9.0...v1.11.0)

---
updated-dependencies:
- dependency-name: github.com/rs/cors
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-05 21:10:54 +00:00
dependabot[bot]
fd677c6570 chore(deps): bump docker/build-push-action from 6.2.0 to 6.3.0 (#18933)
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 6.2.0 to 6.3.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](15560696de...1a162644f9)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-05 11:16:24 -04:00
dependabot[bot]
91c935b6d8 chore(deps): bump docker/setup-buildx-action from 3.0.0 to 3.4.0 (#18949)
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 3.0.0 to 3.4.0.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](f95db51fdd...4fd812986e)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-05 11:14:45 -04:00
david-wu-octopus
6db9186b58 fix(cli): Get Redis password from secret in loadClusters() (#18951)
* Get Redis password from secret in `loadClusters()`

Signed-off-by: David Wu <155603967+david-wu-octopus@users.noreply.github.com>

* feat: support redis password in admin stats command

Signed-off-by: pashakostohrys <pavel@codefresh.io>

* Simplify code

Signed-off-by: David Wu <155603967+david-wu-octopus@users.noreply.github.com>

---------

Signed-off-by: David Wu <155603967+david-wu-octopus@users.noreply.github.com>
Signed-off-by: pashakostohrys <pavel@codefresh.io>
Co-authored-by: pashakostohrys <pavel@codefresh.io>
2024-07-05 08:17:53 +00:00
dependabot[bot]
5c6c0c8c4f chore(deps): bump bitnami/kubectl in /test/container (#18950)
Bumps bitnami/kubectl from `a9e1c14` to `031d565`.

---
updated-dependencies:
- dependency-name: bitnami/kubectl
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-05 10:07:11 +03:00
Alexandre Gaudreault
a47243a935 fix(appset): missing permissions (#18829) (#18943) 2024-07-04 10:33:46 -04:00
Andrii Korotkov
b0024d145b chore: Add more logs with timing information to application controller [#18923] (#18926)
Closes #18923
There are some gaps in debugging information for long reconciliations. Fill in a lot of those gaps by adding more debug logs with timing information about different code execution steps.
Also, fix a flaky test in app_test.go.

Signed-off-by: Andrii Korotkov <andrii.korotkov@verkada.com>
2024-07-04 13:18:18 +03:00
dependabot[bot]
cc250aef32 chore(deps): bump library/golang in /test/container (#18938)
Bumps library/golang from `e763c65` to `e94e015`.

---
updated-dependencies:
- dependency-name: library/golang
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-04 13:05:57 +03:00
dependabot[bot]
f8966d837f chore(deps): bump library/node in /test/container (#18937)
Bumps library/node from `6507334` to `2558f19`.

---
updated-dependencies:
- dependency-name: library/node
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-04 12:08:40 +03:00
dependabot[bot]
4653a9b150 chore(deps): bump bitnami/kubectl in /test/container (#18939)
Bumps bitnami/kubectl from `3f6d478` to `a9e1c14`.

---
updated-dependencies:
- dependency-name: bitnami/kubectl
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-04 11:13:48 +03:00
dependabot[bot]
1bf2b7148b chore(deps): bump library/redis in /test/container (#18936)
Bumps library/redis from `9b68bd6` to `fb534a3`.

---
updated-dependencies:
- dependency-name: library/redis
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-04 11:12:34 +03:00
dependabot[bot]
21a64d3a6a chore(deps): bump library/node from 6507334 to 2558f19 in /ui-test (#18931)
Bumps library/node from `6507334` to `2558f19`.

---
updated-dependencies:
- dependency-name: library/node
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-04 11:12:15 +03:00
Michael Crenshaw
14ae4c43d9 docs: faq for 'field not declared in schema' (#18924)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-07-03 19:53:21 -04:00
Andrii Korotkov
79b18e03dc docs: Update health checks customizations documentation to use new format - Closes [#6175] (#18512)
Signed-off-by: Andrii Korotkov <andrii.korotkov@verkada.com>
2024-07-03 16:41:53 +03:00
dependabot[bot]
866b248df8 chore(deps): bump github.com/go-openapi/loads from 0.21.2 to 0.22.0 (#18911)
Bumps [github.com/go-openapi/loads](https://github.com/go-openapi/loads) from 0.21.2 to 0.22.0.
- [Commits](https://github.com/go-openapi/loads/compare/v0.21.2...v0.22.0)

---
updated-dependencies:
- dependency-name: github.com/go-openapi/loads
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-03 07:09:04 -04:00
Alan Clucas
20b5969b8f fix (dev): remove ubuntu user from test dockerimage (#18917)
Fixes #18773

In ubuntu 23.04 images and higher there is a default `ubuntu` user
with UID 1000. This is [by
design](https://bugs.launchpad.net/cloud-images/+bug/2005129) and
won't be reverted. The image was bumped to 24.04 in #17976.

Often a linux user will also be running as UID 1000, so the test image
creator will attempt to create the `user` user as that same UID, which
fails.

This change uses the workaround suggesed in
https://bugs.launchpad.net/cloud-images/+bug/2005129/comments/2 which
is a minimal change and "works for me".

We could attempt to use the `ubuntu` user instead of creating our own
user, and switch it's UID. This is a more invasive change and seems
more prone to not working, hence doing this.

Signed-off-by: Alan Clucas <alan@clucas.org>
2024-07-03 13:42:57 +03:00
dependabot[bot]
99c243cf81 chore(deps): bump gitpod/workspace-full from 8dd34e7 to fbff2dc (#18909)
Bumps gitpod/workspace-full from `8dd34e7` to `fbff2dc`.

---
updated-dependencies:
- dependency-name: gitpod/workspace-full
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-03 06:39:16 -04:00
dependabot[bot]
6061fd8d0c chore(deps): bump SonarSource/sonarqube-scan-action from 2.2.0 to 2.3.0 (#18913)
Bumps [SonarSource/sonarqube-scan-action](https://github.com/sonarsource/sonarqube-scan-action) from 2.2.0 to 2.3.0.
- [Release notes](https://github.com/sonarsource/sonarqube-scan-action/releases)
- [Commits](540792c588...aecaf43ae5)

---
updated-dependencies:
- dependency-name: SonarSource/sonarqube-scan-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-03 06:38:33 -04:00
dependabot[bot]
2e7ebf77d5 chore(deps): bump library/node from 22.3.0 to 22.4.0 in /ui-test (#18910)
Bumps library/node from 22.3.0 to 22.4.0.

---
updated-dependencies:
- dependency-name: library/node
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-03 10:47:08 +03:00
dependabot[bot]
efb394fb86 chore(deps): bump library/golang in /test/container (#18914)
Bumps library/golang from 1.22.4 to 1.23rc1.

---
updated-dependencies:
- dependency-name: library/golang
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-03 10:44:30 +03:00
dependabot[bot]
48a0dad326 chore(deps): bump library/node from 22.3.0 to 22.4.0 in /test/container (#18915)
Bumps library/node from 22.3.0 to 22.4.0.

---
updated-dependencies:
- dependency-name: library/node
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-03 10:44:12 +03:00
dependabot[bot]
f02d8f4fdf chore(deps): bump library/redis in /test/container (#18916)
Bumps library/redis from `e422889` to `9b68bd6`.

---
updated-dependencies:
- dependency-name: library/redis
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-03 10:43:58 +03:00
david-wu-octopus
18ccd7a667 feat: Add flag --sso-launch-browser to login and relogin commands (issue #16208) (#18865)
* Add flag `--sso-launch-browser` to `login` and `relogin` commands

Signed-off-by: David Wu <155603967+david-wu-octopus@users.noreply.github.com>

* Run `make codegen`

Signed-off-by: David Wu <155603967+david-wu-octopus@users.noreply.github.com>

* Add `ssoBrowserFlow()` and refactor `oauth2Login()`

Signed-off-by: David Wu <155603967+david-wu-octopus@users.noreply.github.com>

* Update references to "default browser" to "system default browser"

Signed-off-by: David Wu <155603967+david-wu-octopus@users.noreply.github.com>

* Add test case for `ssoBrowserFlow()` with `ssoLaunchBrowser` as `false`

Signed-off-by: David Wu <155603967+david-wu-octopus@users.noreply.github.com>

* Run `make codegen`

Signed-off-by: David Wu <155603967+david-wu-octopus@users.noreply.github.com>

* Update `Test_ssoBrowserFlow_ssoLaunchBrowser_false()`

Signed-off-by: David Wu <155603967+david-wu-octopus@users.noreply.github.com>

* Fix typo in unit test

Signed-off-by: David Wu <155603967+david-wu-octopus@users.noreply.github.com>

* Fix linting issues

Signed-off-by: David Wu <155603967+david-wu-octopus@users.noreply.github.com>

* Rename `ssoBrowserFlow()` to `ssoAuthFlow()`

Signed-off-by: David Wu <155603967+david-wu-octopus@users.noreply.github.com>

---------

Signed-off-by: David Wu <155603967+david-wu-octopus@users.noreply.github.com>
Co-authored-by: pasha-codefresh <pavel@codefresh.io>
2024-07-03 07:26:24 +00:00
Michael Crenshaw
b96be4c5e4 fix(ui): incorrect notifications annotation regex (#18901)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-07-02 14:44:24 -06:00
Michael Crenshaw
5fffcfaf6b fix: update static schemas (#18891)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Co-authored-by: Dan Garfield <dan@codefresh.io>
2024-07-02 19:37:32 +00:00
Zeus Arias Lucero
74c09a563e docs: Add Kustomize options to application.yaml (#18866)
* docs: Add Kustomize options to application.yaml

Signed-off-by: Zeus Arias Lucero <33123154+zeusal@users.noreply.github.com>

* Update application.yaml

Signed-off-by: Zeus Arias Lucero <33123154+zeusal@users.noreply.github.com>

* Update docs/operator-manual/application.yaml

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* Update docs/operator-manual/application.yaml

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

---------

Signed-off-by: Zeus Arias Lucero <33123154+zeusal@users.noreply.github.com>
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-07-02 19:05:01 +00:00
Helias Rodrigues
3c5ff60759 Update USERS.md (#18898)
Add CloudScript Argocd User company.

Signed-off-by: Helias Rodrigues <helias.rodrigues@cloudscript.com.br>
2024-07-02 18:33:21 +00:00
Ishita Sequeira
9a8f3cd6b0 remove unwanted updating of source-position in app set command (#18887)
Signed-off-by: ishitasequeira <ishiseq29@gmail.com>
2024-07-02 17:12:10 +00:00
Harshita Sao
12b626b82a chore: changed the scorecard badge link to the standard format (#18878)
Signed-off-by: harshitasao <harshitasao@gmail.com>
2024-07-02 11:54:46 -04:00
dependabot[bot]
a2e6434811 chore(deps): bump github.com/coreos/go-oidc/v3 from 3.6.0 to 3.10.0 (#18882)
Bumps [github.com/coreos/go-oidc/v3](https://github.com/coreos/go-oidc) from 3.6.0 to 3.10.0.
- [Release notes](https://github.com/coreos/go-oidc/releases)
- [Commits](https://github.com/coreos/go-oidc/compare/v3.6.0...v3.10.0)

---
updated-dependencies:
- dependency-name: github.com/coreos/go-oidc/v3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-02 11:53:44 -04:00
Cayde6
06b0f957b8 chore(migrate): migrate mockery codegen to use packages(#18579) (#18617)
* chore(migrate): mockery migrate to packages

migrate interface
- remove go:generate
- generate mock

Signed-off-by: Jack-R-lantern <tjdfkr2421@gmail.com>

* chore(migrate: mockery migrate to package

add mockgen stage
- add mockgen command to Makefile
- add generate-mock.sh
- add install mockery to install-codegen-go-tool.sh

Signed-off-by: Jack-R-lantern <tjdfkr2421@gmail.com>

---------

Signed-off-by: Jack-R-lantern <tjdfkr2421@gmail.com>
2024-07-02 10:48:38 -04:00
A S Rakesh Krishna
c6f96d7615 fix(cli): skip printing summary when output mode is set to json/yaml (issue: #18620) (#18797)
* skip printing summary when output mode is set to json/yaml

Signed-off-by: Fluder-Paradyne <121793617+Fluder-Paradyne@users.noreply.github.com>

* add test

Signed-off-by: Fluder-Paradyne <121793617+Fluder-Paradyne@users.noreply.github.com>

* add test

Signed-off-by: Fluder-Paradyne <121793617+Fluder-Paradyne@users.noreply.github.com>

* add check in timeout func

Signed-off-by: Fluder-Paradyne <121793617+Fluder-Paradyne@users.noreply.github.com>

* add test for wide mode

Signed-off-by: Fluder-Paradyne <121793617+Fluder-Paradyne@users.noreply.github.com>

* remove comment

Signed-off-by: Fluder-Paradyne <121793617+Fluder-Paradyne@users.noreply.github.com>

* remove comment and revert un-used parts of changes

Signed-off-by: Fluder-Paradyne <121793617+Fluder-Paradyne@users.noreply.github.com>

* remove comment and revert un-used parts of changes

Signed-off-by: Fluder-Paradyne <121793617+Fluder-Paradyne@users.noreply.github.com>

---------

Signed-off-by: Fluder-Paradyne <121793617+Fluder-Paradyne@users.noreply.github.com>
2024-07-02 10:20:46 +03:00
dependabot[bot]
1d59f46997 chore(deps): bump github.com/bmatcuk/doublestar/v4 from 4.6.0 to 4.6.1 (#18883)
Bumps [github.com/bmatcuk/doublestar/v4](https://github.com/bmatcuk/doublestar) from 4.6.0 to 4.6.1.
- [Release notes](https://github.com/bmatcuk/doublestar/releases)
- [Commits](https://github.com/bmatcuk/doublestar/compare/v4.6.0...v4.6.1)

---
updated-dependencies:
- dependency-name: github.com/bmatcuk/doublestar/v4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-02 09:35:40 +03:00
dependabot[bot]
1de81a4db2 chore(deps-dev): bump typescript from 5.5.2 to 5.5.3 in /ui-test (#18880)
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 5.5.2 to 5.5.3.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v5.5.2...v5.5.3)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-02 09:35:00 +03:00
dependabot[bot]
73bdbb511a chore(deps): bump github.com/casbin/casbin/v2 from 2.77.2 to 2.97.0 (#18862)
* chore(deps): bump github.com/casbin/casbin/v2 from 2.77.2 to 2.97.0

Bumps [github.com/casbin/casbin/v2](https://github.com/casbin/casbin) from 2.77.2 to 2.97.0.
- [Release notes](https://github.com/casbin/casbin/releases)
- [Changelog](https://github.com/casbin/casbin/blob/master/.releaserc.json)
- [Commits](https://github.com/casbin/casbin/compare/v2.77.2...v2.97.0)

---
updated-dependencies:
- dependency-name: github.com/casbin/casbin/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* fixes after version updates

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* tidy

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-07-01 12:58:58 -04:00
Jaeseok Lee
4312bc059f docs: Fix .path to .path.segments go template (#18872)
Signed-off-by: Jaeseok Lee <devsunb@gmail.com>
2024-07-01 10:48:03 -04:00
thecooldrop
eca1f21d64 Fix issue in starting telepresence for remote debugging (#18860)
Signed-off-by: TheCoolDrop <vanio.begic123@gmail.com>
Co-authored-by: pasha-codefresh <pavel@codefresh.io>
2024-07-01 07:23:30 +00:00
dependabot[bot]
dc8be08e0b chore(deps): bump bitnami/kubectl in /test/container (#18863)
Bumps bitnami/kubectl from `e704ebf` to `3f6d478`.

---
updated-dependencies:
- dependency-name: bitnami/kubectl
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-01 10:19:26 +03:00
dependabot[bot]
c3f108f85c chore(deps): bump github.com/alicebob/miniredis/v2 from 2.30.4 to 2.33.0 (#18861)
Bumps [github.com/alicebob/miniredis/v2](https://github.com/alicebob/miniredis) from 2.30.4 to 2.33.0.
- [Release notes](https://github.com/alicebob/miniredis/releases)
- [Changelog](https://github.com/alicebob/miniredis/blob/master/CHANGELOG.md)
- [Commits](https://github.com/alicebob/miniredis/compare/v2.30.4...v2.33.0)

---
updated-dependencies:
- dependency-name: github.com/alicebob/miniredis/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-01 10:14:47 +03:00
pasha-codefresh
1aa898cbb4 feat: support log level in cmp plugin, possibility to trace generated manifest (#18851)
* feat: support log level in cmp plugin, and add possibility to trace generated manifest

Signed-off-by: pashakostohrys <pavel@codefresh.io>

* feat: support log level in cmp plugin, and add possibility to trace generated manifest

Signed-off-by: pashakostohrys <pavel@codefresh.io>

---------

Signed-off-by: pashakostohrys <pavel@codefresh.io>
2024-06-30 15:49:07 -04:00
AvivGuiser
9b3a4d150d feat: add set-finallizer on argocd admin app generate-spec command (#18855)
* added set-finallizer on argocd admin command

Signed-off-by: AvivGuiser <aviv.guiser@placer.ai>

* ran make-codegen

Signed-off-by: AvivGuiser <aviv.guiser@placer.ai>

---------

Signed-off-by: AvivGuiser <aviv.guiser@placer.ai>
Co-authored-by: pasha-codefresh <pavel@codefresh.io>
2024-06-30 19:11:21 +00:00
github-actions[bot]
5a034f2261 [Bot] docs: Update Snyk reports (#18856)
Signed-off-by: CI <ci@argoproj.com>
Co-authored-by: CI <ci@argoproj.com>
2024-06-30 12:15:03 +03:00
Omer Aplatony
d171d05997 Add ArgoCD version metric (#18852)
Signed-off-by: Omer Aplatony <omerap12@gmail.com>
2024-06-30 12:09:10 +03:00
Yuan Tang
e6a034995c chore: Add Michael to owners (#18849)
Signed-off-by: Yuan Tang <terrytangyuan@gmail.com>
2024-06-29 12:24:37 -04:00
Michael Crenshaw
3d3620e6a0 fix(controller): bad server-side diffs (#18213) (#18840)
* fix(controller): bad server-side diffs (#18213)

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* use upstream commit

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

---------

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-06-29 11:03:36 -04:00
adam tombleson
51c8013d9c docs: update notifications secret name (#18850)
All other examples reference `argocd-notifications-secret`, this seems to be the correct name

Signed-off-by: adam tombleson <rekarnar@gmail.com>
2024-06-28 20:09:54 -06:00
Andreas Lindhé
0a14ef9b25 docs: Fix bad cluster generator parameters (#17770)
* docs: Fix bad cluster generator parameters

The previous variant used parameters `cluster` and `url`, which are
nowhere to be found (I'm guessing it's from an old version of the
Cluster generator). This change replaces them with the current
`.nameNormalized` and `.server` parameters.

Signed-off-by: Andreas Lindhé <andreas@lindhe.io>

* docs: Add reference to cluster generator docs

Signed-off-by: Andreas Lindhé <andreas@lindhe.io>

---------

Signed-off-by: Andreas Lindhé <andreas@lindhe.io>
2024-06-28 17:36:56 -06:00
Javier Solana
8ca96a9d0e add cabify (#18842)
Signed-off-by: Javier Solana <javiersolanahuertas@gmail.com>
2024-06-28 10:01:28 +02:00
dependabot[bot]
2988401c47 chore(deps): bump docker/build-push-action from 6.1.0 to 6.2.0 (#18834)
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 6.1.0 to 6.2.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](31159d49c0...15560696de)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-27 13:33:49 -04:00
Jae Ryong Song
dafb37c88d fix: docs version regex changed (#18756)
Signed-off-by: jasong <jasong@student.42seoul.kr>
2024-06-26 19:23:14 +05:30
Dhruvang Makadia
95be90b5f9 fix: Process webhook refresh in background to not block the request (#14269) (#18173)
Signed-off-by: dhruvang1 <dhruvang1@users.noreply.github.com>
2024-06-26 19:20:09 +05:30
dependabot[bot]
428da83bde chore(deps): bump library/registry in /test/container (#18746)
Bumps library/registry from `4fac7a8` to `38d1c15`.

---
updated-dependencies:
- dependency-name: library/registry
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-26 16:22:13 +03:00
dependabot[bot]
5355430bce chore(deps-dev): bump typescript from 5.4.5 to 5.5.2 in /ui-test (#18751)
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 5.4.5 to 5.5.2.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v5.4.5...v5.5.2)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-26 16:21:36 +03:00
dependabot[bot]
81151d5fc0 chore(deps-dev): bump @types/node from 20.14.8 to 20.14.9 in /ui-test (#18823)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.14.8 to 20.14.9.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-26 16:19:53 +03:00
dependabot[bot]
ee2dc25ff1 chore(deps): bump chromedriver from 126.0.3 to 126.0.4 in /ui-test (#18822)
Bumps [chromedriver](https://github.com/giggio/node-chromedriver) from 126.0.3 to 126.0.4.
- [Commits](https://github.com/giggio/node-chromedriver/compare/126.0.3...126.0.4)

---
updated-dependencies:
- dependency-name: chromedriver
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-26 16:19:32 +03:00
Yonatan Sasson
999b75fdc0 fix: Handle nil health check in post-delete hooks (#18270) (#18767)
* fix: Handle nil health check in post-delete hooks

Signed-off-by: Yonatan Sasson <yonatanxd7@gmail.com>

* test: Validate deletion of RBAC resources for post-delete hook

Signed-off-by: Yonatan Sasson <yonatanxd7@gmail.com>

* Update appcontroller_test.go

Signed-off-by: Yonatan Sasson <107778824+Yuni-sa@users.noreply.github.com>

---------

Signed-off-by: Yonatan Sasson <yonatanxd7@gmail.com>
Signed-off-by: Yonatan Sasson <107778824+Yuni-sa@users.noreply.github.com>
2024-06-26 08:53:09 -04:00
Alexy Mantha
6f84afca3b feat(appset): make K8s client configurable (#18623)
Signed-off-by: Alexy Mantha <alexy@mantha.dev>
2024-06-26 08:47:05 -04:00
Atıl Sensalduz
ad5f6724b5 chore: add Hazelcast to USERS.md (#18824)
Signed-off-by: atilsensalduz <atil.eren@outlook.com>
2024-06-26 12:26:32 +02:00
Orhan Gazi Dizdaroğlu
b33922fafb chore: add Getir to USERS.md (#18820)
Signed-off-by: Gazi Dizdaroğlu <orhan@gazidizdaroglu.com>
2024-06-25 23:50:56 +03:00
Alexandre Gaudreault
f358e8ddba fix(webhook): bitbucket and azure not triggering refresh (#18289) (#18765)
* fix(webhook): bitbucket and azure webhook not triggering refresh

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* update unit test

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* fix merge

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* adjust logic for reposerver using ls-remote

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

---------

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>
2024-06-25 18:16:55 +00:00
ymktmk
ba0ee5d01f fix: argo checkbox (#18793)
Signed-off-by: ymktmk <ymktmk.tt@gmail.com>
2024-06-25 13:24:22 -04:00
Michael Crenshaw
0183aac005 Revert "fix(appset): keep reconciling even when params error occurred (#17062)" (#18781)
This reverts commit 86369ca71d.

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-06-25 20:21:18 +03:00
dependabot[bot]
56c12db389 chore(deps-dev): bump @types/node from 20.14.7 to 20.14.8 in /ui-test (#18784)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.14.7 to 20.14.8.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-25 19:18:19 +03:00
dependabot[bot]
73984bdcab chore(deps): bump chromedriver from 126.0.2 to 126.0.3 in /ui-test (#18785)
Bumps [chromedriver](https://github.com/giggio/node-chromedriver) from 126.0.2 to 126.0.3.
- [Commits](https://github.com/giggio/node-chromedriver/compare/126.0.2...126.0.3)

---
updated-dependencies:
- dependency-name: chromedriver
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-25 19:18:06 +03:00
dependabot[bot]
03acafef1c chore(deps): bump library/node in /test/container (#18786)
Bumps library/node from `5e4044f` to `b98ec1c`.

---
updated-dependencies:
- dependency-name: library/node
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-25 19:17:48 +03:00
dependabot[bot]
a5805416df chore(deps): bump library/golang in /test/container (#18787)
Bumps library/golang from `c2010b9` to `a66eda6`.

---
updated-dependencies:
- dependency-name: library/golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-25 19:17:28 +03:00
dependabot[bot]
6b433e3bd1 chore(deps): bump library/golang from c2010b9 to a66eda6 (#18789)
Bumps library/golang from `c2010b9` to `a66eda6`.

---
updated-dependencies:
- dependency-name: library/golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-25 19:17:03 +03:00
github-actions[bot]
13b70c56ce [Bot] docs: Update Snyk reports (#18772)
Signed-off-by: CI <ci@argoproj.com>
Co-authored-by: CI <ci@argoproj.com>
2024-06-25 08:56:15 -07:00
dependabot[bot]
b92e00d598 chore(deps): bump github.com/hashicorp/go-retryablehttp (#18805)
Bumps [github.com/hashicorp/go-retryablehttp](https://github.com/hashicorp/go-retryablehttp) from 0.7.4 to 0.7.7.
- [Changelog](https://github.com/hashicorp/go-retryablehttp/blob/main/CHANGELOG.md)
- [Commits](https://github.com/hashicorp/go-retryablehttp/compare/v0.7.4...v0.7.7)

---
updated-dependencies:
- dependency-name: github.com/hashicorp/go-retryablehttp
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-25 10:16:15 -04:00
dependabot[bot]
f11de952a6 chore(deps): bump tj-actions/changed-files from 44.5.4 to 44.5.5 (#18809)
Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 44.5.4 to 44.5.5.
- [Release notes](https://github.com/tj-actions/changed-files/releases)
- [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md)
- [Commits](cc3bbb0c52...cc733854b1)

---
updated-dependencies:
- dependency-name: tj-actions/changed-files
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-25 10:15:27 -04:00
Jessie Teng
41b8e4406b fix(ui): break external links to lines for each (#17679) (#18768)
* break external links to lines for each

Signed-off-by: Jessie Teng <jessie.teng@fmr.com>

* update for better layout css style

Signed-off-by: Jessie Teng <jessie.teng@fmr.com>

---------

Signed-off-by: Jessie Teng <jessie.teng@fmr.com>
Co-authored-by: Jessie Teng <jessie.teng@fmr.com>
2024-06-25 00:07:06 +03:00
Justin Marquis
587c5ba1c6 chore: provide a better example of using cosign (#18803)
Signed-off-by: Justin Marquis <justin@akuity.io>
2024-06-24 20:47:36 +00:00
adam tombleson
b35acd4ffe docs: fix minor typo on ingress page (#18799)
Signed-off-by: adam tombleson <rekarnar@gmail.com>
2024-06-24 16:29:48 -04:00
Keith Chong
ad6508b9de fix: Bug in edit support in Sources tab; Input to loader (#17588) (#18800) 2024-06-24 13:08:16 -04:00
dependabot[bot]
c95d4eef58 chore(deps): bump library/node from 5e4044f to b98ec1c in /ui-test (#18790)
Bumps library/node from `5e4044f` to `b98ec1c`.

---
updated-dependencies:
- dependency-name: library/node
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-24 10:50:58 -04:00
dependabot[bot]
25e3a61938 chore(deps): bump docker/build-push-action from 6.0.2 to 6.1.0 (#18791)
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 6.0.2 to 6.1.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](f6010ea701...31159d49c0)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-24 09:29:37 -04:00
dependabot[bot]
9d72f1ec5c chore(deps): bump tj-actions/changed-files from 44.5.3 to 44.5.4 (#18792)
Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 44.5.3 to 44.5.4.
- [Release notes](https://github.com/tj-actions/changed-files/releases)
- [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md)
- [Commits](eaf854ef0c...cc3bbb0c52)

---
updated-dependencies:
- dependency-name: tj-actions/changed-files
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-24 09:29:04 -04:00
Michael Crenshaw
a624c90845 fix(server): could not find source for metadata revision (#18744) (#18763)
* fix(server): could not find source for metadata revision (#18744)

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* lint

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* the linter behaves poorly

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* fix test

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* share logic with chart endpoint

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* more intuitive check

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* remove debug line

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

---------

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-06-23 21:08:17 -04:00
Matthieu MOREL
3dcddee199 chore: enable float-compare rule from testifylint (#18721)
* chore: enable float-compare rule from testifylint

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>

* Update managed_fields_test.go

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>

* Update managed_fields_test.go

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>

---------

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-06-21 14:16:32 -04:00
dependabot[bot]
1e916d9bb9 chore(deps): bump tj-actions/changed-files from 44.5.2 to 44.5.3 (#18737)
Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 44.5.2 to 44.5.3.
- [Release notes](https://github.com/tj-actions/changed-files/releases)
- [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md)
- [Commits](d6babd6899...eaf854ef0c)

---
updated-dependencies:
- dependency-name: tj-actions/changed-files
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-21 14:15:15 -04:00
dependabot[bot]
f655b0b2df chore(deps): bump softprops/action-gh-release from 2.0.5 to 2.0.6 (#18736)
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 2.0.5 to 2.0.6.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](69320dbe05...a74c6b72af)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-21 14:14:12 -04:00
dependabot[bot]
cbb4c50018 chore(deps): bump peter-evans/create-pull-request from 6.0.5 to 6.1.0 (#18727)
Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 6.0.5 to 6.1.0.
- [Release notes](https://github.com/peter-evans/create-pull-request/releases)
- [Commits](6d6857d369...c5a7806660)

---
updated-dependencies:
- dependency-name: peter-evans/create-pull-request
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-21 14:13:44 -04:00
dependabot[bot]
e98d3b2a87 chore(deps): bump docker/build-push-action from 6.0.0 to 6.0.2 (#18749)
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 6.0.0 to 6.0.2.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](c382f710d3...f6010ea701)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-21 09:23:56 -04:00
dependabot[bot]
f7d854ec9e chore(deps-dev): bump @types/node from 20.14.6 to 20.14.7 in /ui-test (#18750)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.14.6 to 20.14.7.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-21 09:23:16 -04:00
Toni Grabulosa
d2436d9f4d Update USERS.md (#18743)
Signed-off-by: Toni Grabulosa <71640433+toniGrabulosa@users.noreply.github.com>
2024-06-20 18:25:09 +03:00
dependabot[bot]
1aeed6a6b1 chore(deps-dev): bump @types/node from 20.14.4 to 20.14.6 in /ui-test (#18738)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.14.4 to 20.14.6.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-20 11:57:28 +03:00
dependabot[bot]
c83a988009 chore(deps): bump chromedriver from 126.0.1 to 126.0.2 in /ui-test (#18739)
Bumps [chromedriver](https://github.com/giggio/node-chromedriver) from 126.0.1 to 126.0.2.
- [Commits](https://github.com/giggio/node-chromedriver/compare/126.0.1...126.0.2)

---
updated-dependencies:
- dependency-name: chromedriver
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-20 11:57:13 +03:00
Tim Schrumpf
331944aa6a fix(docs): fix example in userguide/diffing (#18730)
Signed-off-by: tillepille <github@tillepille.io>
2024-06-19 19:23:25 +03:00
Blake Pettersson
e6dc415d34 fix(ui): set project to empty string if undefined (#18732)
There are some situations where the project will be `undefined`. When
that happens, attempting to delete a repo won't be possible, since
the backend will be looking for a project with the literal name
`undefined`. To fix this, set an empty string for `undefined|null`
values.

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
2024-06-19 19:22:46 +03:00
Alexandre Gaudreault
6bc0b29dfe test(cli): unstable unit test caused by unsorted array (#18722)
Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>
2024-06-18 19:24:12 +00:00
github-actions[bot]
7c7af4040a chore: Bump version in master (#18717)
* Bump version in master

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update SECURITY-INSIGHTS.yml

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

---------

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Co-authored-by: ishitasequeira <46771830+ishitasequeira@users.noreply.github.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-06-18 15:57:01 +00:00
Michael Crenshaw
ff1d37fae6 fix(ci): use commit hash instead of release number in security insights (#18718)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-06-18 15:35:26 +00:00
Alexandre Gaudreault
70755aa3c5 feat(cli): add cmd to preview generated apps of appsets (#10895) (#16781)
* feat(cli): add cmd to preview generated apps

Signed-off-by: Alexandre Gaudreault <alexandre.gaudreault@logmein.com>

* fix build

Signed-off-by: Alexandre Gaudreault <alexandre.gaudreault@logmein.com>

* fix local proto gen

Signed-off-by: Alexandre Gaudreault <alexandre.gaudreault@logmein.com>

* dry run client

Signed-off-by: Alexandre Gaudreault <alexandre.gaudreault@logmein.com>

* fix: allow to run codegen outside GOPATH

Signed-off-by: Alexandre Gaudreault <alexandre.gaudreault@logmein.com>

* clientgen

Signed-off-by: Alexandre Gaudreault <alexandre.gaudreault@logmein.com>

* openapigen

Signed-off-by: Alexandre Gaudreault <alexandre.gaudreault@logmein.com>

* remove ensure-gopath

Signed-off-by: Alexandre Gaudreault <alexandre.gaudreault@logmein.com>

* fix tests and templatePatch

Signed-off-by: Alexandre Gaudreault <alexandre.gaudreault@logmein.com>

* fix build

Signed-off-by: Alexandre Gaudreault <alexandre.gaudreault@logmein.com>

* convert to interfaces

Signed-off-by: Alexandre Gaudreault <alexandre.gaudreault@logmein.com>

* codegen

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* extract common code

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* use appset params in server

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* codegen

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* fix test build

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* unit tests

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* move test to new package

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* move to correct folders

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* fix build

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* review

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* lint

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* fix test

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* fix lint

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* auto generate mocks

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* better error handling

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* more docs

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* more docs

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* lint

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

---------

Signed-off-by: Alexandre Gaudreault <alexandre.gaudreault@logmein.com>
Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-06-18 15:15:12 +00:00
Michael Crenshaw
5bf93d4955 docs: don't populate tested versions on latest (#18719)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-06-18 14:54:51 +00:00
dependabot[bot]
c88d3a9ab4 chore(deps): bump docker/build-push-action from 5.4.0 to 6.0.0 (#18708)
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 5.4.0 to 6.0.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](ca052bb54a...c382f710d3)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-18 10:06:49 -04:00
Matthieu MOREL
04edbe90d1 chore: enable error-is-as rule from testifylint linter (#18710)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-06-18 10:05:03 -04:00
dependabot[bot]
029b5acd54 chore(deps): bump ws from 8.17.0 to 8.17.1 in /ui-test (#18711)
Bumps [ws](https://github.com/websockets/ws) from 8.17.0 to 8.17.1.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/8.17.0...8.17.1)

---
updated-dependencies:
- dependency-name: ws
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-18 14:13:52 +03:00
dependabot[bot]
3f0d8d5629 chore(deps): bump ws from 8.17.0 to 8.17.1 in /ui (#18712)
Bumps [ws](https://github.com/websockets/ws) from 8.17.0 to 8.17.1.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/8.17.0...8.17.1)

---
updated-dependencies:
- dependency-name: ws
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-18 14:13:32 +03:00
dependabot[bot]
fe965ed14d chore(deps): bump library/redis in /test/container (#18707)
Bumps library/redis from `f5ef9e2` to `e422889`.

---
updated-dependencies:
- dependency-name: library/redis
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-18 10:46:24 +03:00
dependabot[bot]
e5eddc3b46 chore(deps): bump library/golang in /test/container (#18706)
Bumps library/golang from `4950c1c` to `c2010b9`.

---
updated-dependencies:
- dependency-name: library/golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-18 10:44:42 +03:00
dependabot[bot]
3fb9d9551d chore(deps-dev): bump @types/node from 20.14.2 to 20.14.4 in /ui-test (#18705)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.14.2 to 20.14.4.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-18 10:44:07 +03:00
dependabot[bot]
50f889c8b2 chore(deps): bump library/golang from 4950c1c to c2010b9 (#18704)
Bumps library/golang from `4950c1c` to `c2010b9`.

---
updated-dependencies:
- dependency-name: library/golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-18 10:43:27 +03:00
Yonatan Sasson
f8e2ca717c fix: JSON unmarshaling error handling and nil return (#18700)
* fix: JSON unmarshaling error handling and nil return in ExecuteHealthLua function

Signed-off-by: Yonatan Sasson <yonatanxd7@gmail.com>

* Update util/lua/lua.go

Co-authored-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

---------

Signed-off-by: Yonatan Sasson <yonatanxd7@gmail.com>
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Co-authored-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>
2024-06-18 02:41:51 +00:00
yyzxw
9f0d2a8fb4 fix: docs site version selector broken (#18378)
Signed-off-by: xiaowu.zhu <xiaowu.zhu@daocloud.io>
Signed-off-by: root <root@daocloud.io>
2024-06-17 21:52:08 -04:00
Matthieu MOREL
8f281996c6 chore: enable require-error from testifylint on cmpserver and reposerver folders (#18702)
* chore: enable require-error from testifylint on cmpserver and reposerver folders

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>

* Update app_k8s_events_test.go

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>

---------

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-06-17 21:35:35 -04:00
Siddhesh Ghadi
4c6ad9dcc1 feat: Add labels on Application's k8s events (#11381) (#18160)
* Add labels on Application's k8s events

Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com>

* Fix typo

Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com>

* Add new cm keys & doc

Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com>

* Fix typo

Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com>

* correct rebase changes

Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com>

* Fix linting

Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com>

---------

Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com>
2024-06-17 13:27:54 -04:00
Matthieu MOREL
d7fc1bf2d7 chore: enable require-error rule from errorlint linter on controller folder (#18690)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
Signed-off-by: pasha-codefresh <pavel@codefresh.io>
Co-authored-by: pasha-codefresh <pavel@codefresh.io>
2024-06-17 13:05:27 +00:00
Matthieu MOREL
4494fe5d3d chore: enable require-error rule from errorlint linter on applicationset folder (#18689)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
Signed-off-by: pasha-codefresh <pavel@codefresh.io>
Co-authored-by: pasha-codefresh <pavel@codefresh.io>
2024-06-17 09:51:06 +00:00
Matthieu MOREL
89a0cc33c5 chore: enable require-error rule from errorlint linter on pkg folder (#18691)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-06-17 11:54:22 +03:00
dependabot[bot]
e5c0526de4 chore(deps): bump library/golang from 0f76912 to a1dc408 (#18655)
Bumps library/golang from `0f76912` to `a1dc408`.

---
updated-dependencies:
- dependency-name: library/golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-17 10:29:27 +03:00
dependabot[bot]
af6021542a chore(deps): bump library/golang in /test/container (#18653)
Bumps library/golang from `0f76912` to `a1dc408`.

---
updated-dependencies:
- dependency-name: library/golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-17 10:29:00 +03:00
dependabot[bot]
1fd2f627e4 chore(deps): bump library/redis in /test/container (#18652)
Bumps library/redis from `01afb31` to `2cf43d9`.

---
updated-dependencies:
- dependency-name: library/redis
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-17 09:53:54 +03:00
dependabot[bot]
d57800fbae chore(deps): bump chromedriver from 126.0.0 to 126.0.1 in /ui-test (#18699)
Bumps [chromedriver](https://github.com/giggio/node-chromedriver) from 126.0.0 to 126.0.1.
- [Commits](https://github.com/giggio/node-chromedriver/compare/126.0.0...126.0.1)

---
updated-dependencies:
- dependency-name: chromedriver
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-17 09:53:00 +03:00
Matthieu MOREL
130c0f4f2e chore: missing qtar in go exclusions (#18698)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-06-16 23:21:45 +00:00
dependabot[bot]
52b1b434a3 chore(deps): bump tj-actions/changed-files from 42.0.2 to 44.5.2 (#18461)
Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 42.0.2 to 44.5.2.
- [Release notes](https://github.com/tj-actions/changed-files/releases)
- [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md)
- [Commits](90a06d6ba9...d6babd6899)

---
updated-dependencies:
- dependency-name: tj-actions/changed-files
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-15 21:26:20 -04:00
github-actions[bot]
b3b090b086 [Bot] docs: Update Snyk reports (#18692)
Signed-off-by: CI <ci@argoproj.com>
Co-authored-by: CI <ci@argoproj.com>
2024-06-16 00:31:59 +00:00
Matthieu MOREL
c556cf7ea5 chore: enable require-error rule from errorlint linter on server folder (#18687)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-06-15 19:13:40 -04:00
Michael Crenshaw
2aefa9c4b2 chore(deps): bump gitops engine (#18679)
* chore(deps): bump gitops engine

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* switch back to upstream

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

---------

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-06-15 19:54:55 +00:00
Shady Rafehi
336cc29f14 feat(reposerver): Skip calling git fetch if commit to checkout exists locally (#18657)
* Skip fetch if revision to check out exists locally

Signed-off-by: Shady Rafehi <shady@canva.com>

* Test reposerver/repository.checkoutRevision

Signed-off-by: Shady Rafehi <shady@canva.com>

* Test client.IsRevisionPresent

Signed-off-by: Shady Rafehi <shady@canva.com>

* Signoff

Signed-off-by: Shady Rafehi <shady@canva.com>

* Update reposerver/repository/repository.go

Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Signed-off-by: Shady Rafehi <shady@canva.com>

---------

Signed-off-by: Shady Rafehi <shady@canva.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-06-15 15:10:13 -04:00
Michael Crenshaw
dbb9bc8f92 chore: add codecov config to CI approvers (#18686)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-06-15 18:57:39 +00:00
Michael Crenshaw
1ecd39741f chore: ignore mocks in codecov (#18685)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-06-15 18:54:26 +00:00
Matthieu MOREL
f770a2a73a chore: enable require-error rule from errorlint linter on test folder (#18684)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-06-15 18:54:09 +00:00
Michael Crenshaw
ad461c2fe1 chore(deps): bump Kustomize from 3.14.4 to 3.15.2 (#18680)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-06-15 14:47:19 -04:00
Matthieu MOREL
38d6db6e69 chore: enable require-error rule from errorlint linter on cmd folder (#18683)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-06-15 13:52:21 -04:00
Matthieu MOREL
eac08dcf79 chore: extend require-error rule from testifylint (#18681)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-06-15 13:51:18 -04:00
Michael Crenshaw
e3fa52dd83 chore: bump version (#18677)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-06-15 00:44:19 +00:00
Michael Crenshaw
cc700df89b chore(ci): only test four latest k8s versions (#18676)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-06-14 23:42:37 +00:00
Matthieu MOREL
0d1d1a1b18 chore: extend require-error rule from testifylint (#18675)
* chore: extend require-error rule from testifylint

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>

* Update helm_test.go

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>

---------

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-06-14 17:40:33 -04:00
Michael Crenshaw
2c0cc027c2 docs(cli): remove docs for non-existing argocd app set flags (#18671) (#18673)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-06-14 17:35:58 -04:00
Michael Crenshaw
170d5431d3 chore(deps): bump library/golang from 0f76912 to a1dc408 (#18674)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-06-14 17:29:42 -04:00
dependabot[bot]
57965576f0 chore(deps): bump library/node in /test/container (#18651)
Bumps library/node from `f73cc32` to `5e4044f`.

---
updated-dependencies:
- dependency-name: library/node
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-14 14:16:02 -04:00
dependabot[bot]
57ee536f5f chore(deps): bump library/node from f73cc32 to 5e4044f (#18654)
Bumps library/node from `f73cc32` to `5e4044f`.

---
updated-dependencies:
- dependency-name: library/node
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-14 14:15:51 -04:00
dependabot[bot]
1405413ac9 chore(deps): bump library/node from f73cc32 to 5e4044f in /ui-test (#18656)
Bumps library/node from `f73cc32` to `5e4044f`.

---
updated-dependencies:
- dependency-name: library/node
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-14 14:15:41 -04:00
Suraj yadav
2d5c59c94e fix(ui): dropdown-fixed in logs (#18470)
* dropdown-fixed

Signed-off-by: Surajyadav <harrypotter1108@gmail.com>

* removed-extra-css

Signed-off-by: Surajyadav <harrypotter1108@gmail.com>

---------

Signed-off-by: Surajyadav <harrypotter1108@gmail.com>
2024-06-14 12:37:46 -04:00
Josh Soref
48eb7f3608 docs: Improve the FAQ (#12039) (#18645)
* docs: Fix whitespace around after open paren in FAQ

Signed-off-by: Josh Soref <jsoref@gmail.com>

* docs: Fix trailing whitespace

Signed-off-by: Josh Soref <jsoref@gmail.com>

* docs: Fix grammar in FAQ wrt redis auth

Signed-off-by: Josh Soref <jsoref@gmail.com>

* docs: Fix FAQ markdown for turning off redis auth

Signed-off-by: Josh Soref <jsoref@gmail.com>

* docs: Start talking about manifest generation

Signed-off-by: Josh Soref <jsoref@gmail.com>

---------

Signed-off-by: Josh Soref <jsoref@gmail.com>
2024-06-14 14:18:21 +00:00
Ishita Sequeira
03e6f8ae3f chore: update docs and skip gpg tests on appset (#18637)
Signed-off-by: ishitasequeira <ishiseq29@gmail.com>
2024-06-14 14:11:52 +00:00
Blake Pettersson
e02519467c fix: minor ui fixes for repositories (#18648)
* minor fixes

Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>

* fix: remove double import

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

---------

Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
Co-authored-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
2024-06-14 09:20:54 -04:00
Matthieu MOREL
c9ea5b13d2 chore: extend require-error rule from testifylint (#18658)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-06-14 09:15:31 -04:00
dependabot[bot]
f8557d2586 chore(deps): bump codecov/codecov-action from 4.4.1 to 4.5.0 (#18650)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4.4.1 to 4.5.0.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](125fc84a9a...e28ff129e5)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-14 09:13:25 -04:00
dependabot[bot]
1757b7e285 chore(deps): bump SonarSource/sonarqube-scan-action from 2.1.0 to 2.2 (#18649)
Bumps [SonarSource/sonarqube-scan-action](https://github.com/sonarsource/sonarqube-scan-action) from 2.1.0 to 2.2.
- [Release notes](https://github.com/sonarsource/sonarqube-scan-action/releases)
- [Commits](86fe817756...540792c588)

---
updated-dependencies:
- dependency-name: SonarSource/sonarqube-scan-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-14 09:12:40 -04:00
Ishita Sequeira
7efde25890 docs: update multiple sources docs (#18662)
Signed-off-by: ishitasequeira <ishiseq29@gmail.com>
2024-06-14 09:04:16 -04:00
Keith Chong
ae61752c29 feat: Provide Edit support in Sources tab for multi-source app (#17588) (#17890)
Signed-off-by: Keith Chong <kykchong@redhat.com>
2024-06-14 08:46:22 -04:00
Matthieu MOREL
9f1e2e8453 chore: enable gocritic linter (#18633)
* chore: enable gocritic linter

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>

* Update settings.go

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>

* Update app.go

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>

* Update grpcproxy.go

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>

* Update grpcproxy.go

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>

* Update util.go

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>

* Update server.go

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>

* Update app_management_ns_test.go

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>

* Update app_management_test.go

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>

* Update path_traversal.go

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>

* Update sessionmanager.go

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>

* Update .golangci.yaml

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>

---------

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-06-13 15:10:00 -04:00
rumstead
9592b84bcb feat: adding gocover to e2e tests (#18130) (#18537)
* feat: adding go coverage to e2e tests

Signed-off-by: rumstead <37445536+rumstead@users.noreply.github.com>

* feat: adding go coverage to e2e tests

Signed-off-by: rumstead <37445536+rumstead@users.noreply.github.com>

* feat: adding go coverage to e2e tests

Signed-off-by: rumstead <37445536+rumstead@users.noreply.github.com>

* feat: adding go coverage to e2e tests

Signed-off-by: rumstead <37445536+rumstead@users.noreply.github.com>

* feat: adding go coverage to e2e tests

Signed-off-by: rumstead <37445536+rumstead@users.noreply.github.com>

* feat: adding go coverage to e2e tests

Signed-off-by: rumstead <37445536+rumstead@users.noreply.github.com>

* feat: adding go coverage to e2e tests

Signed-off-by: rumstead <37445536+rumstead@users.noreply.github.com>

* feat: adding go coverage to e2e tests

Signed-off-by: rumstead <37445536+rumstead@users.noreply.github.com>

* feat: adding go coverage to e2e tests

Signed-off-by: rumstead <37445536+rumstead@users.noreply.github.com>

* feat: adding go coverage to e2e tests

Signed-off-by: rumstead <37445536+rumstead@users.noreply.github.com>

* feat: adding go coverage to e2e tests

Signed-off-by: rumstead <37445536+rumstead@users.noreply.github.com>

* feat: adding go coverage to e2e tests

Signed-off-by: rumstead <37445536+rumstead@users.noreply.github.com>

* feat: adding go coverage to e2e tests

Signed-off-by: rumstead <37445536+rumstead@users.noreply.github.com>

* feat: adding go coverage to e2e tests

Signed-off-by: rumstead <37445536+rumstead@users.noreply.github.com>

* feat: adding go coverage to e2e tests

Signed-off-by: rumstead <37445536+rumstead@users.noreply.github.com>

* feat: adding go coverage to e2e tests

Signed-off-by: rumstead <37445536+rumstead@users.noreply.github.com>

* feat: adding go coverage to e2e tests

Signed-off-by: rumstead <37445536+rumstead@users.noreply.github.com>

* feat: adding go coverage to e2e tests

Signed-off-by: rumstead <37445536+rumstead@users.noreply.github.com>

* try putting profiles in different directories

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* does this upload the whole directory?

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* create directories and only run one test

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* shut everything down before uploading coverage

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* don't fail on goreman failure

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* sleep 30

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* always upload server output

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* fix: implement graceful shutdown for api server

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* Shutdown servers in parallel

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* add noop shutdown function on api server constructor

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* fix waitgroup

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* more attempts to gracefully shut down

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* more tests

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* cleanup

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* revert graceful shutdown work, needs more work

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* more graceful shutdown cleanup

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* lint

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* feat: adding go coverage to e2e tests

Signed-off-by: rumstead <37445536+rumstead@users.noreply.github.com>

---------

Signed-off-by: rumstead <37445536+rumstead@users.noreply.github.com>
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Co-authored-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
2024-06-13 14:17:07 -04:00
dependabot[bot]
5efa404843 chore(deps): bump library/golang in /test/container (#18625)
Bumps library/golang from `969349b` to `0f76912`.

---
updated-dependencies:
- dependency-name: library/golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: pasha-codefresh <pavel@codefresh.io>
2024-06-13 10:22:04 -07:00
Raghavi
2040bd6871 fix: Correction in Rocket.chat documentation (#18498)
* Replaced email to SAMAccountName

Signed-off-by: Raghavi Shirur <rshirur@redhat.com>
Signed-off-by: Raghavi Shirur <raghaviss11@gmail.com>

* Replaced email to SAMAccountName

Signed-off-by: Raghavi Shirur <rshirur@redhat.com>
Signed-off-by: Raghavi Shirur <raghaviss11@gmail.com>

* Updated go.mod

Signed-off-by: Raghavi Shirur <rshirur@redhat.com>
Signed-off-by: Raghavi Shirur <raghaviss11@gmail.com>

* Revert "Updated go.mod"

This reverts commit a6466530041cb541fca020024c77047dcfed2ba5.

Signed-off-by: Raghavi Shirur <rshirur@redhat.com>
Signed-off-by: Raghavi Shirur <raghaviss11@gmail.com>

* Updated go.mod

Signed-off-by: Raghavi Shirur <rshirur@redhat.com>
Signed-off-by: Raghavi Shirur <raghaviss11@gmail.com>

* Fixed failing CI

Signed-off-by: Raghavi Shirur <rshirur@redhat.com>
Signed-off-by: Raghavi Shirur <raghaviss11@gmail.com>

* Fixed failing CI

Signed-off-by: Raghavi Shirur <rshirur@redhat.com>
Signed-off-by: Raghavi Shirur <raghaviss11@gmail.com>

* Fixed failing CI

Signed-off-by: Raghavi Shirur <rshirur@redhat.com>
Signed-off-by: Raghavi Shirur <raghaviss11@gmail.com>

* Fixed failing CI

Signed-off-by: Raghavi Shirur <rshirur@redhat.com>
Signed-off-by: Raghavi Shirur <raghaviss11@gmail.com>

---------

Signed-off-by: Raghavi Shirur <rshirur@redhat.com>
Signed-off-by: Raghavi Shirur <raghaviss11@gmail.com>
2024-06-13 12:58:01 -04:00
Keith Chong
9bc1578055 feat: Support Rollback multi-source apps; Follow-up to PR 14124 (#18615)
* feat: Support Rollback multi-source apps; Follow-up to PR 14124

Signed-off-by: Keith Chong <kykchong@redhat.com>

* Common up code

Signed-off-by: Keith Chong <kykchong@redhat.com>

---------

Signed-off-by: Keith Chong <kykchong@redhat.com>
2024-06-13 12:53:24 -04:00
Blake Pettersson
7adec6efb2 ci: updated yarn version (#18631)
With the Dependabot Node bump in #18610, the test container no longer
builds due to a change in Yarn version.

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
2024-06-13 10:20:24 -04:00
dependabot[bot]
6f76e7130f chore(deps): bump chromedriver from 125.0.3 to 126.0.0 in /ui-test (#18627)
Bumps [chromedriver](https://github.com/giggio/node-chromedriver) from 125.0.3 to 126.0.0.
- [Commits](https://github.com/giggio/node-chromedriver/compare/125.0.3...126.0.0)

---
updated-dependencies:
- dependency-name: chromedriver
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-13 10:42:32 +03:00
dependabot[bot]
6232d73c45 chore(deps): bump bitnami/kubectl in /test/container (#18626)
Bumps bitnami/kubectl from `cdca6c1` to `e704ebf`.

---
updated-dependencies:
- dependency-name: bitnami/kubectl
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-13 10:30:29 +03:00
dependabot[bot]
fba3c2eac3 chore(deps): bump library/golang from 969349b to 0f76912 (#18628)
Bumps library/golang from `969349b` to `0f76912`.

---
updated-dependencies:
- dependency-name: library/golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-13 10:29:35 +03:00
Matthieu MOREL
f7341ae652 chore: enable errorlint linter on cmpserver and reposerver folders (#18629)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-06-13 10:29:03 +03:00
Matthieu MOREL
311c0599d9 chore: enable require-error rule from testifylint linter (#18621)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-06-12 21:53:29 -04:00
Matthieu MOREL
f1848f5455 chore: enable errorlint linter on server folder (#18624)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-06-12 19:43:25 -04:00
Matthieu MOREL
204176a06b chore: enable errorlint linter on applicationset folder (#18618)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-06-12 16:29:03 -04:00
Suraj yadav
74a420dc61 fix(ui): pod log view dark mode toggle (#18424)
* moon-button-fixed

Signed-off-by: Surajyadav <harrypotter1108@gmail.com>

* reverted

Signed-off-by: Surajyadav <harrypotter1108@gmail.com>

* as it is

Signed-off-by: Surajyadav <harrypotter1108@gmail.com>

---------

Signed-off-by: Surajyadav <harrypotter1108@gmail.com>
2024-06-12 08:49:39 -04:00
dependabot[bot]
8f280cfdc6 chore(deps): bump braces from 3.0.2 to 3.0.3 in /ui-test (#18584)
Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3.
- [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micromatch/braces/compare/3.0.2...3.0.3)

---
updated-dependencies:
- dependency-name: braces
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-12 11:21:19 +03:00
dependabot[bot]
33df5acd5c chore(deps): bump library/node from 22.2.0 to 22.3.0 (#18611)
Bumps library/node from 22.2.0 to 22.3.0.

---
updated-dependencies:
- dependency-name: library/node
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-12 11:17:57 +03:00
dependabot[bot]
6c1f0f8cff chore(deps): bump library/node from 22.2.0 to 22.3.0 in /test/container (#18610)
Bumps library/node from 22.2.0 to 22.3.0.

---
updated-dependencies:
- dependency-name: library/node
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-12 11:15:03 +03:00
dependabot[bot]
2c532580b3 chore(deps): bump library/node from 22.2.0 to 22.3.0 in /ui-test (#18609)
Bumps library/node from 22.2.0 to 22.3.0.

---
updated-dependencies:
- dependency-name: library/node
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-12 11:14:49 +03:00
Ishita Sequeira
48bdf949a5 feat(appset): appset git generator verifies GPG signatures (#18545)
* feat(appset): appset git generator verifies GPG signatures

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>

* fix unit tests

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>

* fix generated code

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>

* add check for signatures in project and fix tests

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>

* fix tests

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>

* add e2e tests

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>

* address golang ci lint issue

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>

* fix golangci lint

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>

* Address comments

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>

* rebase and resolve conflicts

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>

---------

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>
Co-authored-by: pasha-codefresh <pavel@codefresh.io>
2024-06-12 07:57:25 +00:00
janiskemper
3e2cfb1387 docs: Add Syself to USERS.md (#18593)
Signed-off-by: janiskemper <janis.kemper@syself.com>
2024-06-11 15:33:45 -04:00
Matthieu MOREL
140f17255a chore: enable errorlint linter on controller folder (#18596)
* chore: enable errorlint linter on controller folder

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>

* Update cache.go

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>

* Update cache.go

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>

---------

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-06-11 15:33:22 -04:00
Matthieu MOREL
3160369469 chore: enable compare and nil-compare rules from testifylint linter (#18581)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-06-11 16:38:35 +00:00
Matthieu MOREL
7cf5ed06d4 chore: enable gofumpt and whitespace linters (#18567)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-06-11 15:41:55 +00:00
Matthieu MOREL
d7e99224d4 chore: enable errorlint linter on util folder (#18588)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-06-11 10:42:32 -04:00
dependabot[bot]
355ec75bed chore(deps): bump docker/build-push-action from 5.3.0 to 5.4.0 (#18583)
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 5.3.0 to 5.4.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](2cdde995de...ca052bb54a)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-11 04:43:07 +00:00
Jorge Turrado Ferrero
0e531c956e feat(application-controller): Add support for rollback multi-source applications (#14124)
* feat(application-controller): Add support for rollback multi-source applications

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* regenerate codegen after rebase

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* fix tests

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* fix front linting

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* update test

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* update codegen

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* Update server/application/application.go

Co-authored-by: Ishita Sequeira <46771830+ishitasequeira@users.noreply.github.com>
Signed-off-by: Jorge Turrado Ferrero <Jorge_turrado@hotmail.es>

* apply feedback

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* fix errors

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* add support for switching between single and multi

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* fix dereference issue

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* remove unnecesary code

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* Rebase master

Signed-off-by: Jorge Turrado <jorge.turrado@scrm.lidl>

* fix style

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* fix reference

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* add a comment

Signed-off-by: Jorge Turrado <jorge.turrado@scrm.lidl>

---------

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>
Signed-off-by: Jorge Turrado Ferrero <Jorge_turrado@hotmail.es>
Signed-off-by: Jorge Turrado <jorge.turrado@scrm.lidl>
Co-authored-by: Ishita Sequeira <46771830+ishitasequeira@users.noreply.github.com>
2024-06-10 17:54:07 -04:00
Michael Crenshaw
d8c8300f30 chore: add sonar-project.properties to cd in CODEOWNERS (#18577)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-06-10 21:41:17 +00:00
Matthieu MOREL
4a01f8a69a chore: enable expected-actual rule from testifylint linter (#18575)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-06-10 20:33:00 +00:00
Matthieu MOREL
772c31680b chore: enable errorlint linter on cmd folder (#18578)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-06-10 20:32:45 +00:00
Michael Crenshaw
879cc60c7b chore(ci): ignore test files from sonar monitoring (#18573)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-06-10 15:36:30 -04:00
Justin Marquis
020881af84 chore(deps): upgrade haproxy to 2.6.17-alpine (#18574)
Signed-off-by: Justin Marquis <justin@akuity.io>
2024-06-10 19:06:22 +00:00
bmopuri
45d68422da fix: InferenceService healthy condition change (#18340)
* fix: InferenceService healthy condition change

With Kerver upgrade to v12.0, Inference graphs and Inference Services can be deployed in raw mode that reduces overall resources that gets created.
Several knative resource dependency has been reduced. There by reduces the number of conditions in the status field as well.

Signed-off-by: Mopuri, Bharath <bharath_mopuri@intuit.com>

* fix: addressed code review comments

Protected new changes with a specific kserve v12 onwards Rawdeployment mode while keeping the existing resource checks as is.

Signed-off-by: Mopuri, Bharath <bharath_mopuri@intuit.com>

* Update resource_customizations/serving.kserve.io/InferenceService/health.lua

Co-authored-by: Rachit Chauhan <rachitchauhan43@gmail.com>
Signed-off-by: bmopuri <bharath.mopuri@gmail.com>

---------

Signed-off-by: Mopuri, Bharath <bharath_mopuri@intuit.com>
Signed-off-by: bmopuri <bharath.mopuri@gmail.com>
Co-authored-by: Mopuri, Bharath <bharath_mopuri@intuit.com>
Co-authored-by: Rachit Chauhan <rachitchauhan43@gmail.com>
2024-06-10 18:25:44 +00:00
rumstead
2547abc82d fix: sonar scanner #18513 (#18559)
* fix: sonar scanning

Signed-off-by: rumstead <37445536+rumstead@users.noreply.github.com>

* updating action to use sha

Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Signed-off-by: rumstead <37445536+rumstead@users.noreply.github.com>

---------

Signed-off-by: rumstead <37445536+rumstead@users.noreply.github.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-06-10 16:38:32 +00:00
Matthieu MOREL
32519c70a5 chore: enable error-nil rule from testifylint linter (#18544)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-06-10 10:38:55 -04:00
Matthieu MOREL
0d153ef253 chore: enable errorlint linter on pkg folder (#18563)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-06-10 09:20:23 -04:00
Matthieu MOREL
33df2ce698 chore: enable goimports linter (#18564)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-06-10 09:18:12 -04:00
github-actions[bot]
1d83e65e43 [Bot] docs: Update Snyk reports (#18561)
Signed-off-by: CI <ci@argoproj.com>
Co-authored-by: CI <ci@argoproj.com>
2024-06-10 10:02:05 +03:00
Blake Pettersson
4fd478b271 feat: project-scoped repository credential improvements (#18388)
* feat: project-scoped repo cred improvements

Implementation of #18290

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

* fix: missed a test

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

* wip project key changes

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

* test: update mocks

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

* test: fix tests

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

* fix: equivalence even if project is empty

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

* fix: wip delete

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

* refactor: remove repositorydb

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

* chore: improve logging

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

* fix: pass project to getrepository

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

* test: fix failing test

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

* fix: compare with project secret instead of app secret

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

* fix: get repository needs same logic as delete

Need to update the spec accordingly.

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

* feat: add project flag to repo rm command

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

* docs: make codegen

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

* test: fix failing test

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

* test: more failing tests

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

* chore: minor cleanups

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

* chore: propagate project from ui

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

* test: add new test cases

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

* chore: code review, improve formulation

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

* refactor: address cr feedback

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

---------

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
Co-authored-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
2024-06-07 18:47:55 -07:00
Matthieu MOREL
44b8dc1a4c chore: enable len and empty rules from testifylint linter (#18516)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-06-07 15:12:50 -04:00
Justin Marquis
50745f08e6 chore(deps): upgrade helm to 5.4.2 (#18556)
Signed-off-by: Justin Marquis <justin@akuity.io>
2024-06-07 11:10:42 -07:00
Michael Crenshaw
c4756c53e1 fix(ci): run codegen for docs changes (#18536)
* fix(ci): run codegen for docs changes

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* test docs change

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* revert test change

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

---------

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Co-authored-by: Blake Pettersson <blake.pettersson@gmail.com>
2024-06-07 12:09:50 +00:00
Justin Marquis
37238ab7c3 chore: bump go version to 1.22.4 (#18539)
Signed-off-by: Justin Marquis <justin@akuity.io>
2024-06-07 13:37:06 +02:00
Justin Marquis
d2fddb862f fix: github.com/cloudflare/circl High CVE (#18538)
Signed-off-by: Justin Marquis <justin@akuity.io>
2024-06-07 13:27:07 +02:00
Michael Crenshaw
2077688828 test: fix e2e tests after GHSA-3cqf-953p-h5cp (#18543) 2024-06-06 19:23:15 -04:00
William Parr
8107303398 fix(applicationset): prevent applicationset progressive sync from stalling in pending (#17296)
* fix(applicationset): prevent applicationset progressive sync from stalling in pending

Signed-off-by: wparr-circle <william.parr@circle.com>

* chore: remove out of date misleading comment

Signed-off-by: William Parr <william.parr@circle.com>

* chore: add reflect package removed by merge

Signed-off-by: wparr-circle <william.parr@circle.com>

---------

Signed-off-by: wparr-circle <william.parr@circle.com>
Signed-off-by: William Parr <william.parr@circle.com>
2024-06-06 16:29:15 -04:00
pasha-codefresh
c2647055c2 Merge pull request from GHSA-3cqf-953p-h5cp
* fix: prevent enumerating by cluster name, return exact error for case when cluster exists and not

Signed-off-by: pashakostohrys <pavel@codefresh.io>

* fix: prevent cluster enumeration by name

Signed-off-by: pashakostohrys <pavel@codefresh.io>

* fix: prevent cluster enumeration by name

Signed-off-by: pashakostohrys <pavel@codefresh.io>

* fix linter and add unit test

Signed-off-by: pashakostohrys <pavel@codefresh.io>

* fix linter and add unit test

Signed-off-by: pashakostohrys <pavel@codefresh.io>

* fix linter and add unit test

Signed-off-by: pashakostohrys <pavel@codefresh.io>

* fix linter and add unit test

Signed-off-by: pashakostohrys <pavel@codefresh.io>

* fix linter and add unit test

Signed-off-by: pashakostohrys <pavel@codefresh.io>

---------

Signed-off-by: pashakostohrys <pavel@codefresh.io>
2024-06-06 11:30:10 +03:00
Blake Pettersson
256d90178b Merge pull request from GHSA-87p9-x75h-p4j2
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
2024-06-06 11:25:55 +03:00
Nicholas Hawkes
60cdd7dde2 docs: update notifications troubleshooting-errors doc with custom secret (#18490)
* Update troubleshooting-errors with custom secret 

Adding section for a custom secret

Signed-off-by: Nicholas Hawkes <hawkesn@gmail.com>

* Update troubleshooting-errors.md

Signed-off-by: Nicholas Hawkes <hawkesn@gmail.com>

---------

Signed-off-by: Nicholas Hawkes <hawkesn@gmail.com>
2024-06-06 10:45:51 +03:00
dependabot[bot]
362b82123e chore(deps): bump bitnami/kubectl in /test/container (#18517)
Bumps bitnami/kubectl from `0aef4af` to `cdca6c1`.

---
updated-dependencies:
- dependency-name: bitnami/kubectl
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-06 10:44:58 +03:00
dependabot[bot]
240c008ef5 chore(deps-dev): bump @types/node from 20.14.1 to 20.14.2 in /ui-test (#18519)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.14.1 to 20.14.2.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-06 10:44:37 +03:00
Paul Larsen
92b22fd70b Move code around to fix commit attribution. (#18515)
Signed-off-by: Paul Larsen <pnvlarsen@gmail.com>
2024-06-06 00:35:06 +00:00
Pablo Aguilar
e54e45e1fd feat: changes git client to resolve semantic versioning tags (#17566)
* feat: changes git client to resolve semantic versioning tags

Signed-off-by: Pablo Aguilar <pablo.aguilar@outlook.com.br>

* docs: update documentation

Signed-off-by: Pablo Aguilar <pablo.aguilar@outlook.com.br>

* feat: simplify `resolveSemverRevision` method

Signed-off-by: Pablo Aguilar <pablo.aguilar@outlook.com.br>

* chore: add two more test cases

Signed-off-by: Pablo Aguilar <pablo.aguilar@outlook.com.br>

* chore: update `resolveSemverRevision` behavior

Signed-off-by: Pablo Aguilar <pablo.aguilar@outlook.com.br>

* chore: add end to end test

Signed-off-by: Pablo Aguilar <pablo.aguilar@outlook.com.br>

* chore: fix end to end test

Signed-off-by: Pablo Aguilar <pablo.aguilar@outlook.com.br>

* chore: improve semver constraint e2e testing

Signed-off-by: Pablo Aguilar <pablo.aguilar@outlook.com.br>

---------

Signed-off-by: Pablo Aguilar <pablo.aguilar@outlook.com.br>
2024-06-05 20:25:06 -04:00
Blake Pettersson
175d7eecf0 docs: proposal for enhancing scoped repository credentials (#18290)
* docs: proposal for enhancing scoped repository credentials

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

* docs: flesh out section on project matching

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

* docs: scope down proposal

For the sake of time and simplicity, we will not do any modifications
of `repo-creds` secrets for this proposal.

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

* docs: added feedback

Feedback from contributors' meeting, part one.

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

* docs: modification date

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

* docs: remove use cases

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

* docs: spec update

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

* docs: clarify backward-compatability

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

* chore: further clarification of backwards compatibility

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

* Update docs/proposals/project-scoped-repository-enhancements.md

Co-authored-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

* Update docs/proposals/project-scoped-repository-enhancements.md

Co-authored-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

* Update docs/proposals/project-scoped-repository-enhancements.md

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

* chore: behavior in line with current impl

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

* docs: add reviewers

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

* Update docs/proposals/project-scoped-repository-enhancements.md

Co-authored-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

---------

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
Co-authored-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Co-authored-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
2024-06-05 12:58:38 -10:00
Matthieu MOREL
71e1f30741 fix: enable bool-compare rule from testifylint linter (#18414) 2024-06-05 18:13:45 -04:00
Akram Ben Aissi
75cd97d6d4 feat: Consistent hashing with bounded loads algorithm for sharding (#16564)
* Adds consistent hashing with bound loads sharding algorithm

Signed-off-by: Akram Ben Aissi <akram.benaissi@gmail.com>

* Make the assignement consistent accross all clusters
- The assignment or running of the algorithm has to be consistent across all the clusters. Changed the function to return a map where the consistent hash will be used to build the map

- Modifications to the createConsistentHashsingWithBoundLoads function. This will create the map for cluster to shard. Note that the list must be consistent across all shards so that is why the cluster list must be sorted before going through the consistent hash algorithm

Signed-off-by: Akram Ben Aissi <akram.benaissi@gmail.com>

* Extracting constant and simplifying boolean expression

Signed-off-by: Akram Ben Aissi <akram.benaissi@gmail.com>

* Update docs: consistent-hashing sharding algorithm

Signed-off-by: Akram Ben Aissi <akram.benaissi@gmail.com>

---------

Signed-off-by: Akram Ben Aissi <akram.benaissi@gmail.com>
2024-06-05 18:28:19 +00:00
bhargav joshi
ea909fe820 Update ingress.md (#18491)
https://github.com/argoproj/argo-cd/issues/16611

Signed-off-by: bhargav joshi <bhargav.joshi@gmail.com>
2024-06-05 18:25:43 +00:00
dependabot[bot]
05576fdcd7 chore(deps): bump goreleaser/goreleaser-action from 5.1.0 to 6.0.0 (#18504)
* chore(deps): bump goreleaser/goreleaser-action from 5.1.0 to 6.0.0

Bumps [goreleaser/goreleaser-action](https://github.com/goreleaser/goreleaser-action) from 5.1.0 to 6.0.0.
- [Release notes](https://github.com/goreleaser/goreleaser-action/releases)
- [Commits](5742e2a039...286f3b13b1)

---
updated-dependencies:
- dependency-name: goreleaser/goreleaser-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* bump goreleaser version

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-06-05 13:42:48 -04:00
Zadkiel AHARONIAN
69e82ccbd6 chore: allow override of default e2e test args (#18415)
Signed-off-by: Zadkiel AHARONIAN <hello@zadkiel.fr>
2024-06-04 22:45:53 -04:00
yyzxw
3703a1ee7d fix: prevent preview changes sync (#18400)
Signed-off-by: xiaowu.zhu <xiaowu.zhu@daocloud.io>
2024-06-04 22:19:19 -04:00
Sn0rt
c99fd49ab2 feat: argocd cli support fish completion (#18484)
* feat: argocd cli support fish completion

Signed-off-by: Sn0rt <wangguohao.2009@gmail.com>

* fix: update user doc for argocd fish completion

Signed-off-by: Sn0rt <wangguohao.2009@gmail.com>

---------

Signed-off-by: Sn0rt <wangguohao.2009@gmail.com>
2024-06-04 17:15:58 -04:00
github-actions[bot]
f19825e79a [Bot] docs: Update Snyk reports (#18471)
Signed-off-by: CI <ci@argoproj.com>
Co-authored-by: CI <ci@argoproj.com>
Co-authored-by: pasha-codefresh <pavel@codefresh.io>
2024-06-04 15:30:07 +03:00
dependabot[bot]
6f43b68aff chore(deps): bump chromedriver from 125.0.2 to 125.0.3 in /ui-test (#18477)
Bumps [chromedriver](https://github.com/giggio/node-chromedriver) from 125.0.2 to 125.0.3.
- [Commits](https://github.com/giggio/node-chromedriver/compare/125.0.2...125.0.3)

---
updated-dependencies:
- dependency-name: chromedriver
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-04 15:26:35 +03:00
dependabot[bot]
c1960b5b87 chore(deps): bump @types/selenium-webdriver in /ui-test (#18476)
Bumps [@types/selenium-webdriver](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/selenium-webdriver) from 4.1.22 to 4.1.23.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/selenium-webdriver)

---
updated-dependencies:
- dependency-name: "@types/selenium-webdriver"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-04 15:25:59 +03:00
dependabot[bot]
d959a68450 chore(deps-dev): bump @types/node from 20.12.13 to 20.14.1 in /ui-test (#18493)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.12.13 to 20.14.1.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-04 15:25:26 +03:00
Mathieu Parent
d90cfafd21 docs: fix indentation (#18494)
Signed-off-by: Mathieu Parent <math.parent@gmail.com>
Co-authored-by: pasha-codefresh <pavel@codefresh.io>
2024-06-04 15:24:32 +03:00
dependabot[bot]
1f0c658e3f chore(deps): bump library/busybox in /test/e2e/multiarch-container (#18492)
Bumps library/busybox from `5eef5ed` to `9ae97d3`.

---
updated-dependencies:
- dependency-name: library/busybox
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-04 13:51:22 +03:00
Michael Crenshaw
2639c59bc6 chore: use redis secret when running locally (#18489)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-06-03 16:29:27 -04:00
Keith Chong
85ed1b96ea fix: Update braces package to 3.0.3 (#18459)
Signed-off-by: Keith Chong <kykchong@redhat.com>
2024-06-02 10:51:41 +03:00
dependabot[bot]
4fda009ea3 chore(deps): bump foundation-sites from 6.7.5 to 6.8.1 in /ui (#18462)
Bumps [foundation-sites](https://github.com/foundation/foundation-sites) from 6.7.5 to 6.8.1.
- [Release notes](https://github.com/foundation/foundation-sites/releases)
- [Commits](https://github.com/foundation/foundation-sites/compare/v6.7.5...v6.8.1)

---
updated-dependencies:
- dependency-name: foundation-sites
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-31 17:47:14 +03:00
Jann Fischer
ef37b39754 Revert "feat(server): log app Spec along with event (#16416)" (#18458)
This reverts commit 820f4d861a.

Signed-off-by: jannfis <jann@mistrust.net>
2024-05-30 20:03:34 +03:00
Tim Collins
1450f1031c chore: add pipekit to argocd USERS (#18457)
* chore: add pipekit to argocd USERS

Signed-off-by: Tim Collins <tim@thecollins.team>

* Trigger Build

Signed-off-by: Tim Collins <tim@thecollins.team>

---------

Signed-off-by: Tim Collins <tim@thecollins.team>
2024-05-30 13:35:48 +00:00
Tim Collins
7acd9f0659 docs: remove the recommendation to optionally auth redis for secrets mgmnt (#18455)
Signed-off-by: Tim Collins <tim@thecollins.team>
2024-05-30 16:34:12 +03:00
Nabil BENDAFI
7ccf826721 feat: Kyriba is using ArgoCD (#18456)
Signed-off-by: Nabil BENDAFI <nabilbendafi@users.noreply.github.com>
2024-05-30 03:18:20 -10:00
Miguel de Barros
1e2f5987d2 feat(issue/#17003): implement camel.apache.org/Integration CRD health checks (#17004)
* feat: implement camel.apache.org/Integration CRD health checks

Added custom health checks for Camel-K Integration CRDs

Signed-off-by: mdebarros <migueld@debarros.me>

* chore: cleanup up main health.lua

Signed-off-by: mdebarros <miguel@debarros.me>

---------

Signed-off-by: mdebarros <migueld@debarros.me>
Signed-off-by: mdebarros <miguel@debarros.me>
Co-authored-by: mdebarros <migueld@debarros.me>
2024-05-30 14:35:19 +03:00
Soumya Ghosh Dastidar
4d8436b7e1 feat: removed legacy app tracking label (#13203)
* feat: removed legacy app tracking label

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>

* feat: refactor SetAppInstanceLabel func

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>

* feat: refactor SetAppInstance func

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>

* feat: refactor SetAppInstanceAnnotation func

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>

* feat: refactored SetAppInstance() func

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>

---------

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>
Co-authored-by: pasha-codefresh <pavel@codefresh.io>
2024-05-30 11:50:20 +03:00
dependabot[bot]
e3dff07163 chore(deps-dev): bump monaco-editor-webpack-plugin in /ui (#18450)
Bumps [monaco-editor-webpack-plugin](https://github.com/microsoft/monaco-editor) from 7.0.1 to 7.1.0.
- [Release notes](https://github.com/microsoft/monaco-editor/releases)
- [Changelog](https://github.com/microsoft/monaco-editor/blob/main/CHANGELOG.md)
- [Commits](https://github.com/microsoft/monaco-editor/commits)

---
updated-dependencies:
- dependency-name: monaco-editor-webpack-plugin
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-30 10:37:24 +03:00
dependabot[bot]
ced9a4aa62 chore(deps-dev): bump @types/node from 20.12.12 to 20.12.13 in /ui-test (#18449)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.12.12 to 20.12.13.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-30 10:34:39 +03:00
dependabot[bot]
807754ce41 chore(deps-dev): bump sass-loader from 12.6.0 to 14.2.1 in /ui (#18451)
Bumps [sass-loader](https://github.com/webpack-contrib/sass-loader) from 12.6.0 to 14.2.1.
- [Release notes](https://github.com/webpack-contrib/sass-loader/releases)
- [Changelog](https://github.com/webpack-contrib/sass-loader/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack-contrib/sass-loader/compare/v12.6.0...v14.2.1)

---
updated-dependencies:
- dependency-name: sass-loader
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-30 10:34:21 +03:00
Huseyin Caliskan
2d2fb087ab Update ingress.md (#17766)
Replace argocd-redis-ha-haproxy in the istio documentation with argocd-redis.

Signed-off-by: Huseyin Caliskan <14217365+sakirma@users.noreply.github.com>
2024-05-29 21:12:47 -06:00
dependabot[bot]
55416adfcf chore(deps): bump @fortawesome/fontawesome-free in /ui (#18397)
Bumps [@fortawesome/fontawesome-free](https://github.com/FortAwesome/Font-Awesome) from 6.4.0 to 6.5.2.
- [Release notes](https://github.com/FortAwesome/Font-Awesome/releases)
- [Changelog](https://github.com/FortAwesome/Font-Awesome/blob/6.x/CHANGELOG.md)
- [Commits](https://github.com/FortAwesome/Font-Awesome/compare/6.4.0...6.5.2)

---
updated-dependencies:
- dependency-name: "@fortawesome/fontawesome-free"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-29 18:04:28 +03:00
Alexandre Gaudreault
ef9de40afa feat(ui): list dependent resources in delete popup (#18116)
* add icon in app table view

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* use defaut menu in tree-grouped

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* use default menu in pod views

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* fix custom delete actions

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* menu item in list

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* fix pod wrongly identified as root in network graph

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* update docs error

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* call delete pod action if kind is pod

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* add logs action to pods

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* delete in app details

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* use managed instead of root for menu items

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* lint fix

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* fix lint again

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* feat(ui): list dependent resources in delete popup

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* linting

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* childs to children

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* update ui dep

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

---------

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>
2024-05-29 10:53:08 -04:00
Philipp Erbelding
a36f50fce8 docs: Fix "core" link in getting started (#18437)
Signed-off-by: Philipp Erbelding <philipp@copythat.de>
Signed-off-by: Philipp Erbelding <philipp.erbelding@cleverbridge.com>
2024-05-29 09:44:55 +03:00
dependabot[bot]
21b1514465 chore(deps): bump docker/login-action from 3.1.0 to 3.2.0 (#18440)
Bumps [docker/login-action](https://github.com/docker/login-action) from 3.1.0 to 3.2.0.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](e92390c5fb...0d4c9c5ea7)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-29 09:01:30 +03:00
BarAshkenazi
dd3bb2bad4 fix: repo-server should allow not to skip hidden directories (#17957)
* Update repository.go

Signed-off-by: BarAshkenazi <barashkenazi2@gmail.com>
Signed-off-by: Bar <bar.ashkenazi@appsflyer.com>

* support hidden directories in repo server

Signed-off-by: Bar <bar.ashkenazi@appsflyer.com>

* support hidden directories in repo server

Signed-off-by: Bar <bar.ashkenazi@appsflyer.com>

* add dir exclusion pattern

Signed-off-by: Bar <bar.ashkenazi@appsflyer.com>

* support hidden directories

Signed-off-by: Bar <bar.ashkenazi@appsflyer.com>

* support hidden directories in repo server

Signed-off-by: Bar <bar.ashkenazi@appsflyer.com>

* support hidden directories in repo server

Signed-off-by: Bar <bar.ashkenazi@appsflyer.com>

* support hidden directories in repo server

Signed-off-by: Bar <bar.ashkenazi@appsflyer.com>

* support hidden directories in repo server

Signed-off-by: Bar <bar.ashkenazi@appsflyer.com>

* support hidden directories in repo server

Signed-off-by: Bar <bar.ashkenazi@appsflyer.com>

---------

Signed-off-by: BarAshkenazi <barashkenazi2@gmail.com>
Signed-off-by: Bar <bar.ashkenazi@appsflyer.com>
Co-authored-by: Bar <bar.ashkenazi@appsflyer.com>
2024-05-28 14:25:23 -04:00
Matthieu MOREL
9fe1dbfcad fix: enable misspell linter (#18412)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-05-28 12:51:04 +03:00
dependabot[bot]
8a28279921 chore(deps): bump library/redis in /test/container (#18421)
Bumps library/redis from `b32ea6e` to `01afb31`.

---
updated-dependencies:
- dependency-name: library/redis
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-27 10:17:39 +03:00
github-actions[bot]
8f02ec1c3e [Bot] docs: Update Snyk reports (#18413)
Signed-off-by: CI <ci@argoproj.com>
Co-authored-by: CI <ci@argoproj.com>
2024-05-27 10:16:28 +03:00
Matthieu MOREL
cd3c478a7a ci(lint): create .golangci.yaml (#18410)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-05-25 18:27:25 -04:00
Ishita Sequeira
d871b7f0c2 fix source ordering issue in manifest generation for multi-source app while using manifests and diff commands (#18395) 2024-05-24 16:50:56 -04:00
dependabot[bot]
1432f11bd9 chore(deps): bump chromedriver from 125.0.1 to 125.0.2 in /ui-test (#18399)
Bumps [chromedriver](https://github.com/giggio/node-chromedriver) from 125.0.1 to 125.0.2.
- [Commits](https://github.com/giggio/node-chromedriver/compare/125.0.1...125.0.2)

---
updated-dependencies:
- dependency-name: chromedriver
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-24 13:38:51 +03:00
Rafael Broseghini
97648eeb60 fixes list generator cluster element (#18389)
Signed-off-by: Dan Garfield <dan@codefresh.io>
2024-05-23 14:32:07 -06:00
dependabot[bot]
a95d595394 chore(deps): bump goreleaser/goreleaser-action from 5.0.0 to 5.1.0 (#18376)
Bumps [goreleaser/goreleaser-action](https://github.com/goreleaser/goreleaser-action) from 5.0.0 to 5.1.0.
- [Release notes](https://github.com/goreleaser/goreleaser-action/releases)
- [Commits](7ec5c2b0c6...5742e2a039)

---
updated-dependencies:
- dependency-name: goreleaser/goreleaser-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-23 11:48:00 -04:00
dependabot[bot]
45832ce1ab chore(deps): bump @types/superagent from 4.1.21 to 8.1.6 in /ui (#17606)
Bumps [@types/superagent](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/superagent) from 4.1.21 to 8.1.6.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/superagent)

---
updated-dependencies:
- dependency-name: "@types/superagent"
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: pasha-codefresh <pavel@codefresh.io>
2024-05-23 13:53:05 +03:00
dependabot[bot]
781261aab4 chore(deps-dev): bump @types/react-autocomplete in /ui (#18374)
Bumps [@types/react-autocomplete](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react-autocomplete) from 1.8.6 to 1.8.10.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react-autocomplete)

---
updated-dependencies:
- dependency-name: "@types/react-autocomplete"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-23 13:06:45 +03:00
dependabot[bot]
5452bf1250 chore(deps): bump sigstore/cosign-installer from 3.4.0 to 3.5.0 (#18182)
Bumps [sigstore/cosign-installer](https://github.com/sigstore/cosign-installer) from 3.4.0 to 3.5.0.
- [Release notes](https://github.com/sigstore/cosign-installer/releases)
- [Commits](e1523de757...59acb6260d)

---
updated-dependencies:
- dependency-name: sigstore/cosign-installer
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-23 11:33:21 +03:00
Blake Pettersson
049900e646 chore: automate mock generation v2 (#18371)
* Add go:generate statements for mockery

Signed-off-by: Will Roden <will@roden.cc>

* revert whitespace change

Signed-off-by: Will Roden <will@roden.cc>

* go generate everything

Signed-off-by: Will Roden <will@roden.cc>

* make gogen

Signed-off-by: Will Roden <will@roden.cc>

* chore: upgrade to mockery v2.40.2

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

---------

Signed-off-by: Will Roden <will@roden.cc>
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
Co-authored-by: Will Roden <will@roden.cc>
2024-05-23 11:15:15 +03:00
dependabot[bot]
9f27197da6 chore(deps): bump chromedriver from 125.0.0 to 125.0.1 in /ui-test (#18375)
Bumps [chromedriver](https://github.com/giggio/node-chromedriver) from 125.0.0 to 125.0.1.
- [Commits](https://github.com/giggio/node-chromedriver/compare/125.0.0...125.0.1)

---
updated-dependencies:
- dependency-name: chromedriver
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-23 11:13:19 +03:00
dependabot[bot]
37900ee774 chore(deps-dev): bump @types/react-paginate from 6.2.1 to 7.1.4 in /ui (#18373)
Bumps [@types/react-paginate](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react-paginate) from 6.2.1 to 7.1.4.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react-paginate)

---
updated-dependencies:
- dependency-name: "@types/react-paginate"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-22 23:50:52 -04:00
Nikhil Vaidyar
600737abe4 feat: Added the comment to support CLI message to get extended output (#18253)
* feat: Added the comment to support CLI message to get extended output #18226

Signed-off-by: nikzayn <nikhilvaidyar1997@gmail.com>

* feat: Updated proto and swagger #18226

Signed-off-by: nikzayn <nikhilvaidyar1997@gmail.com>

* feat: Updated manifest files

Signed-off-by: nikzayn <nikhilvaidyar1997@gmail.com>

---------

Signed-off-by: nikzayn <nikhilvaidyar1997@gmail.com>
Co-authored-by: pasha-codefresh <pavel@codefresh.io>
Co-authored-by: Ishita Sequeira <46771830+ishitasequeira@users.noreply.github.com>
2024-05-23 01:35:51 +00:00
May Zhang
d73eb8f7fd fix: remove Egress NetworkPolicy for argocd-redis and argocd-redis-ha-haproxy (#18367)
* fix: runing local failed

Signed-off-by: xiaowu.zhu <xiaowu.zhu@daocloud.io>

* fix: Redis egress removal

Signed-off-by: May Zhang <may_zhang@intuit.com>

---------

Signed-off-by: xiaowu.zhu <xiaowu.zhu@daocloud.io>
Signed-off-by: May Zhang <may_zhang@intuit.com>
Co-authored-by: yyzxw <1020938856@qq.com>
2024-05-22 19:47:09 -04:00
github-actions[bot]
52acbd55a7 [Bot] docs: Update Snyk reports (#18365)
Signed-off-by: CI <ci@argoproj.com>
Co-authored-by: CI <ci@argoproj.com>
2024-05-22 10:24:50 -07:00
dependabot[bot]
8776cc1a69 --- (#18362)
updated-dependencies:
- dependency-name: library/redis
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-22 16:08:43 +00:00
Dan Garfield
22a3a68fbb docs: Remove special characters from update doc (#18363)
* Remove special characters from update doc

Signed-off-by: Dan Garfield <dan@codefresh.io>

* remove extra line

* remove additional line

---------

Signed-off-by: Dan Garfield <dan@codefresh.io>
2024-05-22 09:44:50 -06:00
rkriplani76
cd1435608d removing strikeout as it was populating special character issue #14139 (#14823)
Signed-off-by: Rajesh Kriplani <rajesh.kriplani@gmail.com>
2024-05-22 18:26:03 +03:00
Michael Chen
00672a8ff5 docs: Clarify how Argo CD detects and uses Kustomize (#11417)
* Add an example similar to the Helm topic

This topic is missing a simple example like the next topic "Helm" to show how to define a Kustomize based application.
https://argo-cd.readthedocs.io/en/stable/user-guide/helm/

Signed-off-by: Michael Chen <4326639+mcgitty@users.noreply.github.com>

* Clarify how Argo CD detects and use Kustomize

This description seems trivial to the designer of Argo CD, but it is a critical information for people learning Argo CD.

Signed-off-by: Michael Chen <4326639+mcgitty@users.noreply.github.com>

* Also mention 'path' in spec.source

Signed-off-by: Michael Chen <4326639+mcgitty@users.noreply.github.com>

* Update docs/user-guide/kustomize.md

Signed-off-by: Dan Garfield <dan@codefresh.io>

Signed-off-by: Dan Garfield <dan@codefresh.io>

* Update docs/user-guide/kustomize.md

Signed-off-by: Dan Garfield <dan@codefresh.io>

Signed-off-by: Dan Garfield <dan@codefresh.io>

---------

Signed-off-by: Michael Chen <4326639+mcgitty@users.noreply.github.com>
Signed-off-by: Dan Garfield <dan@codefresh.io>
Co-authored-by: Dan Garfield <dan@codefresh.io>
2024-05-22 15:13:11 +00:00
Cayde6
ee9b38fe5c feat: add ls-remote request fail metric (#18250)
Added argocd_git_lsremote_fail_total metric.
Increment this metric if a git ls-remote request fails.

Signed-off-by: Jack-R-lantern <tjdfkr2421@gmail.com>
2024-05-22 17:37:22 +03:00
Zack Robinson
59ce337d32 fix: app names with non-alphanumeric characters in position 63 break syncs (issue #18237) (#18256)
* Ensure truncated app label does not end in a special character

Signed-off-by: Zack Robinson <robinsoz@arcesium.com>

* Move regex to global variable and add out of bounds check

Signed-off-by: Zack Robinson <robinsoz@arcesium.com>

* Add test for out-of-bounds check

Signed-off-by: Zack Robinson <robinsoz@arcesium.com>

---------

Signed-off-by: Zack Robinson <robinsoz@arcesium.com>
2024-05-22 08:30:54 -06:00
dependabot[bot]
4606476adb --- (#18313)
updated-dependencies:
- dependency-name: selenium-webdriver
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: "@types/selenium-webdriver"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-22 15:03:58 +03:00
dependabot[bot]
6a68b95dfc --- (#18352)
updated-dependencies:
- dependency-name: peter-evans/create-pull-request
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-22 14:16:19 +03:00
Michael Crenshaw
bd671e8473 chore(deps): bump golang.org/x/net from v0.21.0 to v0.25.0 (#18176)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-05-22 14:15:24 +03:00
dependabot[bot]
96c2a95503 --- (#18346)
updated-dependencies:
- dependency-name: assert
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-22 12:36:50 +03:00
dependabot[bot]
cef69c3bb1 --- (#18345)
updated-dependencies:
- dependency-name: gitpod/workspace-full
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-22 12:29:25 +03:00
dependabot[bot]
0ec7f82fa4 --- (#18349)
updated-dependencies:
- dependency-name: html-webpack-plugin
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-22 12:26:28 +03:00
dependabot[bot]
4aa62699da --- (#18353)
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-22 12:25:19 +03:00
Mark Tallentire
6110581e97 Update docs for azure workload identity cluster setup (#18357)
Adds a missing step to the docs for declarative setup of an AKS cluster using workload identity for adding annotations to the service accounts.

Signed-off-by: Mark Tallentire <lonelycooler@googlemail.com>
2024-05-22 12:00:53 +03:00
david-wu-octopus
462c9ecd11 fix(ui): Fix jumpy "Source" panel when typing (issue #15961) (#18227)
* Debounce `props.onAppChanged()` with a wait time of 500ms

Signed-off-by: David Wu <155603967+david-wu-octopus@users.noreply.github.com>

* Increase debounce wait time to 800ms

Signed-off-by: David Wu <155603967+david-wu-octopus@users.noreply.github.com>

* Fix linting error

Signed-off-by: David Wu <155603967+david-wu-octopus@users.noreply.github.com>

---------

Signed-off-by: David Wu <155603967+david-wu-octopus@users.noreply.github.com>
2024-05-22 11:59:39 +03:00
Michael Crenshaw
bc53266591 chore(deps): bump golangci/golangci-lint-action from v3.7.0 to 6.0.1 (#18148)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-05-21 18:06:03 -04:00
Michael Crenshaw
1453dc4c34 fix(ci): codecov (#18335)
* fix(ci): codecov

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* build UI for frontend or backend

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* use token, fail ci on error

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

---------

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-05-21 21:09:09 +00:00
Michael Crenshaw
78e0fc4b7d docs: redis-ha registry change (#18329)
* docs: redis-ha registry change

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* update language

Co-Authored-By: Avo Sepp <68659218+avo-sepp@users.noreply.github.com>
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

---------

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Co-authored-by: Avo Sepp <68659218+avo-sepp@users.noreply.github.com>
2024-05-21 19:30:26 +00:00
May Zhang
8dff209cba Merge pull request from GHSA-9766-5277-j5hr
* fix: Enable Redis authentication in the default installation

Signed-off-by: May Zhang <may_zhang@intuit.com>

* chore: fix git_test unit test

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

---------

Signed-off-by: May Zhang <may_zhang@intuit.com>
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
Co-authored-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
Co-authored-by: pashakostohrys <pavel@codefresh.io>
2024-05-21 16:23:09 +03:00
May Zhang
13d5803e75 Merge pull request from GHSA-9766-5277-j5hr
* fix: Enable Redis authentication in the default installation

Signed-off-by: May Zhang <may_zhang@intuit.com>

* chore: fix git_test unit test

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

---------

Signed-off-by: May Zhang <may_zhang@intuit.com>
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
Co-authored-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
Co-authored-by: pashakostohrys <pavel@codefresh.io>
2024-05-21 16:22:43 +03:00
dependabot[bot]
2dd5cd8b9a --- (#18318)
updated-dependencies:
- dependency-name: minimatch
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-21 13:52:50 +03:00
lenglet-k
f13861740c feat: Implement KafkaConnector,KafkaBridge CRD health checks (#18316) 2024-05-21 12:10:53 +03:00
dependabot[bot]
e0968177e0 --- (#18314)
updated-dependencies:
- dependency-name: mocha
  dependency-type: direct:development
  update-type: version-update:semver-major
- dependency-name: "@types/mocha"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-21 11:46:22 +03:00
A S Rakesh Krishna
43cb8003d1 add fullscreen prop (#18309)
Signed-off-by: Fluder-Paradyne <121793617+Fluder-Paradyne@users.noreply.github.com>
2024-05-21 11:16:11 +03:00
dependabot[bot]
441367ff52 --- (#18307)
updated-dependencies:
- dependency-name: library/redis
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-21 11:01:02 +03:00
dependabot[bot]
fda368b6bb chore(deps-dev): bump @types/node from 14.14.14 to 20.12.12 in /ui-test (#18301)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.14 to 20.12.12.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-21 10:35:30 +03:00
dependabot[bot]
e34aa2f4b4 --- (#18315)
updated-dependencies:
- dependency-name: yarn
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-21 10:34:32 +03:00
dependabot[bot]
63743315a6 --- (#18311) 2024-05-21 09:37:12 +03:00
dependabot[bot]
36b8ff51d7 --- (#18312) 2024-05-21 09:36:40 +03:00
Brice Burgess
4c754c8ad4 docs(webhook): include installation instructions on Triggers and Templates page (#18304) 2024-05-21 09:07:05 +03:00
dependabot[bot]
d1135c133b chore(deps-dev): bump dotenv from 8.2.0 to 16.4.5 in /ui-test (#18298) 2024-05-21 09:04:07 +03:00
dependabot[bot]
5d31b03d7d chore(deps): bump gitpod/workspace-full from 511cecd to f569b00 (#17565) 2024-05-21 09:03:37 +03:00
dependabot[bot]
b447dccde8 chore(deps): bump chromedriver from 94.0.0 to 125.0.0 in /ui-test (#18303)
Bumps [chromedriver](https://github.com/giggio/node-chromedriver) from 94.0.0 to 125.0.0.
- [Commits](https://github.com/giggio/node-chromedriver/compare/94.0.0...125.0.0)

---
updated-dependencies:
- dependency-name: chromedriver
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-20 23:09:47 +03:00
pasha-codefresh
aa7f1c5c2e chore: update jest version (#18295)
* update jest version in order to resolve
https://github.com/argoproj/argo-cd/pull/14585/files

Signed-off-by: pashakostohrys <pavel@codefresh.io>

* update jest version in order to resolve
https://github.com/argoproj/argo-cd/pull/14585/files

Signed-off-by: pashakostohrys <pavel@codefresh.io>

* update ts jest

Signed-off-by: pashakostohrys <pavel@codefresh.io>

* update ts jest

Signed-off-by: pashakostohrys <pavel@codefresh.io>

---------

Signed-off-by: pashakostohrys <pavel@codefresh.io>
2024-05-20 23:06:40 +03:00
dependabot[bot]
ddc85238f4 chore(deps): bump library/node from 21.7.0 to 22.2.0 (#18297)
Bumps library/node from 21.7.0 to 22.2.0.

---
updated-dependencies:
- dependency-name: library/node
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-20 22:20:35 +03:00
dependabot[bot]
90df1e6d5d chore(deps-dev): bump prettier from 1.19.1 to 2.8.8 in /ui-test (#18302)
Bumps [prettier](https://github.com/prettier/prettier) from 1.19.1 to 2.8.8.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/1.19.1...2.8.8)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-20 22:18:52 +03:00
dependabot[bot]
3c19fdbdc7 chore(deps-dev): bump typescript from 4.1.3 to 5.4.5 in /ui-test (#18300)
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.1.3 to 5.4.5.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v4.1.3...v5.4.5)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-20 22:18:35 +03:00
Justin Marquis
95d37dc87d fix(deps): upgrade otel dependency (#18285)
Signed-off-by: Justin Marquis <justin@akuity.io>
Co-authored-by: Soumya Ghosh Dastidar <44349253+gdsoumya@users.noreply.github.com>
2024-05-20 13:35:29 -04:00
Cheng Fang
4f6666940b chore(ci): add /ui-test/ directory to dependabot.yml (#16235)
Signed-off-by: Cheng Fang <cfang@redhat.com>
Co-authored-by: pasha-codefresh <pavel@codefresh.io>
2024-05-20 15:17:08 +00:00
dependabot[bot]
8480f5cd87 chore(deps): bump library/node from 21.6.2 to 21.7.0 (#17446)
Bumps library/node from 21.6.2 to 21.7.0.

---
updated-dependencies:
- dependency-name: library/node
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: pasha-codefresh <pavel@codefresh.io>
2024-05-20 16:53:51 +03:00
Nikhil Vaidyar
9c8d652471 feat: Adding the domain_hint as an optional field in OIDC configuration (#18214)
* [18066] - Added DomainHint key in OIDCConfig struct

Signed-off-by: nikzayn <nikhilvaidyar1997@gmail.com>

* [18066] - Added DomainHint in options for grantType

Signed-off-by: nikzayn <nikhilvaidyar1997@gmail.com>

* [18066] - Auth0 readme.md --updated

Signed-off-by: nikzayn <nikhilvaidyar1997@gmail.com>

---------

Signed-off-by: nikzayn <nikhilvaidyar1997@gmail.com>
2024-05-20 12:08:28 +03:00
happyso
4d61974d58 fix(ui): Add title for full content without clicking (issue #17600) (#18243)
* fix: Add title for full content without clicking

Signed-off-by: sunyeongchoi <suoung0716@gmail.com>

* fix: apply ui lint

Signed-off-by: sunyeongchoi <suoung0716@gmail.com>

* fix: apply argo-ui Tooltip and define local variable

Signed-off-by: sunyeongchoi <suoung0716@gmail.com>

---------

Signed-off-by: sunyeongchoi <suoung0716@gmail.com>
2024-05-20 11:18:19 +03:00
condaatje
257b242efd add apiVersion so yaml applies properly in-cluster (#18282)
Signed-off-by: condaatje <condaatje@users.noreply.github.com>
2024-05-20 09:53:20 +02:00
david-wu-octopus
22993deb86 fix(ui): Fix excessive padding on system level extension pages (issue #17929) (#18207)
* Remove CSS class `.cd-layout--extension`

Signed-off-by: David Wu <155603967+david-wu-octopus@users.noreply.github.com>

* Remove all usages of CSS class `.cd-layout--extension`

Signed-off-by: David Wu <155603967+david-wu-octopus@users.noreply.github.com>

* Remove unused prop `isExtension` from `<Layout />`

Signed-off-by: David Wu <155603967+david-wu-octopus@users.noreply.github.com>

* Remove unused property `extension` from type `Routes`

Signed-off-by: David Wu <155603967+david-wu-octopus@users.noreply.github.com>

* Fix linting error

Signed-off-by: David Wu <155603967+david-wu-octopus@users.noreply.github.com>

---------

Signed-off-by: David Wu <155603967+david-wu-octopus@users.noreply.github.com>
2024-05-19 21:29:52 -04:00
github-actions[bot]
8cf3e05fd4 [Bot] docs: Update Snyk reports (#18276) 2024-05-19 18:54:12 +03:00
Tomáš Novák
210f26ae83 fix(reposerver): fix OCI repository matching (#17955)
Signed-off-by: Tomáš Novák <tomas.novak@bcas.cz>
2024-05-17 22:41:23 +03:00
Justin Marquis
2e43af50da chore(deps): upgrade helm to 3.14.4 (#18255)
* chore(deps): upgrade helm to 3.14.4

Signed-off-by: Justin Marquis <justin@akuity.io>

* place checksums where they belong

Signed-off-by: Justin Marquis <justin@akuity.io>

---------

Signed-off-by: Justin Marquis <justin@akuity.io>
Co-authored-by: Dan Garfield <dan@codefresh.io>
2024-05-17 13:58:22 +03:00
dependabot[bot]
e6ea861561 chore(deps): bump bitnami/kubectl in /test/container (#18262)
Bumps bitnami/kubectl from `09c66fb` to `0aef4af`.

---
updated-dependencies:
- dependency-name: bitnami/kubectl
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-17 13:55:59 +03:00
dependabot[bot]
cd21752d25 chore(deps): bump library/node from 22.1.0 to 22.2.0 in /test/container (#18261)
Bumps library/node from 22.1.0 to 22.2.0.

---
updated-dependencies:
- dependency-name: library/node
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-17 13:55:42 +03:00
dependabot[bot]
800cc5e2dc chore(deps): bump library/node from 22.1.0 to 22.2.0 in /ui-test (#18260)
Bumps library/node from 22.1.0 to 22.2.0.

---
updated-dependencies:
- dependency-name: library/node
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-17 13:55:20 +03:00
Isaac Gaskin
fe02d884fd docs: update workflows readme (#18263)
Signed-off-by: Isaac Gaskin <isaac.gaskin@circle.com>
2024-05-17 13:54:46 +03:00
Nicholas Morey
c9c3c1de24 docs: expand appset post selector examples (#18257)
Signed-off-by: Nicholas Morey <nicholas@morey.tech>
2024-05-16 14:46:27 -06:00
dependabot[bot]
5e6ca70904 chore(deps): bump bitnami/kubectl in /test/container (#18224)
Bumps bitnami/kubectl from `5129237` to `09c66fb`.

---
updated-dependencies:
- dependency-name: bitnami/kubectl
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-16 13:52:05 +03:00
Malte Hviid-Magnussen
5e58bac61b Add proper spacing (#18244)
Signed-off-by: Malte Hviid-Magnussen <maltehviidmagnussen@gmail.com>
2024-05-16 13:51:42 +03:00
hanzala1234
2c5b9738ea Bump gitops-engine-version (#18233)
Signed-off-by: hanzala <muhammadhanzala12@gmail.com>
2024-05-15 18:40:46 +03:00
dependabot[bot]
2b89d6c222 chore(deps): bump library/node in /test/container (#18225) 2024-05-15 09:17:01 +03:00
dependabot[bot]
3862aecc06 chore(deps): bump library/node from f9b4b4b to 5a254b7 in /ui-test (#18222) 2024-05-15 09:16:38 +03:00
Arata Furukawa
36ff5cf1e1 fix: copy visited map #11699 (#12667)
This commit fixed an issue #11699 that caused a warning even if the cycle didn't exist.
Fix false cycle discovery by copying the visited resource map before recursively calling of getAppRecursive.

Fixes #11699

Signed-off-by: Arata Furukawa <old.river.new@gmail.com>
Co-authored-by: Blake Pettersson <blake.pettersson@gmail.com>
2024-05-14 15:37:20 -07:00
dependabot[bot]
346ae95587 chore(deps): bump bitnami/kubectl in /test/container (#18186)
Bumps bitnami/kubectl from `aa73edb` to `5129237`.

---
updated-dependencies:
- dependency-name: bitnami/kubectl
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-14 22:04:27 +03:00
Leonardo Luz Almeida
5ae342a6de chore: fix unit-tests (#18215)
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
2024-05-14 13:30:57 -04:00
Michael Crenshaw
2abfafd025 chore(deps): bump github/codeql-action bundle to v2.17.2 (#18150)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-05-14 08:56:59 -04:00
dependabot[bot]
f9f674953d chore(deps): bump library/node from 64c46a6 to f9b4b4b in /ui-test (#18206)
Bumps library/node from `64c46a6` to `f9b4b4b`.

---
updated-dependencies:
- dependency-name: library/node
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-14 14:55:06 +03:00
dependabot[bot]
5729c61421 chore(deps): bump library/node in /test/container (#18204)
Bumps library/node from `64c46a6` to `f9b4b4b`.

---
updated-dependencies:
- dependency-name: library/node
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-14 14:54:47 +03:00
dependabot[bot]
52e94fdd0f chore(deps): bump actions/download-artifact from 4.1.5 to 4.1.7 (#18185)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4.1.5 to 4.1.7.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](8caf195ad4...65a9edc588)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-13 21:20:49 -07:00
dependabot[bot]
2162aaf727 chore(deps): bump ossf/scorecard-action from 2.3.1 to 2.3.3 (#18183)
Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 2.3.1 to 2.3.3.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](0864cf1902...dc50aa9510)

---
updated-dependencies:
- dependency-name: ossf/scorecard-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-13 17:17:05 -07:00
Ishita Sequeira
710bb76107 update resolveRevision to use the correct source for multi-source app (#18194) 2024-05-13 23:42:14 +03:00
Andrii Korotkov
532f5a8a43 chore: Add Verkada to ArgoCD users (#18199)
Signed-off-by: Andrii Korotkov <andrii.korotkov@verkada.com>
2024-05-13 22:08:51 +02:00
Andrii Korotkov
4faad946f0 chore: Improve appcontroller logs further - Closes [#18113] (#18174)
* chore: Improve appcontroller logs further - Closes [#18113]

Add application fully qualified name as a logrus field to several places that were missing it.
Remove appNamespace field and replace application name with a fully qualified name in a few places for consistency.
Add app project to the log fields.

Signed-off-by: Andrii Korotkov <andrii.korotkov@verkada.com>

* chore: Switch to using separate field for application name and qualified name, add a common function for app log entry - Closes[#18113]

Signed-off-by: Andrii Korotkov <andrii.korotkov@verkada.com>

---------

Signed-off-by: Andrii Korotkov <andrii.korotkov@verkada.com>
2024-05-13 16:07:24 -04:00
Alexandre Gaudreault
49059113c2 feat(rbac): fine-grained update/delete for application resources (#18124)
* feat(rbac): fine-grained update/delete for application resources

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* rewrite rbac (draft)

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* add other stuff

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* spellcheck

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* update map

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* spell check

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* linter not happy about deprecated claims

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* not happy about claims at all

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* generated

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* fix list syntax

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* use same link pattern

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* rewrite permissions to policy when it applies

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* Update docs/operator-manual/rbac.md

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

---------

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>
2024-05-13 15:04:18 -04:00
onee-only
8a0757efc5 Fix logging hash with multiple sources (#18189)
Signed-off-by: onee-only <kimww0306@gmail.com>
2024-05-13 09:22:17 -04:00
github-actions[bot]
c3b89ca015 [Bot] docs: Update Snyk reports (#18171)
Signed-off-by: CI <ci@argoproj.com>
Co-authored-by: CI <ci@argoproj.com>
2024-05-11 22:12:34 -04:00
dependabot[bot]
971fc3ef12 chore(deps): bump tar from 6.1.11 to 6.2.1 in /ui (#17791)
Bumps [tar](https://github.com/isaacs/node-tar) from 6.1.11 to 6.2.1.
- [Release notes](https://github.com/isaacs/node-tar/releases)
- [Changelog](https://github.com/isaacs/node-tar/blob/main/CHANGELOG.md)
- [Commits](https://github.com/isaacs/node-tar/compare/v6.1.11...v6.2.1)

---
updated-dependencies:
- dependency-name: tar
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-11 22:03:09 -04:00
dependabot[bot]
df3bb3e753 chore(deps): bump js-yaml and @types/js-yaml in /ui (#18168)
* chore(deps): bump js-yaml and @types/js-yaml in /ui

Bumps [js-yaml](https://github.com/nodeca/js-yaml) and [@types/js-yaml](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/js-yaml). These dependencies needed to be updated together.

Updates `js-yaml` from 3.14.1 to 4.1.0
- [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodeca/js-yaml/compare/3.14.1...4.1.0)

Updates `@types/js-yaml` from 3.12.1 to 4.0.9
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/js-yaml)

---
updated-dependencies:
- dependency-name: js-yaml
  dependency-type: direct:production
  update-type: version-update:semver-major
- dependency-name: "@types/js-yaml"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* use new function names

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-05-11 21:57:02 -04:00
Ha Van
f4fd97d659 fix: BanzaiCloud KafkaCluster healthcheck to return Progressing during rolling update (#17994)
* Update ClusterRollingUpgrading state to always be in Progressing state regardless of broker status

Signed-off-by: Ha Van <musubi7726@gmail.com>

* Retrigger CI pipeline

Signed-off-by: Ha Van <musubi7726@gmail.com>

---------

Signed-off-by: Ha Van <musubi7726@gmail.com>
Co-authored-by: Dan Garfield <dan@codefresh.io>
2024-05-11 15:36:33 -04:00
Michael Crenshaw
5849a0650f chore(deps): bump actions/cache from v3.3.2 to 4.0.2 (#18146)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-05-11 15:24:12 -04:00
raweber
653fc8da1f docs: replace image to one which includes ca-certificates (#18068)
* Replace image to include ca-certificates

Signed-off-by: raweber <99535319+raweber42@users.noreply.github.com>

* Update comment

Signed-off-by: raweber <99535319+raweber42@users.noreply.github.com>

* Update docs/operator-manual/config-management-plugins.md

Co-authored-by: Dan Garfield <dan@codefresh.io>
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* Update docs/operator-manual/config-management-plugins.md

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

---------

Signed-off-by: raweber <99535319+raweber42@users.noreply.github.com>
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Co-authored-by: Dan Garfield <dan@codefresh.io>
2024-05-10 08:22:17 -06:00
Erik Frederiksen
968dc1ad53 docs: add Andgo Systems to users list (#18157)
Signed-off-by: Erik Frederiksen <rik.the.vik@gmail.com>
2024-05-09 15:12:33 -06:00
Alexander Matyushentsev
5bb3c87370 fix: Argo CD app is out of sync right after sync (#18155)
Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
2024-05-09 12:52:11 -07:00
Leonardo Luz Almeida
62d9838076 fix: handle nil ParseableType from GVKParser (#18154)
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
2024-05-09 15:03:38 -04:00
Michael Crenshaw
e0e9dcfc5a chore(deps): bump softprops/action-gh-release from v0.1.15 to 2.0.5 (#18149)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-05-09 18:01:26 +00:00
Michael Crenshaw
13c7434645 chore(deps): bump docker/setup-qeum-action from v2.2.0 to 3.0.0 (#18145)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-05-09 17:17:12 +00:00
Michael Crenshaw
408295fb4f chore(deps): bump actions/setup-go from 4.x to 5.0.1 (#18144)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-05-09 12:57:32 -04:00
Alexandre Gaudreault
a89e3589b4 fix(ui): consistent resource menu across views (#18060) (#18069)
* add icon in app table view

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* use defaut menu in tree-grouped

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* use default menu in pod views

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* fix custom delete actions

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* menu item in list

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* fix pod wrongly identified as root in network graph

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* update docs error

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* call delete pod action if kind is pod

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* add logs action to pods

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* delete in app details

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* use managed instead of root for menu items

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* lint fix

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* fix lint again

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

---------

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>
2024-05-09 09:16:50 -06:00
Blake Pettersson
ebb92d8c3b fix: add endpointslice replace (#18141)
Since #17491 I got a bunch of weird errors in Goland, along with the
error message below:

```
go: k8s.io/endpointslice@v0.0.0: invalid version: unknown revision v0.0.0
```

Adding an endpointslice alias fixes that.

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
2024-05-09 08:52:49 -04:00
dependabot[bot]
f65399af14 chore(deps): bump library/node from 22.0.0 to 22.1.0 in /test/container (#18136)
Bumps library/node from 22.0.0 to 22.1.0.

---
updated-dependencies:
- dependency-name: library/node
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: pasha-codefresh <pavel@codefresh.io>
2024-05-09 12:05:25 +03:00
dependabot[bot]
bab0ee0821 chore(deps): bump bitnami/kubectl in /test/container (#18135)
Bumps bitnami/kubectl from `b330450` to `aa73edb`.

---
updated-dependencies:
- dependency-name: bitnami/kubectl
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-09 10:49:50 +03:00
dependabot[bot]
0a408a6e30 chore(deps): bump library/busybox in /test/e2e/multiarch-container (#18134)
Bumps library/busybox from `6776a33` to `5eef5ed`.

---
updated-dependencies:
- dependency-name: library/busybox
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-09 10:49:29 +03:00
Michael Crenshaw
2605a9845b chore(ci): fix release notes (#18132)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-05-08 16:50:09 -06:00
dependabot[bot]
0ca4f74155 chore(deps): bump library/node from 22.0.0 to 22.1.0 in /ui-test (#18063)
Bumps library/node from 22.0.0 to 22.1.0.

---
updated-dependencies:
- dependency-name: library/node
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-08 21:22:24 +03:00
dependabot[bot]
247055207d chore(deps): bump bitnami/kubectl in /test/container (#18085)
Bumps bitnami/kubectl from `b909f3a` to `b330450`.

---
updated-dependencies:
- dependency-name: bitnami/kubectl
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-08 21:18:08 +03:00
Mikael Sennerholm
440fbac12b feat(health): Implement k8s.mariadb.com CRD health checks (#17995)
* Copied MariaDB from old name and change to new name
Adding Backup, SqlJobs, Grant, Database and User

Signed-off-by: Mikael Sennerholm <mikael@sennerholm.net>

* Set progressing as default

Signed-off-by: Mikael Sennerholm <mikael@sennerholm.net>

---------

Signed-off-by: Mikael Sennerholm <mikael@sennerholm.net>
Co-authored-by: pasha-codefresh <pavel@codefresh.io>
2024-05-08 19:22:05 +03:00
Togie Mcdogie
1cd6fcac4f feat(health): Added Humio Operator Healthchecks (#11628)
* Added Humio Operator Healthchecks

Signed-off-by: togie6 <22466611+togie6@users.noreply.github.com>

* Retrigger CI pipeline

Signed-off-by: togie6 <22466611+togie6@users.noreply.github.com>

* Removed duplicate if statement from HumioView

Signed-off-by: togie6 <22466611+togie6@users.noreply.github.com>

* Add HumioCluster Health Check

Signed-off-by: togie6 <22466611+togie6@users.noreply.github.com>

---------

Signed-off-by: togie6 <22466611+togie6@users.noreply.github.com>
Co-authored-by: pasha-codefresh <pavel@codefresh.io>
2024-05-08 19:21:56 +03:00
Parvesh Mourya
9bc9ff9c7a feat: implement keda health-checks (#16715)
Signed-off-by: parmou <parveshmourya96@gmail.com>
Co-authored-by: Blake Pettersson <blake.pettersson@gmail.com>
2024-05-08 15:47:14 +00:00
Mayursinh Sarvaiya
7945b26d95 chore(ui-dev): migrate tslint to eslint (#11652) (#18079)
* feat(ui): setup eslint

Signed-off-by: Mayursinh Sarvaiya <marvinduff97@gmail.com>

* chore(ui): update `lint:fix` command

Signed-off-by: Mayursinh Sarvaiya <marvinduff97@gmail.com>

* fix(ui-lint): run `yarn lint:fix`

> solve remaining manually

Signed-off-by: Mayursinh Sarvaiya <marvinduff97@gmail.com>

* chore(ui): remove tslint from `ui`

Signed-off-by: Mayursinh Sarvaiya <marvinduff97@gmail.com>

* chore(docs-ui): add docs for VSCode configuration eslint

Signed-off-by: Mayursinh Sarvaiya <marvinduff97@gmail.com>

* chore(ui): prettier set `trailingComma` to `none`

> prettier config default is changed after version bump - https://prettier.io/docs/en/options.html#trailing-commas

Signed-off-by: Mayursinh Sarvaiya <marvinduff97@gmail.com>

---------

Signed-off-by: Mayursinh Sarvaiya <marvinduff97@gmail.com>
2024-05-08 11:30:58 -04:00
sivchari
ef96dec5b2 chore: Bump Kubernetes 1.29.2 (#17491)
* run: go mod tidy

Signed-off-by: sivchari <shibuuuu5@gmail.com>

* change interface of Broadcaster

Signed-off-by: sivchari <shibuuuu5@gmail.com>

* modify some logic due to updating controller-runtime version

Signed-off-by: sivchari <shibuuuu5@gmail.com>

* modify some logic due to updating controller-runtime version

Signed-off-by: sivchari <shibuuuu5@gmail.com>

* fix args of GetInformer

Signed-off-by: sivchari <shibuuuu5@gmail.com>

* fix signature for mock

Signed-off-by: sivchari <shibuuuu5@gmail.com>

* update mock

Signed-off-by: sivchari <shibuuuu5@gmail.com>

* use ptr instead of pointer

Signed-off-by: sivchari <shibuuuu5@gmail.com>

* use recommended function instead of deprecated it in wait package

Signed-off-by: sivchari <shibuuuu5@gmail.com>

* run make codegen

Signed-off-by: sivchari <shibuuuu5@gmail.com>

* re-run codegen

Signed-off-by: sivchari <shibuuuu5@gmail.com>

* fix codegen tasks to pass the codegen

Signed-off-by: sivchari <shibuuuu5@gmail.com>

* replace pointer package with ptr package

Signed-off-by: sivchari <shibuuuu5@gmail.com>

* add option to manage subresource

Signed-off-by: sivchari <shibuuuu5@gmail.com>

* fix len args

Signed-off-by: sivchari <shibuuuu5@gmail.com>

* fix: error message for updating lib-version

Signed-off-by: sivchari <shibuuuu5@gmail.com>

* use poll

Signed-off-by: sivchari <shibuuuu5@gmail.com>

* add cache opt

Signed-off-by: sivchari <shibuuuu5@gmail.com>

* use ptr instead of pointer

Signed-off-by: sivchari <shibuuuu5@gmail.com>

* add status subresource

Signed-off-by: sivchari <shibuuuu5@gmail.com>

* use latest commit

Signed-off-by: sivchari <shibuuuu5@gmail.com>

* fix watch namespace

Signed-off-by: sivchari <shibuuuu5@gmail.com>

* use latest gitops-engine

Signed-off-by: sivchari <shibuuuu5@gmail.com>

* delete unnecessary polling

Signed-off-by: sivchari <shibuuuu5@gmail.com>

* revert changes in Makefile

Signed-off-by: sivchari <shibuuuu5@gmail.com>

* re-add openapi-gen

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* codegen w/ correct versions

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* revert

Signed-off-by: sivchari <shibuuuu5@gmail.com>

* extend timeout

Signed-off-by: sivchari <shibuuuu5@gmail.com>

* break loop even if service account does not have secrets

Signed-off-by: sivchari <shibuuuu5@gmail.com>

* fix review points

Signed-off-by: sivchari <shibuuuu5@gmail.com>

* replace gitops-engine

Signed-off-by: sivchari <shibuuuu5@gmail.com>

---------

Signed-off-by: sivchari <shibuuuu5@gmail.com>
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-05-08 11:16:18 -04:00
Daan Verstraten
2727aec4b7 docs(update): Adding an example for deeplinks in using property that contains - or / (#18119)
* Extending deeplinks documentation with examples for labels or annotations that use / or - 

Signed-off-by: Daan Verstraten <104772968+DaanQ42@users.noreply.github.com>

* Fixing double quotes

Signed-off-by: Daan Verstraten <104772968+DaanQ42@users.noreply.github.com>

* Update docs/operator-manual/deep_links.md

Signed-off-by: Dan Garfield <dan@codefresh.io>

Signed-off-by: Dan Garfield <dan@codefresh.io>

---------

Signed-off-by: Daan Verstraten <104772968+DaanQ42@users.noreply.github.com>
Signed-off-by: Dan Garfield <dan@codefresh.io>
Co-authored-by: Dan Garfield <dan@codefresh.io>
2024-05-08 14:52:05 +00:00
pgumpoldsberger
20fada8364 Update ingress.md to work wirth traefik 3.0 (#18103)
Signed-off-by: pgumpoldsberger <60177408+pgumpoldsberger@users.noreply.github.com>
2024-05-07 13:31:23 -06:00
Dan Garfield
82db16664e Docs: Clarify that we don't actually follow semver (#18111)
Signed-off-by: Dan Garfield <dan@codefresh.io>
2024-05-07 14:49:05 -04:00
Michael Crenshaw
c1787cff4a docs: document go-based health checks (#18117)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-05-07 14:47:51 -04:00
Michael Crenshaw
fe6bcc1cb9 docs: clarify local user/SSO scope RBAC ambiguity (#18059)
* docs: clarify local user/SSO scope RBAC ambiguity

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* better phrasing

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

---------

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-05-07 12:04:20 -06:00
João Estrela
05d10c870e typo on Cluster Generator doc (#18110)
Signed-off-by: João Estrela <jestrela@barracuda.com>
2024-05-07 18:51:47 +03:00
Michael Crenshaw
414be63696 chore(deps): bump Ubuntu from 22.04 to 24.04 (#17973) (#18093)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-05-07 09:35:58 -04:00
Yoshitaka Fujii
13506ad5c8 doca: Update argocd_architecture image (#18073)
Signed-off-by: ystkfujii <ystk.fujii0731@gmail.com>
2024-05-07 09:06:03 -04:00
Michael Crenshaw
b0a3433d00 docs: fix 404 styling (#18094)
* docs: fix 404 styling

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* hack around custom tag destruction

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

---------

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-05-07 09:03:34 -04:00
daftping
e5c0e09651 fix(ui): respect Application destination.name in cluster summary calculation (#18081)
Signed-off-by: daftping <21245083+daftping@users.noreply.github.com>
2024-05-07 09:02:22 -04:00
github-actions[bot]
5c175e38c5 [Bot] docs: Update Snyk reports (#18080)
Signed-off-by: CI <ci@argoproj.com>
Co-authored-by: CI <ci@argoproj.com>
2024-05-07 12:57:43 +00:00
Lawrence Aiello
37c813bd82 docs: add rogo to users.md (#18074)
* chore: add Rogo to users

Signed-off-by: aiell0 <lawrence@rogodata.com>

* sign off

Signed-off-by: aiell0 <lawrence@rogodata.com>

---------

Signed-off-by: aiell0 <lawrence@rogodata.com>
2024-05-06 23:22:48 -10:00
dependabot[bot]
8aa88b6731 chore(deps): bump jinja2 from 3.0.3 to 3.1.4 in /docs (#18091)
Bumps [jinja2](https://github.com/pallets/jinja) from 3.0.3 to 3.1.4.
- [Release notes](https://github.com/pallets/jinja/releases)
- [Changelog](https://github.com/pallets/jinja/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/jinja/compare/3.0.3...3.1.4)

---
updated-dependencies:
- dependency-name: jinja2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-06 14:36:14 -04:00
Andrew Jeffree
a2a0360cd8 feat(paths): Add support for glob patterns (#18055)
as per https://github.com/argoproj/argo-cd/issues/17825

Signed-off-by: Andrew Jeffree <andrew@jeffree.id.au>
2024-05-03 14:31:11 -04:00
Alexander Matyushentsev
ec09937fe0 fix: status.sync.comparedTo should use replace patch strategy (#18061)
* fix: status.sync.comparedTo should use replace patch strategy

Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>

* add e2e tests

Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>

---------

Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
2024-05-03 11:03:50 -04:00
David Costa
8e66b3e4f2 Update kustomize.md (#18065)
typo in docs: managment -> management

Signed-off-by: David Costa <david@zarel.net>
2024-05-03 00:02:17 -10:00
Joe Bowbeer
4c096ed2cb docs: use compliant name in Generators-List.md (#18062)
Signed-off-by: Joe Bowbeer <joe.bowbeer@gmail.com>
2024-05-02 15:56:02 -04:00
Michael Haigh
220dee0200 Adding astra.netapp.io CRD health checks (#17999) 2024-05-01 19:22:23 +03:00
Rodolfo Martínez Vega
50027733db docs: Update Getting started documentation (#17975)
This PR adds some sentences to explain the process of "Syncing via UI" screenshots to have a good understanding of the process on the UI.

Signed-off-by: Rodolfo Martínez Vega <rodomar@outlook.com>
2024-05-01 08:28:06 -06:00
Max Gautier
b738f1fec4 docs: add soft documentation for ignoreMissingValueFiles (#17996)
The Helm source has the ability to ignore missing values files since
99d1dcad0 (feat: added a new Helm option ignoreMissingValueFiles,
2022-01-03).
This is however not obvious from reading the user guide on Helm.

Document the parameters along with a reference to the use case which
motivated it.

Signed-off-by: Max Gautier <mg@max.gautier.name>
2024-05-01 08:11:41 -06:00
dependabot[bot]
3ab8e266b4 chore(deps): bump library/registry in /test/container (#18040)
Bumps library/registry from `fb9c9ae` to `4fac7a8`.

---
updated-dependencies:
- dependency-name: library/registry
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-01 10:45:01 +03:00
dependabot[bot]
ca75b60692 chore(deps): bump library/busybox in /test/e2e/multiarch-container (#18039)
Bumps library/busybox from `bb02074` to `6776a33`.

---
updated-dependencies:
- dependency-name: library/busybox
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-01 10:44:31 +03:00
Marc Arndt
a63068d06f fix: enable sha256 and sha512 for git ssh (#18028)
* fix: bumping the knownhosts to v1.2.2 since this contains a fix that allows for sha256 and sha512 algorithms when using git ssh

Signed-off-by: Marc Arndt <marc@marcarndt.com>
Signed-off-by: Marc Arndt <m.arndt@evana.de>

* chore: remove older version of module from go sum

Signed-off-by: Marc Arndt <m.arndt@evana.de>

---------

Signed-off-by: Marc Arndt <marc@marcarndt.com>
Signed-off-by: Marc Arndt <m.arndt@evana.de>
Co-authored-by: Marc Arndt <m.arndt@evana.de>
2024-04-30 09:12:52 -04:00
dependabot[bot]
1e6ca4d7af chore(deps): bump library/node from 21.7.3 to 22.0.0 in /test/container (#18022)
Bumps library/node from 21.7.3 to 22.0.0.

---
updated-dependencies:
- dependency-name: library/node
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: pasha-codefresh <pavel@codefresh.io>
2024-04-30 12:32:30 +03:00
Daniel R. Dagfinrud
ba2ea258c6 docs: update wording in diffing.md (#18027)
* docs: update wording in diffing.md

The wording in "If you have a slash / in your pointer path, you can use the ~1 character" is inaccurate. The ~1 character is mandatory if you have a slash.

Signed-off-by: Daniel R. Dagfinrud <danieldagfinrud@gmail.com>

* docs: update wording in docs/user-guide/diffing.md

Co-authored-by: Blake Pettersson <blake.pettersson@gmail.com>
Signed-off-by: Daniel R. Dagfinrud <danieldagfinrud@gmail.com>

---------

Signed-off-by: Daniel R. Dagfinrud <danieldagfinrud@gmail.com>
Co-authored-by: Blake Pettersson <blake.pettersson@gmail.com>
2024-04-29 23:27:03 -10:00
dependabot[bot]
7003d06dc4 chore(deps): bump library/busybox in /test/e2e/multiarch-container (#18023)
Bumps library/busybox from `c3839dd` to `bb02074`.

---
updated-dependencies:
- dependency-name: library/busybox
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-30 10:47:58 +03:00
dependabot[bot]
737f7428a1 chore(deps): bump library/node from 21.7.3 to 22.0.0 in /ui-test (#18024)
Bumps library/node from 21.7.3 to 22.0.0.

---
updated-dependencies:
- dependency-name: library/node
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-30 10:27:22 +03:00
Radon Rosborough
ba15569322 Document units for argocd_app_reconcile (#18018)
Signed-off-by: Radon Rosborough <rrosborough@plaid.com>
2024-04-29 20:47:50 -04:00
dependabot[bot]
c38c8a9aa3 chore(deps): bump library/ubuntu from 22.04 to 24.04 in /test/container (#17976)
Bumps library/ubuntu from 22.04 to 24.04.

---
updated-dependencies:
- dependency-name: library/ubuntu
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-29 22:43:30 +03:00
Alex Ellis
2a05ae02ab Add health status for OpenFaaS functions (#18015)
Adds test-case for Progressing, Degraded, Healthy and
Suspended, to avoid users having to update their Argo ConfigMaps
by hand.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2024-04-29 14:19:12 -04:00
dependabot[bot]
17cca81c09 chore(deps): bump bitnami/kubectl from 1.27 to 1.30 in /test/container (#18012)
Bumps bitnami/kubectl from 1.27 to 1.30.

---
updated-dependencies:
- dependency-name: bitnami/kubectl
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-29 15:14:58 +03:00
github-actions[bot]
7581c20e92 [Bot] docs: Update Snyk reports (#18008)
Signed-off-by: CI <ci@argoproj.com>
Co-authored-by: CI <ci@argoproj.com>
Co-authored-by: pasha-codefresh <pavel@codefresh.io>
2024-04-29 11:26:54 +03:00
Ishita Sequeira
c204f247d3 feat(cli): add support for multiple sources to sync command (#17808)
* update sync command

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>

* use arrays instead of map to display ApplicationManifetQuery fields in swagger

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>

* rebase and update logic for sync command

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>

* update conditions

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>

* update displayRevisions on OperationState

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>

* remove rerunreport file

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>

* fix index 0 out of bounds error

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>

* Address comments

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>

* fix codegen

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>

* rename GetSourcePtrBySourceIndex to GetSourcePtrByIndex

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>

* rename GetSourcePtrBySourcePosition to GetSourcePtrByPosition

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>

* rebase with master and resolve conflicts

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>

* fix codegen

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>

* Address feedback and add tests

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>

* fix unit test

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>

---------

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>
2024-04-29 11:23:49 +03:00
Takumi Sue
e6200cae12 fix(appset): add debug logs around deleting ownerReferences and add warning docs about policy behavior (#18006)
* chore(appset): add logs for debug

Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com>

* fix(appset): remove finalizer regardless with deleteAllowed

Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com>

* docs: update about appset policy

Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com>

* fix: wrong log message

Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com>

* fix: log messages

Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com>

* fix: log message

Co-authored-by: Ishita Sequeira <46771830+ishitasequeira@users.noreply.github.com>
Signed-off-by: Takumi Sue <23391543+mikutas@users.noreply.github.com>

* docs: add explanation

Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com>

---------

Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com>
Signed-off-by: Takumi Sue <23391543+mikutas@users.noreply.github.com>
Co-authored-by: Ishita Sequeira <46771830+ishitasequeira@users.noreply.github.com>
2024-04-28 19:26:12 -04:00
Lukas Aldershaab
5baba93721 chore: update notifications-engine to f4856710 (#17971)
* update notifications-engine

Signed-off-by: Lukas Peter Aldershaab <lukas.aldershaab@lego.com>

* Fix build of conflicting git-urls libraries

Signed-off-by: Lukas Peter Aldershaab <lukas.aldershaab@lego.com>

* align telegrom dependency with notifications-engine

Signed-off-by: Lukas Peter Aldershaab <lukas.aldershaab@lego.com>

* fix: codegen

Signed-off-by: pashakostohrys <pavel@codefresh.io>

---------

Signed-off-by: Lukas Peter Aldershaab <lukas.aldershaab@lego.com>
Signed-off-by: pashakostohrys <pavel@codefresh.io>
Co-authored-by: pashakostohrys <pavel@codefresh.io>
2024-04-28 09:20:16 +00:00
Joe Bowbeer
575575a78a Fix post-delete finalizer in appset (#18003)
Signed-off-by: Joe Bowbeer <joe.bowbeer@gmail.com>
2024-04-26 16:41:32 -07:00
pasha-codefresh
96e796edff chore: fix codegen after security fix (#17982) 2024-04-26 07:44:39 -04:00
pasha-codefresh
57431b2177 Merge pull request from GHSA-9m6p-x4h2-6frq
* feat: limit jq.Run with timeout

Signed-off-by: pashakostohrys <pavel@codefresh.io>

* feat: ignore normalizer jq execution timeout as env variable

Signed-off-by: pashakostohrys <pavel@codefresh.io>

* feat: customize error message and add doc section

Signed-off-by: pashakostohrys <pavel@codefresh.io>

* feat: improve log and change a way how to get variable

Signed-off-by: pashakostohrys <pavel@codefresh.io>

* chore: fix import`s order

Signed-off-by: pashakostohrys <pavel@codefresh.io>

* chore: rename variable inside sts

Signed-off-by: pashakostohrys <pavel@codefresh.io>

* chore: fix import order

Signed-off-by: pashakostohrys <pavel@codefresh.io>

---------

Signed-off-by: pashakostohrys <pavel@codefresh.io>
2024-04-26 12:24:32 +03:00
pasha-codefresh
e23060540f Merge pull request from GHSA-9m6p-x4h2-6frq
* feat: limit jq.Run with timeout

Signed-off-by: pashakostohrys <pavel@codefresh.io>

* feat: ignore normalizer jq execution timeout as env variable

Signed-off-by: pashakostohrys <pavel@codefresh.io>

* feat: customize error message and add doc section

Signed-off-by: pashakostohrys <pavel@codefresh.io>

* feat: improve log and change a way how to get variable

Signed-off-by: pashakostohrys <pavel@codefresh.io>

* chore: fix import`s order

Signed-off-by: pashakostohrys <pavel@codefresh.io>

* chore: rename variable inside sts

Signed-off-by: pashakostohrys <pavel@codefresh.io>

* chore: fix import order

Signed-off-by: pashakostohrys <pavel@codefresh.io>

---------

Signed-off-by: pashakostohrys <pavel@codefresh.io>
2024-04-26 12:24:02 +03:00
yyzxw
334d5c5607 chore:change file name for readthedocs compatibility (#17978)
Signed-off-by: xiaowu.zhu <xiaowu.zhu@daocloud.io>
2024-04-26 12:20:39 +03:00
Cyril Houdellier
badac51530 feat: Add width change and full revision display for badge (#17502)
Signed-off-by: Cyril Houdellier <cyril.houdellier@amadeus.com>
2024-04-26 10:28:06 +05:30
Doug Goldstein
0f11dfb596 docs: document helm fileParameters / helm-set-file (#17822)
Added documentation for fileParameters in a helm source Application or
the --helm-set-file cli option from #2751. Added a note about #13220 so
users are aware. #17941 aims to remove this limitation so the warning
will be adjusted to mention the version that lands that support.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
2024-04-25 11:12:21 -04:00
dependabot[bot]
6d3abb36c2 chore(deps): bump library/node in /test/container (#17959)
Bumps library/node from `c384290` to `bda5312`.

---
updated-dependencies:
- dependency-name: library/node
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-25 00:11:51 -04:00
dependabot[bot]
b19a0d0f76 chore(deps): bump library/node in /test/container (#17946)
Bumps library/node from `162d92c` to `c384290`.

---
updated-dependencies:
- dependency-name: library/node
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-24 21:54:36 -04:00
g1franc
2dbe5c17d1 Update sync-kubectl.md - Correct indentation for a sample (#17953)
Correct indentation for a sample as "hook" element is supposed to be a child of syncStrategy

Signed-off-by: g1franc <guillaume.francois55@gmail.com>
2024-04-24 06:09:38 -07:00
Bulat Saifullin
fcdaee9857 fix: jwtTokens are reset when creating new tokens for new role (#17298)
* fix: jwtTokens are reset when creating new tokens for new role

Signed-off-by: Bulat Saifullin <bulat@saifullin.ru>

* add back NormalizeJWTTokens

Signed-off-by: Bulat Saifullin <bulat@saifullin.ru>

* add tests

Signed-off-by: BulatSaif <bulat@parity.io>

* add fix

Signed-off-by: BulatSaif <bulat@parity.io>

---------

Signed-off-by: Bulat Saifullin <bulat@saifullin.ru>
Signed-off-by: BulatSaif <bulat@parity.io>
Co-authored-by: Soumya Ghosh Dastidar <44349253+gdsoumya@users.noreply.github.com>
2024-04-24 17:16:09 +05:30
rumstead
1eec8eb777 fix: use cmp vs reflect.DeepEqual for comparing Applications (#17861) (#17940)
* fix(compare): appset compare the child apps with cmp vs reflect

Signed-off-by: rumstead <37445536+rumstead@users.noreply.github.com>

* remove debug lines

Signed-off-by: rumstead <37445536+rumstead@users.noreply.github.com>

* remove debug lines

Signed-off-by: rumstead <37445536+rumstead@users.noreply.github.com>

---------

Signed-off-by: rumstead <37445536+rumstead@users.noreply.github.com>
2024-04-23 20:50:11 +00:00
Keith Chong
719dc83497 fix: Add Sources tab to show all sources of a multi-source app (#17939)
Signed-off-by: Keith Chong <kykchong@redhat.com>
2024-04-23 16:34:01 -04:00
Jakub Ciolek
56b796dc1c docs: Add AlphaSense to USERS.md (#17942)
Mention AlphaSense as a user.

Signed-off-by: Jakub Ciolek <jakub@ciolek.dev>
2024-04-23 15:54:17 -04:00
ChristianCiach
634645f32c docs: Mention configmap to enable new git file globbing by name (#17936)
Signed-off-by: Christian Ciach <christian.ciach@gmail.com>
2024-04-23 09:39:57 -04:00
dependabot[bot]
4f40c3e3e2 chore(deps): bump jlumbroso/free-disk-space (#17932)
Bumps [jlumbroso/free-disk-space](https://github.com/jlumbroso/free-disk-space) from 4d9e71b726748f254fe64fa44d273194bd18ec91 to 54081f138730dfa15788a46383842cd2f914a1be.
- [Release notes](https://github.com/jlumbroso/free-disk-space/releases)
- [Commits](4d9e71b726...54081f1387)

---
updated-dependencies:
- dependency-name: jlumbroso/free-disk-space
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-23 09:38:44 -04:00
dependabot[bot]
dec655c712 chore(deps): bump peter-evans/create-pull-request from 5.0.2 to 6.0.4 (#17931)
Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 5.0.2 to 6.0.4.
- [Release notes](https://github.com/peter-evans/create-pull-request/releases)
- [Commits](153407881e...9153d834b6)

---
updated-dependencies:
- dependency-name: peter-evans/create-pull-request
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-23 09:38:02 -04:00
dependabot[bot]
589da837d6 chore(deps): bump thehanimo/pr-title-checker from 1.4.0 to 1.4.2 (#17933)
Bumps [thehanimo/pr-title-checker](https://github.com/thehanimo/pr-title-checker) from 1.4.0 to 1.4.2.
- [Release notes](https://github.com/thehanimo/pr-title-checker/releases)
- [Commits](0cf5902181...1d8cd483a2)

---
updated-dependencies:
- dependency-name: thehanimo/pr-title-checker
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-23 09:35:45 -04:00
dependabot[bot]
56a0da8575 chore(deps): bump slsa-framework/slsa-github-generator (#17934)
Bumps [slsa-framework/slsa-github-generator](https://github.com/slsa-framework/slsa-github-generator) from 1.10.0 to 2.0.0.
- [Release notes](https://github.com/slsa-framework/slsa-github-generator/releases)
- [Changelog](https://github.com/slsa-framework/slsa-github-generator/blob/main/CHANGELOG.md)
- [Commits](https://github.com/slsa-framework/slsa-github-generator/compare/v1.10.0...v2.0.0)

---
updated-dependencies:
- dependency-name: slsa-framework/slsa-github-generator
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-23 09:35:16 -04:00
Alexy Mantha
77c27c3c10 feat(appset): implement ResourceTree for ApplicationSets (#15741)
* update types

Signed-off-by: Alexy Mantha <alexy@mantha.dev>

* Update generated code

Signed-off-by: Alexy Mantha <alexy@mantha.dev>

* wip

Signed-off-by: Alexy Mantha <alexy@mantha.dev>

* add resource tree

Signed-off-by: Alexy Mantha <alexy@mantha.dev>

* Update generated code

Signed-off-by: Alexy Mantha <alexy@mantha.dev>

* fix

Signed-off-by: Alexy Mantha <alexy@mantha.dev>

* cleanup

Signed-off-by: Alexy Mantha <alexy@mantha.dev>

* format

Signed-off-by: Alexy Mantha <alexy@mantha.dev>

* fix lint

Signed-off-by: Alexy Mantha <alexy@mantha.dev>

* Update generated code

Signed-off-by: Alexy Mantha <alexy@mantha.dev>

* fmt

Signed-off-by: Alexy Mantha <alexy@mantha.dev>

* add tests

Signed-off-by: Alexy Mantha <alexy@mantha.dev>

* cleanup

Signed-off-by: Alexy Mantha <alexy@mantha.dev>

* fmt

Signed-off-by: Alexy Mantha <alexy@mantha.dev>

* fix conflicts

Signed-off-by: Alexy Mantha <alexy@mantha.dev>

* codegen

Signed-off-by: Alexy Mantha <alexy@mantha.dev>

* regen

Signed-off-by: Alexy Mantha <alexy@mantha.dev>

* fix codegen

Signed-off-by: Alexy Mantha <alexy@mantha.dev>

---------

Signed-off-by: Alexy Mantha <alexy@mantha.dev>
2024-04-23 09:32:26 -04:00
Nolan Emirot
67e6c6cf94 docs: fix typp (#17927)
Signed-off-by: emirot <nolan.emirot@workday.com>
Co-authored-by: emirot <nolan.emirot@workday.com>
2024-04-22 21:57:50 +02:00
dependabot[bot]
50cec22d10 chore(deps): bump actions/upload-artifact from 4.3.2 to 4.3.3 (#17926)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.3.2 to 4.3.3.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](1746f4ab65...65462800fd)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-22 17:40:09 +00:00
Michael Crenshaw
f3f55ddd87 chore(deps): bump actions/*-artifact (#17923)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-04-22 12:32:28 -04:00
Michael Crenshaw
85e04f5bd4 docs(cli): remove docs for non-existing argocd admin commands (#17924) 2024-04-22 15:44:42 +00:00
github-actions[bot]
3e4d12c6c2 [Bot] docs: Update Snyk reports (#17912)
Signed-off-by: CI <ci@argoproj.com>
Co-authored-by: CI <ci@argoproj.com>
2024-04-22 14:32:44 +00:00
dependabot[bot]
cb32a140e0 chore(deps): bump golang.org/x/net from 0.21.0 to 0.23.0 (#17901)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.21.0 to 0.23.0.
- [Commits](https://github.com/golang/net/compare/v0.21.0...v0.23.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-19 14:32:59 -04:00
Michael Crenshaw
ba2e6acb01 chore: bump go version to 1.22.1 (#17895)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Co-authored-by: pasha-codefresh <pavel@codefresh.io>
2024-04-19 11:57:48 +00:00
Ishita Sequeira
4f6a8dce80 remove mention of beta state from apps-in-any-namespace doc (#17896)
Signed-off-by: ishitasequeira <ishiseq29@gmail.com>
2024-04-19 10:52:07 +03:00
Michael Crenshaw
33f5714c83 chore: upgrade controller-gen from 0.4.1 to 0.14.0 (#17893)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-04-18 18:31:14 -04:00
Reed Palmer
3a46e8c1c7 Update USERS.md (#17891)
Signed-off-by: Reed Palmer <81371878+Palmer-Reed-bah@users.noreply.github.com>
2024-04-18 23:08:36 +03:00
dependabot[bot]
73d341a5a9 chore(deps): bump library/ubuntu in /test/container (#17879)
Bumps library/ubuntu from `77906da` to `1b8d8ff`.

---
updated-dependencies:
- dependency-name: library/ubuntu
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: pasha-codefresh <pavel@codefresh.io>
2024-04-18 21:52:45 +03:00
Alexander Matyushentsev
b8b4b51545 fix: UI Error caused by missing RBAC Permission (#10955)
Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
Co-authored-by: pasha-codefresh <pavel@codefresh.io>
2024-04-18 11:55:03 -04:00
Michael Crenshaw
1e35e685b2 chore: improve codegen error output (#17873)
* chore: improve codegen error output

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* remove accidental file

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

---------

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Co-authored-by: pasha-codefresh <pavel@codefresh.io>
2024-04-18 15:14:18 +00:00
dependabot[bot]
1f8acf4a30 chore(deps): bump code.gitea.io/sdk/gitea from 0.15.1 to 0.18.0 (#17880)
Bumps code.gitea.io/sdk/gitea from 0.15.1 to 0.18.0.

---
updated-dependencies:
- dependency-name: code.gitea.io/sdk/gitea
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-18 10:30:08 -04:00
Michał Małyska
1cffa15f0d add argocd-secret-replacer (#10494)
Adding new tool that can replace secret from sops. 
It replaces specific string with encrypted values also It provides ability to encode values to base64.
It is different from ksops in a way that it is not dependent on kustomize to generate secrets.

Signed-off-by: Michał Małyska <999598+mmalyska@users.noreply.github.com>
2024-04-18 11:50:15 +03:00
Ragnar Paide
ee020273c0 Update USERS.md (#17881)
Add Pipedrive.

Signed-off-by: Ragnar Paide <16119863+ragnarpa@users.noreply.github.com>
2024-04-18 10:47:30 +03:00
Michael Crenshaw
852f744265 fix(api): respect all allowed audiences, regardless of check order (#17876)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-04-17 20:42:58 -04:00
Alexander Matyushentsev
f91179f07e fix: invalid revision in re-used manifest cache (#17874)
Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
2024-04-17 22:00:38 +00:00
Josh Wolf
b867c9ea66 fix: remove deprecated default cipher for golang >=1.22 (#17569)
* remove deprecated default cipher

Signed-off-by: Josh Wolf <josh@wolfs.io>

* regenerate CLI docs

Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>

---------

Signed-off-by: Josh Wolf <josh@wolfs.io>
Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
Co-authored-by: Jann Fischer <jann@mistrust.net>
Co-authored-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
2024-04-17 19:38:03 +00:00
Kota Kimura
db615ed1c5 chore: update gitops engine for force sync option (#5882) (#17866)
* chore: update gitops engine version

Signed-off-by: kkk777-7 <kota.kimura0725@gmail.com>

* add: e2e and docs for force sync options

Signed-off-by: kkk777-7 <kota.kimura0725@gmail.com>

* docs: Add warning description of force sync options

Signed-off-by: kkk777-7 <kota.kimura0725@gmail.com>

---------

Signed-off-by: kkk777-7 <kota.kimura0725@gmail.com>
Co-authored-by: pasha-codefresh <pavel@codefresh.io>
2024-04-17 16:31:12 +00:00
Daco
1c6b6eb837 docs: fix metrics labels name in notification monitoring (#17869)
Signed-off-by: philippe.dacosta <philippe.dacosta@adevinta.com>
Co-authored-by: philippe.dacosta <philippe.dacosta@adevinta.com>
Co-authored-by: pasha-codefresh <pavel@codefresh.io>
2024-04-17 17:39:14 +03:00
Matt Hughes
2031a07a51 fix: Pass logger to differ in diff command (#17871)
So that log messages are propagated up, this caused issues for me when
trying to diagnose an issue linked to issue #17811. I've just copied the
approach used e.g. in `controller/appcontroller.go` when calling
`argodiff.NewDiffConfigBuilder`.

Sample output before this change:

    $ argocd --loglevel debug --server argocd-system.dev.aws.uw.systems app diff dev-enablement/dev-enablement

    ===== apps/Deployment dev-enablement/go-docs ======
    272c272
    <             cpu: "0"
    ---
    >             cpu: 0m
    275c275
    <             cpu: "0"
    ---
    >             cpu: 0m

Output with this change:

    $ argocd --loglevel debug --server argocd-system.dev.aws.uw.systems app diff dev-enablement/dev-enablement
    INFO[0000] Could not unmarshal to object of type apps/v1, Kind=Deployment: json: unknown field "restartPolicy"
    INFO[0000] Could not unmarshal to object of type apps/v1, Kind=Deployment: json: unknown field "restartPolicy"

    ===== apps/Deployment dev-enablement/go-docs ======
    272c272
    <             cpu: "0"
    ---
    >             cpu: 0m
    275c275
    <             cpu: "0"
    ---
    >             cpu: 0m
    INFO[0000] Could not create new object of type argoproj.io/v1alpha1, Kind=Application: no kind "Application" is registered for version "argoproj.io/v1alpha1" in scheme "pkg/runtime/scheme.go:100"
    INFO[0000] Could not create new object of type argoproj.io/v1alpha1, Kind=Application: no kind "Application" is registered for version "argoproj.io/v1alpha1" in scheme "pkg/runtime/scheme.go:100"
    INFO[0000] Could not create new object of type traefik.containo.us/v1alpha1, Kind=IngressRoute: no kind "IngressRoute" is registered for version "traefik.containo.us/v1alpha1" in scheme "pkg/runtime/scheme.go:100"
    INFO[0000] Could not create new object of type traefik.containo.us/v1alpha1, Kind=IngressRoute: no kind "IngressRoute" is registered for version "traefik.containo.us/v1alpha1" in scheme "pkg/runtime/scheme.go:100"
    INFO[0000] Could not create new object of type traefik.containo.us/v1alpha1, Kind=IngressRoute: no kind "IngressRoute" is registered for version "traefik.containo.us/v1alpha1" in scheme "pkg/runtime/scheme.go:100"
    INFO[0000] Could not create new object of type traefik.containo.us/v1alpha1, Kind=IngressRoute: no kind "IngressRoute" is registered for version "traefik.containo.us/v1alpha1" in scheme "pkg/runtime/scheme.go:100"

Signed-off-by: Matt Hughes <mhughes@uw.co.uk>
2024-04-17 17:24:56 +03:00
isihu
60f3332568 document possibility to specify request timeout in plugin generator (#17872)
Signed-off-by: isihu <62214125+isihu@users.noreply.github.com>
2024-04-17 17:22:14 +03:00
dependabot[bot]
74805d55f6 chore(deps): bump library/golang in /test/container (#17865)
Bumps library/golang from `7d0dcbe` to `81811f8`.

---
updated-dependencies:
- dependency-name: library/golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-17 09:16:50 +03:00
Keith Chong
f819870313 feat: Add Sources tab to show all sources of a multi-source app (#17274) (#17275)
* feat: Add Sources tab to show all sources of a multi-source app (#17274)

Signed-off-by: Keith Chong <kykchong@redhat.com>

* Update ui/src/app/applications/components/resource-details/resource-details.tsx

Co-authored-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>
Signed-off-by: Keith Chong <kykchong@redhat.com>

* Remove getAppSources

Signed-off-by: Keith Chong <kykchong@redhat.com>

* Add address Ishita's comments. Add missing Ref field

Signed-off-by: Keith Chong <kykchong@redhat.com>

* Use single quotes

Signed-off-by: Keith Chong <kykchong@redhat.com>

---------

Signed-off-by: Keith Chong <kykchong@redhat.com>
Co-authored-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>
2024-04-16 17:40:01 -04:00
pasha-codefresh
a1472aed6b chore: add Octopus Deploy to USERS.md (#17858)
Signed-off-by: pashakostohrys <pavel@codefresh.io>
2024-04-16 17:34:16 -04:00
pasha-codefresh
48b636e32b chore: native client mock should be generated with go gen (#17864)
* fix: native client mock should be generated with go gen

Signed-off-by: pashakostohrys <pavel@codefresh.io>

* fix: native client mock should be generated with go gen

Signed-off-by: pashakostohrys <pavel@codefresh.io>

* fix: native client mock should be generated with go gen

Signed-off-by: pashakostohrys <pavel@codefresh.io>

* adopt repository_test.go to new helm mock client

Signed-off-by: pashakostohrys <pavel@codefresh.io>

---------

Signed-off-by: pashakostohrys <pavel@codefresh.io>
2024-04-16 17:33:47 -04:00
Adrian Berger
e12fae8a5a fix: Excessive HTTP requests when navigating in list view (#17757)
Signed-off-by: Adrian Berger <adria.berger94@gmail.com>
Co-authored-by: pasha-codefresh <pavel@codefresh.io>
2024-04-16 13:35:14 +03:00
Tais P. Hansen
4d527f8705 chore: upgrade redis to 7.0.15 (#17665)
Upgrade to latest stable 7.0.x version to fix CVEs:

CVE-2023-41056

Signed-off-by: Tais P. Hansen <taishansen@gmail.com>
Co-authored-by: Ishita Sequeira <46771830+ishitasequeira@users.noreply.github.com>
2024-04-16 11:39:59 +03:00
dependabot[bot]
27b592e2a3 chore(deps): bump library/golang from 7d0dcbe to ff6cfbd (#17794)
Bumps library/golang from `7d0dcbe` to `ff6cfbd`.

---
updated-dependencies:
- dependency-name: library/golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-16 10:37:43 +03:00
dependabot[bot]
a8b3663087 chore(deps): bump library/node from 21.7.1 to 21.7.3 in /ui-test (#17815)
Bumps library/node from 21.7.1 to 21.7.3.

---
updated-dependencies:
- dependency-name: library/node
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-16 10:34:37 +03:00
dependabot[bot]
6263604dcd chore(deps): bump library/node from 21.7.1 to 21.7.3 in /test/container (#17816)
Bumps library/node from 21.7.1 to 21.7.3.

---
updated-dependencies:
- dependency-name: library/node
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-16 10:32:53 +03:00
Soumya Ghosh Dastidar
957170edc8 fix: run codegen check in ci for docs (#17853) 2024-04-15 20:37:15 +00:00
Jann Fischer
c740412639 chore: Add rerunreport.txt to .gitignore (#17848)
Signed-off-by: jannfis <jann@mistrust.net>
2024-04-15 16:07:42 +00:00
github-actions[bot]
831bfc355c [Bot] docs: Update Snyk reports (#17829)
Signed-off-by: CI <ci@argoproj.com>
Co-authored-by: CI <ci@argoproj.com>
Co-authored-by: pasha-codefresh <pavel@codefresh.io>
2024-04-15 17:56:37 +03:00
pullmerge
cbbb99d348 Fix some comments (#17830)
Signed-off-by: pullmerge <watchmessi@outlook.com>
Co-authored-by: pasha-codefresh <pavel@codefresh.io>
2024-04-15 17:19:01 +03:00
pasha-codefresh
44894e9e43 fix: docker build fails due to 'http://deb.debian.org/debian buster-backports Release' does not have a Release file. (#17836)
* fix: docker build fails due to "The repository 'http://deb.debian.org/debian buster-backports Release' does not have a Release file."

Signed-off-by: pashakostohrys <pavel@codefresh.io>

* fix: linter issue

Signed-off-by: pashakostohrys <pavel@codefresh.io>

* fix codegen issue

Signed-off-by: pashakostohrys <pavel@codefresh.io>

* fix e2e tests

Signed-off-by: pashakostohrys <pavel@codefresh.io>

* fix linter

Signed-off-by: pashakostohrys <pavel@codefresh.io>

---------

Signed-off-by: pashakostohrys <pavel@codefresh.io>
2024-04-15 08:50:06 -04:00
pasha-codefresh
6646c6b102 Merge pull request from GHSA-2gvw-w6fj-7m3c
* chore: Update USERS.md (#17683)

Add Shield.com as one of the users in the USER.md file

Signed-off-by: suhas-chikkanna <162577490+suhas-chikkanna@users.noreply.github.com>

sec: validate project before execute action

Signed-off-by: pashakostohrys <pavel@codefresh.io>

* sec: validate a project before execute an action

Signed-off-by: pashakostohrys <pavel@codefresh.io>

---------

Signed-off-by: pashakostohrys <pavel@codefresh.io>
Co-authored-by: suhas-chikkanna <162577490+suhas-chikkanna@users.noreply.github.com>
2024-04-15 10:20:07 +03:00
Juho Syrjänen
659f426b72 docs: Add Metacore Games to USERS.md (#17827)
This PR adds Metacore Games to USERS.md. Metacore Games uses ArgoCD as part of our Kubernetes Platform and IDP.

Signed-off-by: Juho Syrjänen <juho.syrjanen@metacoregames.com>
2024-04-13 09:25:53 +02:00
Ishita Sequeira
922abefc81 fix(api): use arrays instead of map to display ApplicationManifetQuery fields in swagger (#17804)
* use arrays instead of map to display ApplicationManifetQuery fields in swagger

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>

* fix equality conditions for souce-position check

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>

---------

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>
2024-04-12 16:07:31 -04:00
Jonathan West
5ac8d05201 fix: prevent leak of files to /dev/shm in corner cases (#17658) (#17659)
Signed-off-by: Jonathan West <jonwest@redhat.com>
2024-04-11 11:47:38 +00:00
Anton Hörnquist
0cf6fdb9ee docs: Add IFS to USERS.md (#17806)
Signed-off-by: Anton Hörnquist <anton.hornquist@gmail.com>
2024-04-11 09:37:46 +02:00
rumstead
4e433c6d86 fix(snyk): use version sort (#17798)
Signed-off-by: rumstead <37445536+rumstead@users.noreply.github.com>
2024-04-10 15:39:14 +00:00
Bryce Lowe
c2dfab5560 fix: update rbac validation to support applications in different namespaces (#17777)
* fix: policies in namespaces

The introduction of applications in any namespace doesn't appear to include support for specifying namespaces in rbac policy objects.  This causes valid rbac objects (like `some-project/some-namespace/some-application`) to fail when they are really valid.  Update the regex to include the ability to specify a namespace.

Signed-off-by: Bryce Lowe <blowe@patreon.com>

* fix: update verbiage of failing test

Signed-off-by: Bryce Lowe <blowe@patreon.com>

* feedback: test for policy and project

Signed-off-by: Bryce Lowe <blowe@patreon.com>

* fix: update test name

Signed-off-by: Bryce Lowe <blowe@patreon.com>

---------

Signed-off-by: Bryce Lowe <blowe@patreon.com>
2024-04-09 21:52:54 -04:00
Blake Pettersson
ebe4804974 chore: bump protobuf (#17788)
Similar to #17419, with the difference that this builds.

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
2024-04-09 18:09:15 -04:00
Keith Chong
4abc992928 docs: Proposal to support multi-source apps in the UI (#17106) (#17108)
* docs: Proposal to support multi-source apps in the UI (#17106)

Signed-off-by: Keith Chong <kykchong@redhat.com>

* Update docs/proposals/multiple-sources-for-applications-ui.md

Co-authored-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Keith Chong <kykchong@redhat.com>

* Update docs/proposals/multiple-sources-for-applications-ui.md

Co-authored-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Keith Chong <kykchong@redhat.com>

* Update docs/proposals/multiple-sources-for-applications-ui.md

Co-authored-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Keith Chong <kykchong@redhat.com>

* Update docs/proposals/multiple-sources-for-applications-ui.md

Co-authored-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Keith Chong <kykchong@redhat.com>

* Update docs/proposals/multiple-sources-for-applications-ui.md

Co-authored-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Keith Chong <kykchong@redhat.com>

* Update docs/proposals/multiple-sources-for-applications-ui.md

Co-authored-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Keith Chong <kykchong@redhat.com>

* Update docs/proposals/multiple-sources-for-applications-ui.md

Co-authored-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Keith Chong <kykchong@redhat.com>

* Minor edits

Signed-off-by: Keith Chong <kykchong@redhat.com>

---------

Signed-off-by: Keith Chong <kykchong@redhat.com>
Co-authored-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2024-04-08 09:57:48 -04:00
Serg Shalavin
1d13dc2ea2 docs: Add CloudGeometry to USERS.md (#17774)
Signed-off-by: Serg Shalavin <sshalavin@cloudgeometry.io>
2024-04-08 07:27:39 -04:00
Alexy Mantha
a539f95597 chore: cleanup follow up for enforce manifest generate path (#15636) (#17761)
* cleanup

Signed-off-by: Alexy Mantha <alexy@mantha.dev>

* update docs

Signed-off-by: Alexy Mantha <alexy@mantha.dev>

---------

Signed-off-by: Alexy Mantha <alexy@mantha.dev>
2024-04-07 13:26:33 -04:00
pasha-codefresh
cbafc13bdd feat: support grpc message size as env (#17728) 2024-04-06 04:19:05 +03:00
Young-Zen
496ac5e294 fix(cli): ARGOCD_OPTS supports --header and other parameters (#17553)
Signed-off-by: yanghaojia <2453883990@qq.com>
2024-04-05 09:37:16 -07:00
Ishita Sequeira
35deccb486 chore: rename source-indexes to source-positions (#17746)
* chore: rename source-indexes to source-positions

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>

* update documentation

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>

---------

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>
2024-04-05 09:36:43 -04:00
1256 changed files with 104175 additions and 51298 deletions

View File

@@ -8,6 +8,7 @@ ignore:
- "pkg/client/.*"
- "vendor/.*"
- "test/.*"
- "**/mocks/*"
coverage:
status:
# we've found this not to be useful

13
.gitattributes vendored Normal file
View File

@@ -0,0 +1,13 @@
**/*.pb.go linguist-generated=true
**/mocks/*.go linguist-generated=true
assets/swagger.json linguist-generated=true
docs/operator-manual/resource_actions_builtin.md linguist-generated=true
docs/operator-manual/server-commands/argocd-*.md linguist-generated=true
docs/user-guide/commands/argocd_*.md linguist-generated=true
manifests/core-install.yaml linguist-generated=true
manifests/crds/*-crd.yaml linguist-generated=true
manifests/ha/install.yaml linguist-generated=true
manifests/ha/namespace-install.yaml linguist-generated=true
manifests/install.yaml linguist-generated=true
manifests/namespace-install.yaml linguist-generated=true
pkg/apis/api-rules/violation_exceptions.list linguist-generated=true

43
.github/ISSUE_TEMPLATE/new_dev_tool.md vendored Normal file
View File

@@ -0,0 +1,43 @@
---
name: New Dev Tool Request
about: This is a request for adding a new tool for setting up a dev environment.
title: ''
labels: ''
assignees: ''
---
Checklist:
* [ ] I am willing to maintain this tool, or have another Argo CD maintainer who is.
* [ ] I have another Argo CD maintainer who is willing to help maintain this tool (there needs to be at least two maintainers willing to maintain this tool)
* [ ] I have a lead sponsor who is a core Argo CD maintainer
* [ ] There is a PR which adds said tool - this is so that the maintainers can assess the impact of having this in the tree
* [ ] I have given a motivation why this should be added
### The proposer
<-- The username(s) of the person(s) proposing the tool -->
### The proposed tool
<!-- The tool itself, with a link to the tools website -->
### Motivation
<!-- Why this tool would be useful to have in the tree. -->
### Link to PR (Optional)
<!-- A PR adding the tool to the tree -->
### Lead Sponsor(s)
Final approval requires sponsorship from at least one core maintainer.
- @<sponsor-1>
### Co-sponsors
These will be the co-maintainers of the specified tool.
- @<sponsor-1>

View File

@@ -4,8 +4,13 @@ updates:
directory: "/"
schedule:
interval: "daily"
open-pull-requests-limit: 20
ignore:
- dependency-name: k8s.io/*
groups:
otel:
patterns:
- "^go.opentelemetry.io/.*"
- package-ecosystem: "github-actions"
directory: "/"
@@ -17,6 +22,11 @@ updates:
schedule:
interval: "daily"
- package-ecosystem: "npm"
directory: "/ui-test/"
schedule:
interval: "daily"
- package-ecosystem: "docker"
directory: "/"
schedule:

View File

@@ -6,9 +6,10 @@
| codeql.yaml | CodeQL analysis |
| image-reuse.yaml | Build, push, and Sign container images |
| image.yaml | Build container image for PR's & publish for push events |
| pr-title-check.yaml| Lint PR for semantic information |
| init-release.yaml | Build manifests and version then create a PR for release branch|
| pr-title-check.yaml| Lint PR for semantic information |
| release.yaml | Build images, cli-binaries, provenances, and post actions |
| scorecard.yaml | Generate scorecard for supply-chain security |
| update-snyk.yaml | Scheduled snyk reports |
# Reusable workflows

View File

@@ -13,7 +13,7 @@ on:
env:
# Golang version to use across CI steps
GOLANG_VERSION: '1.21'
GOLANG_VERSION: '1.22'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
@@ -28,9 +28,10 @@ jobs:
outputs:
backend: ${{ steps.filter.outputs.backend_any_changed }}
frontend: ${{ steps.filter.outputs.frontend_any_changed }}
docs: ${{ steps.filter.outputs.docs_any_changed }}
steps:
- uses: actions/checkout@8410ad0602e1e429cee44a835ae9f77f654a6694 # v4.0.0
- uses: tj-actions/changed-files@90a06d6ba9543371ab4df8eeca0be07ca6054959 # v42.0.2
- uses: tj-actions/changed-files@c65cd883420fd2eb864698a825fc4162dd94482c # v44.5.7
id: filter
with:
# Any file which is not under docs/, ui/ or is not a markdown file is counted as a backend file
@@ -43,6 +44,8 @@ jobs:
frontend:
- 'ui/**'
- Dockerfile
docs:
- 'docs/**'
check-go:
name: Ensure Go modules synchronicity
if: ${{ needs.changes.outputs.backend == 'true' }}
@@ -53,7 +56,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@8410ad0602e1e429cee44a835ae9f77f654a6694 # v4.0.0
- name: Setup Golang
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.0.0
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: ${{ env.GOLANG_VERSION }}
- name: Download all Go modules
@@ -74,11 +77,11 @@ jobs:
- name: Checkout code
uses: actions/checkout@8410ad0602e1e429cee44a835ae9f77f654a6694 # v4.0.0
- name: Setup Golang
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.0.0
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: ${{ env.GOLANG_VERSION }}
- name: Restore go build cache
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ~/.cache/go-build
key: ${{ runner.os }}-go-build-v1-${{ github.run_id }}
@@ -101,14 +104,14 @@ jobs:
- name: Checkout code
uses: actions/checkout@8410ad0602e1e429cee44a835ae9f77f654a6694 # v4.0.0
- name: Setup Golang
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.0.0
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: ${{ env.GOLANG_VERSION }}
- name: Run golangci-lint
uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc # v3.7.0
uses: golangci/golangci-lint-action@aaa42aa0628b4ae2578232a66b541047968fac86 # v6.1.0
with:
version: v1.54.0
args: --enable gofmt --timeout 10m --exclude SA5011 --verbose --max-issues-per-linter 0 --max-same-issues 0
version: v1.58.2
args: --verbose
test-go:
name: Run unit tests for Go packages
@@ -128,7 +131,7 @@ jobs:
- name: Create symlink in GOPATH
run: ln -s $(pwd) ~/go/src/github.com/argoproj/argo-cd
- name: Setup Golang
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.0.0
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: ${{ env.GOLANG_VERSION }}
- name: Install required packages
@@ -148,7 +151,7 @@ jobs:
run: |
echo "/usr/local/bin" >> $GITHUB_PATH
- name: Restore go build cache
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ~/.cache/go-build
key: ${{ runner.os }}-go-build-v1-${{ github.run_id }}
@@ -168,16 +171,11 @@ jobs:
go mod download
- name: Run all unit tests
run: make test-local
- name: Generate code coverage artifacts
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name: code-coverage
path: coverage.out
- name: Generate test results artifacts
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
with:
name: test-results
path: test-results/
path: test-results
test-go-race:
name: Run unit tests with -race for Go packages
@@ -197,7 +195,7 @@ jobs:
- name: Create symlink in GOPATH
run: ln -s $(pwd) ~/go/src/github.com/argoproj/argo-cd
- name: Setup Golang
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.0.0
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: ${{ env.GOLANG_VERSION }}
- name: Install required packages
@@ -217,7 +215,7 @@ jobs:
run: |
echo "/usr/local/bin" >> $GITHUB_PATH
- name: Restore go build cache
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ~/.cache/go-build
key: ${{ runner.os }}-go-build-v1-${{ github.run_id }}
@@ -238,14 +236,14 @@ jobs:
- name: Run all unit tests
run: make test-race-local
- name: Generate test results artifacts
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
with:
name: race-results
path: test-results/
codegen:
name: Check changes to generated code
if: ${{ needs.changes.outputs.backend == 'true' }}
if: ${{ needs.changes.outputs.backend == 'true' || needs.changes.outputs.docs == 'true'}}
runs-on: ubuntu-22.04
needs:
- changes
@@ -253,7 +251,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@8410ad0602e1e429cee44a835ae9f77f654a6694 # v4.0.0
- name: Setup Golang
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.0.0
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: ${{ env.GOLANG_VERSION }}
- name: Create symlink in GOPATH
@@ -296,7 +294,8 @@ jobs:
build-ui:
name: Build, test & lint UI code
if: ${{ needs.changes.outputs.frontend == 'true' }}
# We run UI logic for backend changes so that we have a complete set of coverage documents to send to codecov.
if: ${{ needs.changes.outputs.backend == 'true' || needs.changes.outputs.frontend == 'true' }}
runs-on: ubuntu-22.04
needs:
- changes
@@ -304,12 +303,12 @@ jobs:
- name: Checkout code
uses: actions/checkout@8410ad0602e1e429cee44a835ae9f77f654a6694 # v4.0.0
- name: Setup NodeJS
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
with:
node-version: '21.6.1'
- name: Restore node dependency cache
id: cache-dependencies
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ui/node_modules
key: ${{ runner.os }}-node-dep-v2-${{ hashFiles('**/yarn.lock') }}
@@ -337,6 +336,7 @@ jobs:
- test-go
- build-ui
- changes
- test-e2e
env:
sonar_secret: ${{ secrets.SONAR_TOKEN }}
steps:
@@ -346,57 +346,43 @@ jobs:
fetch-depth: 0
- name: Restore node dependency cache
id: cache-dependencies
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ui/node_modules
key: ${{ runner.os }}-node-dep-v2-${{ hashFiles('**/yarn.lock') }}
- name: Remove other node_modules directory
run: |
rm -rf ui/node_modules/argo-ui/node_modules
- name: Create test-results directory
run: |
mkdir -p test-results
- name: Get code coverage artifact
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
- name: Get e2e code coverage
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: code-coverage
- name: Get test result artifact
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
name: e2e-code-coverage
path: e2e-code-coverage
- name: Get unit test code coverage
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: test-results
path: test-results
- name: combine-go-coverage
# We generate coverage reports for all Argo CD components, but only the applicationset-controller,
# app-controller, and repo-server report contain coverage data. The other components currently don't shut down
# gracefully, so no coverage data is produced. Once those components are fixed, we can add references to their
# coverage output directories.
run: |
go tool covdata percent -i=test-results,e2e-code-coverage/applicationset-controller,e2e-code-coverage/repo-server,e2e-code-coverage/app-controller -o test-results/full-coverage.out
- name: Upload code coverage information to codecov.io
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
with:
file: coverage.out
file: test-results/full-coverage.out
fail_ci_if_error: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Perform static code analysis using SonarCloud
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SCANNER_VERSION: 4.2.0.1873
SCANNER_PATH: /tmp/cache/scanner
OS: linux
run: |
# We do not use the provided action, because it does contain an old
# version of the scanner, and also takes time to build.
set -e
mkdir -p ${SCANNER_PATH}
export SONAR_USER_HOME=${SCANNER_PATH}/.sonar
if [[ ! -x "${SCANNER_PATH}/sonar-scanner-${SCANNER_VERSION}-${OS}/bin/sonar-scanner" ]]; then
curl -Ol https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${SCANNER_VERSION}-${OS}.zip
unzip -qq -o sonar-scanner-cli-${SCANNER_VERSION}-${OS}.zip -d ${SCANNER_PATH}
fi
chmod +x ${SCANNER_PATH}/sonar-scanner-${SCANNER_VERSION}-${OS}/bin/sonar-scanner
chmod +x ${SCANNER_PATH}/sonar-scanner-${SCANNER_VERSION}-${OS}/jre/bin/java
# Explicitly set NODE_MODULES
export NODE_MODULES=${PWD}/ui/node_modules
export NODE_PATH=${PWD}/ui/node_modules
${SCANNER_PATH}/sonar-scanner-${SCANNER_VERSION}-${OS}/bin/sonar-scanner
uses: SonarSource/sonarqube-scan-action@aecaf43ae57e412bd97d70ef9ce6076e672fe0a9 # v2.2
if: env.sonar_secret != ''
test-e2e:
name: Run end-to-end tests
if: ${{ needs.changes.outputs.backend == 'true' }}
@@ -404,7 +390,16 @@ jobs:
strategy:
fail-fast: false
matrix:
k3s-version: [v1.29.1, v1.28.6, v1.27.10, v1.26.13, v1.25.16]
k3s:
- version: v1.30.2
# We designate the latest version because we only collect code coverage for that version.
latest: true
- version: v1.29.6
latest: false
- version: v1.28.11
latest: false
- version: v1.27.15
latest: false
needs:
- build-go
- changes
@@ -425,7 +420,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@8410ad0602e1e429cee44a835ae9f77f654a6694 # v4.0.0
- name: Setup Golang
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.0.0
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: ${{ env.GOLANG_VERSION }}
- name: GH actions workaround - Kill XSP4 process
@@ -433,7 +428,7 @@ jobs:
sudo pkill mono || true
- name: Install K3S
env:
INSTALL_K3S_VERSION: ${{ matrix.k3s-version }}+k3s1
INSTALL_K3S_VERSION: ${{ matrix.k3s.version }}+k3s1
run: |
set -x
curl -sfL https://get.k3s.io | sh -
@@ -444,7 +439,7 @@ jobs:
sudo chmod go-r $HOME/.kube/config
kubectl version
- name: Restore go build cache
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ~/.cache/go-build
key: ${{ runner.os }}-go-build-v1-${{ github.run_id }}
@@ -470,9 +465,9 @@ jobs:
git config --global user.email "john.doe@example.com"
- name: Pull Docker image required for tests
run: |
docker pull ghcr.io/dexidp/dex:v2.38.0
docker pull ghcr.io/dexidp/dex:v2.41.1
docker pull argoproj/argo-cd-ci-builder:v1.0.0
docker pull redis:7.0.14-alpine
docker pull redis:7.0.15-alpine
- name: Create target directory for binaries in the build-process
run: |
mkdir -p dist
@@ -485,7 +480,7 @@ jobs:
# port 8080 which is not visible in netstat -tulpen, but still there
# with a HTTP listener. We have API server listening on port 8088
# instead.
make start-e2e-local 2>&1 | sed -r "s/[[:cntrl:]]\[[0-9]{1,3}m//g" > /tmp/e2e-server.log &
make start-e2e-local COVERAGE_ENABLED=true 2>&1 | sed -r "s/[[:cntrl:]]\[[0-9]{1,3}m//g" > /tmp/e2e-server.log &
count=1
until curl -f http://127.0.0.1:8088/healthz; do
sleep 10;
@@ -499,10 +494,18 @@ jobs:
run: |
set -x
make test-e2e-local
- name: Upload e2e-server logs
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
goreman run stop-all || echo "goreman trouble"
sleep 30
- name: Upload e2e coverage report
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
with:
name: e2e-server-k8s${{ matrix.k3s-version }}.log
name: e2e-code-coverage
path: /tmp/coverage
if: ${{ matrix.k3s.latest }}
- name: Upload e2e-server logs
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
with:
name: e2e-server-k8s${{ matrix.k3s.version }}.log
path: /tmp/e2e-server.log
if: ${{ failure() }}

View File

@@ -33,13 +33,13 @@ jobs:
# Use correct go version. https://github.com/github/codeql-action/issues/1842#issuecomment-1704398087
- name: Setup Golang
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.0.0
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version-file: go.mod
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@8aff97f12c99086bdb92ff62ae06dbbcdf07941b # v2.1.33
uses: github/codeql-action/init@8fcfedf57053e09257688fce7a0beeb18b1b9ae3 # v2.17.2
# Override language selection by uncommenting this and choosing your languages
# with:
# languages: go, javascript, csharp, python, cpp, java
@@ -47,7 +47,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@8aff97f12c99086bdb92ff62ae06dbbcdf07941b # v2.1.33
uses: github/codeql-action/autobuild@8fcfedf57053e09257688fce7a0beeb18b1b9ae3 # v2.17.2
# Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
@@ -61,4 +61,4 @@ jobs:
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@8aff97f12c99086bdb92ff62ae06dbbcdf07941b # v2.1.33
uses: github/codeql-action/analyze@8fcfedf57053e09257688fce7a0beeb18b1b9ae3 # v2.17.2

View File

@@ -69,15 +69,15 @@ jobs:
if: ${{ github.ref_type != 'tag'}}
- name: Setup Golang
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: ${{ inputs.go-version }}
- name: Install cosign
uses: sigstore/cosign-installer@e1523de7571e31dbe865fd2e80c5c7c23ae71eb4 # v3.4.0
uses: sigstore/cosign-installer@4959ce089c160fddf62f7b42464195ba1a56d382 # v3.6.0
- uses: docker/setup-qemu-action@2b82ce82d56a2a04d2637cd93a637ae1b359c0a7 # v2.2.0
- uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
- uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0
- uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1
- name: Setup tags for container image as a CSV type
run: |
@@ -104,7 +104,7 @@ jobs:
echo 'EOF' >> $GITHUB_ENV
- name: Login to Quay.io
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
registry: quay.io
username: ${{ secrets.quay_username }}
@@ -112,7 +112,7 @@ jobs:
if: ${{ inputs.quay_image_name && inputs.push }}
- name: Login to GitHub Container Registry
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
registry: ghcr.io
username: ${{ secrets.ghcr_username }}
@@ -120,7 +120,7 @@ jobs:
if: ${{ inputs.ghcr_image_name && inputs.push }}
- name: Login to dockerhub Container Registry
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
username: ${{ secrets.docker_username }}
password: ${{ secrets.docker_password }}
@@ -134,7 +134,7 @@ jobs:
echo "GIT_TREE_STATE=$(if [ -z "`git status --porcelain`" ]; then echo "clean" ; else echo "dirty"; fi)" >> $GITHUB_ENV
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@4d9e71b726748f254fe64fa44d273194bd18ec91
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be
with:
large-packages: false
docker-images: false
@@ -143,7 +143,7 @@ jobs:
- name: Build and push container image
id: image
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 #v5.3.0
uses: docker/build-push-action@16ebe778df0e7752d2cfcbd924afdbbd89c1a755 #v6.6.1
with:
context: .
platforms: ${{ inputs.platforms }}

View File

@@ -52,7 +52,7 @@ jobs:
uses: ./.github/workflows/image-reuse.yaml
with:
# Note: cannot use env variables to set go-version (https://docs.github.com/en/actions/using-workflows/reusing-workflows#limitations)
go-version: 1.21
go-version: 1.22
platforms: ${{ needs.set-vars.outputs.platforms }}
push: false
@@ -68,7 +68,7 @@ jobs:
quay_image_name: quay.io/argoproj/argocd:latest
ghcr_image_name: ghcr.io/argoproj/argo-cd/argocd:${{ needs.set-vars.outputs.image-tag }}
# Note: cannot use env variables to set go-version (https://docs.github.com/en/actions/using-workflows/reusing-workflows#limitations)
go-version: 1.21
go-version: 1.22
platforms: ${{ needs.set-vars.outputs.platforms }}
push: true
secrets:
@@ -86,7 +86,7 @@ jobs:
packages: write # for uploading attestations. (https://github.com/slsa-framework/slsa-github-generator/blob/main/internal/builders/container/README.md#known-issues)
if: ${{ github.repository == 'argoproj/argo-cd' && github.event_name == 'push' }}
# Must be refernced by a tag. https://github.com/slsa-framework/slsa-github-generator/blob/main/internal/builders/container/README.md#referencing-the-slsa-generator
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_container_slsa3.yml@v1.10.0
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_container_slsa3.yml@v2.0.0
with:
image: ghcr.io/argoproj/argo-cd/argocd
digest: ${{ needs.build-and-publish.outputs.image-digest }}

View File

@@ -64,7 +64,7 @@ jobs:
git stash pop
- name: Create pull request
uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38 # v5.0.2
uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c # v6.1.0
with:
commit-message: "Bump version to ${{ inputs.TARGET_VERSION }}"
title: "Bump version to ${{ inputs.TARGET_VERSION }} on ${{ inputs.TARGET_BRANCH }} branch"

View File

@@ -23,7 +23,7 @@ jobs:
name: Validate PR Title
runs-on: ubuntu-latest
steps:
- uses: thehanimo/pr-title-checker@0cf5902181e78341bb97bb06646396e5bd354b3f # v1.4.0
- uses: thehanimo/pr-title-checker@1d8cd483a2b73118406a187f54dca8a9415f1375 # v1.4.2
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
configuration_path: ".github/pr-title-checker-config.json"

View File

@@ -10,7 +10,7 @@ on:
permissions: {}
env:
GOLANG_VERSION: '1.21' # Note: go-version must also be set in job argocd-image.with.go-version
GOLANG_VERSION: '1.22' # Note: go-version must also be set in job argocd-image.with.go-version
jobs:
argocd-image:
@@ -23,7 +23,7 @@ jobs:
with:
quay_image_name: quay.io/argoproj/argocd:${{ github.ref_name }}
# Note: cannot use env variables to set go-version (https://docs.github.com/en/actions/using-workflows/reusing-workflows#limitations)
go-version: 1.21
go-version: 1.22
platforms: linux/amd64,linux/arm64,linux/s390x,linux/ppc64le
push: true
secrets:
@@ -38,7 +38,7 @@ jobs:
packages: write # for uploading attestations. (https://github.com/slsa-framework/slsa-github-generator/blob/main/internal/builders/container/README.md#known-issues)
# Must be refernced by a tag. https://github.com/slsa-framework/slsa-github-generator/blob/main/internal/builders/container/README.md#referencing-the-slsa-generator
if: github.repository == 'argoproj/argo-cd'
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_container_slsa3.yml@v1.10.0
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_container_slsa3.yml@v2.0.0
with:
image: quay.io/argoproj/argocd
digest: ${{ needs.argocd-image.outputs.image-digest }}
@@ -77,7 +77,7 @@ jobs:
fi
- name: Setup Golang
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.0.0
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: ${{ env.GOLANG_VERSION }}
@@ -88,7 +88,7 @@ jobs:
echo "GIT_TREE_STATE=$(if [ -z "`git status --porcelain`" ]; then echo "clean" ; else echo "dirty"; fi)" >> $GITHUB_ENV
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@4d9e71b726748f254fe64fa44d273194bd18ec91
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be
with:
large-packages: false
docker-images: false
@@ -96,7 +96,7 @@ jobs:
tool-cache: false
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 # v5.0.0
uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 # v6.0.0
id: run-goreleaser
with:
version: latest
@@ -128,7 +128,7 @@ jobs:
contents: write # Needed for release uploads
if: github.repository == 'argoproj/argo-cd'
# Must be refernced by a tag. https://github.com/slsa-framework/slsa-github-generator/blob/main/internal/builders/container/README.md#referencing-the-slsa-generator
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v1.10.0
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v2.0.0
with:
base64-subjects: "${{ needs.goreleaser.outputs.hashes }}"
provenance-name: "argocd-cli.intoto.jsonl"
@@ -153,7 +153,7 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Golang
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: ${{ env.GOLANG_VERSION }}
@@ -197,7 +197,7 @@ jobs:
echo "hashes=$(sha256sum /tmp/sbom.tar.gz | base64 -w0)" >> "$GITHUB_OUTPUT"
- name: Upload SBOM
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v0.1.15
uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191 # v2.0.8
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
@@ -212,7 +212,7 @@ jobs:
contents: write # Needed for release uploads
if: github.repository == 'argoproj/argo-cd'
# Must be refernced by a tag. https://github.com/slsa-framework/slsa-github-generator/blob/main/internal/builders/container/README.md#referencing-the-slsa-generator
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v1.10.0
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v2.0.0
with:
base64-subjects: "${{ needs.generate-sbom.outputs.hashes }}"
provenance-name: "argocd-sbom.intoto.jsonl"
@@ -291,11 +291,11 @@ jobs:
# Replace the 'project-release: vX.X.X-rcX' line in SECURITY-INSIGHTS.yml
sed -i "s/project-release: v.*$/project-release: v${{ env.NEW_VERSION }}/" SECURITY-INSIGHTS.yml
# Update the 'commit-hash: XXXXXXX' line in SECURITY-INSIGHTS.yml
sed -i "s/commit-hash: .*/commit-hash: ${{ env.NEW_VERSION }}/" SECURITY-INSIGHTS.yml
sed -i "s/commit-hash: .*/commit-hash: ${{ env.COMMIT_HASH }}/" SECURITY-INSIGHTS.yml
if: ${{ env.UPDATE_VERSION == 'true' }}
- name: Create PR to update VERSION on master branch
uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38 # v5.0.2
uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c # v6.1.0
with:
commit-message: Bump version in master
title: "chore: Bump version in master"

View File

@@ -35,7 +35,7 @@ jobs:
persist-credentials: false
- name: "Run analysis"
uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1
uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.4.0
with:
results_file: results.sarif
results_format: sarif
@@ -54,7 +54,7 @@ jobs:
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
with:
name: SARIF file
path: results.sarif
@@ -62,6 +62,6 @@ jobs:
# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@83a02f7883b12e0e4e1a146174f5e2292a01e601 # v2.16.4
uses: github/codeql-action/upload-sarif@8fcfedf57053e09257688fce7a0beeb18b1b9ae3 # v2.17.2
with:
sarif_file: results.sarif

1
.gitignore vendored
View File

@@ -19,6 +19,7 @@ node_modules/
./test/cmp/*.sock
.envrc.remote
.*.swp
rerunreport.txt
# ignore built binaries
cmd/argocd/argocd

2
.gitpod.Dockerfile vendored
View File

@@ -1,4 +1,4 @@
FROM gitpod/workspace-full@sha256:511cecde4dc129ca9eb4cc4c479d61f95e5485ebe320a07f5b902f11899956a3
FROM gitpod/workspace-full@sha256:fbff2dce4236535b96de0e94622bbe9a44fba954ca064862004c34e3e08904df
USER root

41
.golangci.yaml Normal file
View File

@@ -0,0 +1,41 @@
issues:
exclude:
- SA1019
- SA5011
max-issues-per-linter: 0
max-same-issues: 0
linters:
enable:
- errcheck
- errorlint
- gocritic
- gofumpt
- goimports
- gosimple
- govet
- ineffassign
- misspell
- staticcheck
- testifylint
- unused
- whitespace
linters-settings:
gocritic:
disabled-checks:
- appendAssign
- assignOp # Keep it disabled for readability
- badCond
- commentFormatting
- exitAfterDefer
- ifElseChain
- mapKey
- singleCaseSwitch
- typeSwitchVar
goimports:
local-prefixes: github.com/argoproj/argo-cd/v2
testifylint:
enable-all: true
disable:
- go-require
run:
timeout: 50m

View File

@@ -1,3 +1,5 @@
version: 2
project_name: argocd
before:
@@ -114,7 +116,7 @@ changelog:
exclude:
- '^test:'
- '^.*?Bump(\([[:word:]]+\))?.+$'
- '^.*?[Bot](\([[:word:]]+\))?.+$'
- '^.*?\[Bot\](\([[:word:]]+\))?.+$'
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json

68
.mockery.yaml Normal file
View File

@@ -0,0 +1,68 @@
# global config
filename: "{{.InterfaceName}}.go"
dir: "{{.InterfaceDir}}/mocks"
outpkg: "mocks"
mockname: "{{.InterfaceName}}"
with-expecter: false
# individual interface config
packages:
github.com/argoproj/argo-cd/v2/applicationset/generators:
interfaces:
Generator:
github.com/argoproj/argo-cd/v2/applicationset/services:
interfaces:
Repos:
github.com/argoproj/argo-cd/v2/applicationset/services/scm_provider:
config:
dir: "applicationset/services/scm_provider/aws_codecommit/mocks"
interfaces:
AWSCodeCommitClient:
AWSTaggingClient:
github.com/microsoft/azure-devops-go-api/azuredevops/git:
config:
dir: "applicationset/services/scm_provider/azure_devops/git/mocks"
interfaces:
Client:
github.com/argoproj/argo-cd/v2/applicationset/utils:
interfaces:
Renderer:
github.com/argoproj/argo-cd/v2/controller/cache:
interfaces:
LiveStateCache:
github.com/argoproj/argo-cd/v2/reposerver/apiclient:
interfaces:
RepoServerServiceClient:
RepoServerService_GenerateManifestWithFilesClient:
github.com/argoproj/argo-cd/v2/server/application:
interfaces:
Broadcaster:
github.com/argoproj/argo-cd/v2/server/extension:
interfaces:
ApplicationGetter:
ExtensionMetricsRegistry:
ProjectGetter:
RbacEnforcer:
SettingsGetter:
github.com/argoproj/argo-cd/v2/util/db:
interfaces:
ArgoDB:
github.com/argoproj/argo-cd/v2/util/git:
interfaces:
Client:
github.com/argoproj/argo-cd/v2/util/helm:
interfaces:
Client:
github.com/argoproj/argo-cd/v2/util/io:
interfaces:
TempPaths:
github.com/argoproj/argo-cd/v2/util/notification/argocd:
interfaces:
Service:
# These mocks are not currently used, but they are part of the public API of this package.
github.com/argoproj/argo-cd/v2/pkg/apiclient/session:
interfaces:
SessionServiceServer:
SessionServiceClient:
github.com/argoproj/argo-cd/v2/pkg/apiclient/cluster:
interfaces:
ClusterServiceServer:

View File

@@ -8,5 +8,7 @@
/mkdocs.yml @argoproj/argocd-approvers @argoproj/argocd-approvers-docs
# CI
/.github/** @argoproj/argocd-approvers @argoproj/argocd-approvers-ci
/.goreleaser.yaml @argoproj/argocd-approvers @argoproj/argocd-approvers-ci
/.codecov.yml @argoproj/argocd-approvers @argoproj/argocd-approvers-ci
/.github/** @argoproj/argocd-approvers @argoproj/argocd-approvers-ci
/.goreleaser.yaml @argoproj/argocd-approvers @argoproj/argocd-approvers-ci
/sonar-project.properties @argoproj/argocd-approvers @argoproj/argocd-approvers-ci

View File

@@ -1,12 +1,12 @@
ARG BASE_IMAGE=docker.io/library/ubuntu:22.04@sha256:0bced47fffa3361afa981854fcabcd4577cd43cebbb808cea2b1f33a3dd7f508
ARG BASE_IMAGE=docker.io/library/ubuntu:24.04@sha256:3f85b7caad41a95462cf5b787d8a04604c8262cdcdf9a472b8c52ef83375fe15
####################################################################################################
# Builder image
# Initial stage which pulls prepares build dependencies and CLI tooling we need for our final image
# Also used as the image in CI jobs so needs all dependencies
####################################################################################################
FROM docker.io/library/golang:1.21.9@sha256:7d0dcbe5807b1ad7272a598fbf9d7af15b5e2bed4fd6c4c2b5b3684df0b317dd AS builder
FROM docker.io/library/golang:1.22.6@sha256:2bd56f00ff47baf33e64eae7996b65846c7cb5e0a46e0a882ef179fd89654afa AS builder
RUN echo 'deb http://deb.debian.org/debian buster-backports main' >> /etc/apt/sources.list
RUN echo 'deb http://archive.debian.org/debian buster-backports main' >> /etc/apt/sources.list
RUN apt-get update && apt-get install --no-install-recommends -y \
openssh-server \
@@ -83,7 +83,7 @@ WORKDIR /home/argocd
####################################################################################################
# Argo CD UI stage
####################################################################################################
FROM --platform=$BUILDPLATFORM docker.io/library/node:21.6.2@sha256:65998e325b06014d4f1417a8a6afb1540d1ac66521cca76f2221a6953947f9ee AS argocd-ui
FROM --platform=$BUILDPLATFORM docker.io/library/node:22.3.0@sha256:5e4044ff6001d06e7748e35bfa4f80c73cf5f5a7360a1b782995e038a01b0585 AS argocd-ui
WORKDIR /src
COPY ["ui/package.json", "ui/yarn.lock", "./"]
@@ -101,7 +101,7 @@ RUN HOST_ARCH=$TARGETARCH NODE_ENV='production' NODE_ONLINE_ENV='online' NODE_OP
####################################################################################################
# Argo CD Build stage which performs the actual build of Argo CD binaries
####################################################################################################
FROM --platform=$BUILDPLATFORM docker.io/library/golang:1.21.9@sha256:7d0dcbe5807b1ad7272a598fbf9d7af15b5e2bed4fd6c4c2b5b3684df0b317dd AS argocd-build
FROM --platform=$BUILDPLATFORM docker.io/library/golang:1.22.6@sha256:2bd56f00ff47baf33e64eae7996b65846c7cb5e0a46e0a882ef179fd89654afa AS argocd-build
WORKDIR /go/src/github.com/argoproj/argo-cd

View File

@@ -153,6 +153,13 @@ DEV_IMAGE?=false
ARGOCD_GPG_ENABLED?=true
ARGOCD_E2E_APISERVER_PORT?=8080
ifeq (${COVERAGE_ENABLED}, true)
# We use this in the cli-local target to enable code coverage for e2e tests.
COVERAGE_FLAG=-cover
else
COVERAGE_FLAG=
endif
override LDFLAGS += \
-X ${PACKAGE}.version=${VERSION} \
-X ${PACKAGE}.buildDate=${BUILD_DATE} \
@@ -185,10 +192,14 @@ endif
.PHONY: all
all: cli image
.PHONY: mockgen
mockgen:
./hack/generate-mock.sh
.PHONY: gogen
gogen:
export GO111MODULE=off
go generate ./util/argo/...
go generate ./...
.PHONY: protogen
protogen: mod-vendor-local protogen-fast
@@ -222,13 +233,16 @@ clientgen:
clidocsgen:
go run tools/cmd-docs/main.go
.PHONY: actionsdocsgen
actionsdocsgen:
hack/generate-actions-list.sh
.PHONY: codegen-local
codegen-local: mod-vendor-local gogen protogen clientgen openapigen clidocsgen manifests-local notification-docs notification-catalog
codegen-local: mod-vendor-local mockgen gogen protogen clientgen openapigen clidocsgen actionsdocsgen manifests-local notification-docs notification-catalog
rm -rf vendor/
.PHONY: codegen-local-fast
codegen-local-fast: gogen protogen-fast clientgen openapigen clidocsgen manifests-local notification-docs notification-catalog
codegen-local-fast: mockgen gogen protogen-fast clientgen openapigen clidocsgen manifests-local notification-docs notification-catalog
.PHONY: codegen
codegen: test-tools-image
@@ -240,7 +254,7 @@ cli: test-tools-image
.PHONY: cli-local
cli-local: clean-debug
CGO_ENABLED=${CGO_FLAG} GODEBUG="tarinsecurepath=0,zipinsecurepath=0" go build -v -ldflags '${LDFLAGS}' -o ${DIST_DIR}/${CLI_NAME} ./cmd
CGO_ENABLED=${CGO_FLAG} GODEBUG="tarinsecurepath=0,zipinsecurepath=0" go build $(COVERAGE_FLAG) -v -ldflags '${LDFLAGS}' -o ${DIST_DIR}/${CLI_NAME} ./cmd
.PHONY: gen-resources-cli-local
gen-resources-cli-local: clean-debug
@@ -357,7 +371,7 @@ lint-local:
golangci-lint --version
# NOTE: If you get a "Killed" OOM message, try reducing the value of GOGC
# See https://github.com/golangci/golangci-lint#memory-usage-of-golangci-lint
GOGC=$(ARGOCD_LINT_GOGC) GOMAXPROCS=2 golangci-lint run --enable gofmt --fix --verbose --timeout 3000s --max-issues-per-linter 0 --max-same-issues 0
GOGC=$(ARGOCD_LINT_GOGC) GOMAXPROCS=2 golangci-lint run --fix --verbose
.PHONY: lint-ui
lint-ui: test-tools-image
@@ -391,9 +405,9 @@ test: test-tools-image
.PHONY: test-local
test-local:
if test "$(TEST_MODULE)" = ""; then \
DIST_DIR=${DIST_DIR} RERUN_FAILS=0 PACKAGES=`go list ./... | grep -v 'test/e2e'` ./hack/test.sh -coverprofile=coverage.out; \
DIST_DIR=${DIST_DIR} RERUN_FAILS=0 PACKAGES=`go list ./... | grep -v 'test/e2e'` ./hack/test.sh -args -test.gocoverdir="$(PWD)/test-results"; \
else \
DIST_DIR=${DIST_DIR} RERUN_FAILS=0 PACKAGES="$(TEST_MODULE)" ./hack/test.sh -coverprofile=coverage.out "$(TEST_MODULE)"; \
DIST_DIR=${DIST_DIR} RERUN_FAILS=0 PACKAGES="$(TEST_MODULE)" ./hack/test.sh -args -test.gocoverdir="$(PWD)/test-results" "$(TEST_MODULE)"; \
fi
.PHONY: test-race
@@ -405,9 +419,9 @@ test-race: test-tools-image
.PHONY: test-race-local
test-race-local:
if test "$(TEST_MODULE)" = ""; then \
DIST_DIR=${DIST_DIR} RERUN_FAILS=0 PACKAGES=`go list ./... | grep -v 'test/e2e'` ./hack/test.sh -race -coverprofile=coverage.out; \
DIST_DIR=${DIST_DIR} RERUN_FAILS=0 PACKAGES=`go list ./... | grep -v 'test/e2e'` ./hack/test.sh -race -args -test.gocoverdir="$(PWD)/test-results"; \
else \
DIST_DIR=${DIST_DIR} RERUN_FAILS=0 PACKAGES="$(TEST_MODULE)" ./hack/test.sh -race -coverprofile=coverage.out; \
DIST_DIR=${DIST_DIR} RERUN_FAILS=0 PACKAGES="$(TEST_MODULE)" ./hack/test.sh -race -args -test.gocoverdir="$(PWD)/test-results"; \
fi
# Run the E2E test suite. E2E test servers (see start-e2e target) must be
@@ -421,7 +435,7 @@ test-e2e:
test-e2e-local: cli-local
# NO_PROXY ensures all tests don't go out through a proxy if one is configured on the test system
export GO111MODULE=off
DIST_DIR=${DIST_DIR} RERUN_FAILS=5 PACKAGES="./test/e2e" ARGOCD_E2E_RECORD=${ARGOCD_E2E_RECORD} ARGOCD_GPG_ENABLED=true NO_PROXY=* ./hack/test.sh -timeout $(ARGOCD_E2E_TEST_TIMEOUT) -v
DIST_DIR=${DIST_DIR} RERUN_FAILS=5 PACKAGES="./test/e2e" ARGOCD_E2E_RECORD=${ARGOCD_E2E_RECORD} ARGOCD_GPG_ENABLED=true NO_PROXY=* ./hack/test.sh -timeout $(ARGOCD_E2E_TEST_TIMEOUT) -v -args -test.gocoverdir="$(PWD)/test-results"
# Spawns a shell in the test server container for debugging purposes
debug-test-server: test-tools-image
@@ -452,6 +466,12 @@ start-e2e-local: mod-vendor-local dep-ui-local cli-local
mkdir -p /tmp/argo-e2e/app/config/gpg/keys && chmod 0700 /tmp/argo-e2e/app/config/gpg/keys
mkdir -p /tmp/argo-e2e/app/config/gpg/source && chmod 0700 /tmp/argo-e2e/app/config/gpg/source
mkdir -p /tmp/argo-e2e/app/config/plugin && chmod 0700 /tmp/argo-e2e/app/config/plugin
# create folders to hold go coverage results for each component
mkdir -p /tmp/coverage/app-controller
mkdir -p /tmp/coverage/api-server
mkdir -p /tmp/coverage/repo-server
mkdir -p /tmp/coverage/applicationset-controller
mkdir -p /tmp/coverage/notification
# set paths for locally managed ssh known hosts and tls certs data
ARGOCD_SSH_DATA_PATH=/tmp/argo-e2e/app/config/ssh \
ARGOCD_TLS_DATA_PATH=/tmp/argo-e2e/app/config/tls \
@@ -469,6 +489,7 @@ start-e2e-local: mod-vendor-local dep-ui-local cli-local
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 \
ARGOCD_E2E_TEST=true \
goreman -f $(ARGOCD_PROCFILE) start ${ARGOCD_START}
ls -lrt /tmp/coverage
# Cleans VSCode debug.test files from sub-dirs to prevent them from being included in by golang embed
.PHONY: clean-debug
@@ -494,6 +515,7 @@ start-local: mod-vendor-local dep-ui-local cli-local
mkdir -p /tmp/argocd-local
mkdir -p /tmp/argocd-local/gpg/keys && chmod 0700 /tmp/argocd-local/gpg/keys
mkdir -p /tmp/argocd-local/gpg/source
REDIS_PASSWORD=$(shell kubectl get secret argocd-redis -o jsonpath='{.data.auth}' | base64 -d) \
ARGOCD_ZJWT_FEATURE_FLAG=always \
ARGOCD_IN_CI=false \
ARGOCD_GPG_ENABLED=$(ARGOCD_GPG_ENABLED) \

1
OWNERS
View File

@@ -1,5 +1,6 @@
owners:
- alexmt
- crenshaw-dev
- jessesuen
approvers:

View File

@@ -1,13 +1,12 @@
controller: [ "$BIN_MODE" = 'true' ] && COMMAND=./dist/argocd || COMMAND='go run ./cmd/main.go' && sh -c "HOSTNAME=testappcontroller-1 FORCE_LOG_COLORS=1 ARGOCD_FAKE_IN_CLUSTER=true ARGOCD_TLS_DATA_PATH=${ARGOCD_TLS_DATA_PATH:-/tmp/argocd-local/tls} ARGOCD_SSH_DATA_PATH=${ARGOCD_SSH_DATA_PATH:-/tmp/argocd-local/ssh} ARGOCD_BINARY_NAME=argocd-application-controller $COMMAND --loglevel debug --redis localhost:${ARGOCD_E2E_REDIS_PORT:-6379} --repo-server localhost:${ARGOCD_E2E_REPOSERVER_PORT:-8081} --otlp-address=${ARGOCD_OTLP_ADDRESS} --application-namespaces=${ARGOCD_APPLICATION_NAMESPACES:-''} --server-side-diff-enabled=${ARGOCD_APPLICATION_CONTROLLER_SERVER_SIDE_DIFF:-'false'}"
api-server: [ "$BIN_MODE" = 'true' ] && COMMAND=./dist/argocd || COMMAND='go run ./cmd/main.go' && sh -c "FORCE_LOG_COLORS=1 ARGOCD_FAKE_IN_CLUSTER=true ARGOCD_TLS_DATA_PATH=${ARGOCD_TLS_DATA_PATH:-/tmp/argocd-local/tls} ARGOCD_SSH_DATA_PATH=${ARGOCD_SSH_DATA_PATH:-/tmp/argocd-local/ssh} ARGOCD_BINARY_NAME=argocd-server $COMMAND --loglevel debug --redis localhost:${ARGOCD_E2E_REDIS_PORT:-6379} --disable-auth=${ARGOCD_E2E_DISABLE_AUTH:-'true'} --insecure --dex-server http://localhost:${ARGOCD_E2E_DEX_PORT:-5556} --repo-server localhost:${ARGOCD_E2E_REPOSERVER_PORT:-8081} --port ${ARGOCD_E2E_APISERVER_PORT:-8080} --otlp-address=${ARGOCD_OTLP_ADDRESS} --application-namespaces=${ARGOCD_APPLICATION_NAMESPACES:-''}"
controller: [ "$BIN_MODE" = 'true' ] && COMMAND=./dist/argocd || COMMAND='go run ./cmd/main.go' && sh -c "GOCOVERDIR=${ARGOCD_COVERAGE_DIR:-/tmp/coverage/app-controller} HOSTNAME=testappcontroller-1 FORCE_LOG_COLORS=1 ARGOCD_FAKE_IN_CLUSTER=true ARGOCD_TLS_DATA_PATH=${ARGOCD_TLS_DATA_PATH:-/tmp/argocd-local/tls} ARGOCD_SSH_DATA_PATH=${ARGOCD_SSH_DATA_PATH:-/tmp/argocd-local/ssh} ARGOCD_BINARY_NAME=argocd-application-controller $COMMAND --loglevel debug --redis localhost:${ARGOCD_E2E_REDIS_PORT:-6379} --repo-server localhost:${ARGOCD_E2E_REPOSERVER_PORT:-8081} --otlp-address=${ARGOCD_OTLP_ADDRESS} --application-namespaces=${ARGOCD_APPLICATION_NAMESPACES:-''} --server-side-diff-enabled=${ARGOCD_APPLICATION_CONTROLLER_SERVER_SIDE_DIFF:-'false'}"
api-server: [ "$BIN_MODE" = 'true' ] && COMMAND=./dist/argocd || COMMAND='go run ./cmd/main.go' && sh -c "GOCOVERDIR=${ARGOCD_COVERAGE_DIR:-/tmp/coverage/api-server} FORCE_LOG_COLORS=1 ARGOCD_FAKE_IN_CLUSTER=true ARGOCD_TLS_DATA_PATH=${ARGOCD_TLS_DATA_PATH:-/tmp/argocd-local/tls} ARGOCD_SSH_DATA_PATH=${ARGOCD_SSH_DATA_PATH:-/tmp/argocd-local/ssh} ARGOCD_BINARY_NAME=argocd-server $COMMAND --loglevel debug --redis localhost:${ARGOCD_E2E_REDIS_PORT:-6379} --disable-auth=${ARGOCD_E2E_DISABLE_AUTH:-'true'} --insecure --dex-server http://localhost:${ARGOCD_E2E_DEX_PORT:-5556} --repo-server localhost:${ARGOCD_E2E_REPOSERVER_PORT:-8081} --port ${ARGOCD_E2E_APISERVER_PORT:-8080} --otlp-address=${ARGOCD_OTLP_ADDRESS} --application-namespaces=${ARGOCD_APPLICATION_NAMESPACES:-''}"
dex: sh -c "ARGOCD_BINARY_NAME=argocd-dex go run github.com/argoproj/argo-cd/v2/cmd gendexcfg -o `pwd`/dist/dex.yaml && (test -f dist/dex.yaml || { echo 'Failed to generate dex configuration'; exit 1; }) && docker run --rm -p ${ARGOCD_E2E_DEX_PORT:-5556}:${ARGOCD_E2E_DEX_PORT:-5556} -v `pwd`/dist/dex.yaml:/dex.yaml ghcr.io/dexidp/dex:$(grep "image: ghcr.io/dexidp/dex" manifests/base/dex/argocd-dex-server-deployment.yaml | cut -d':' -f3) dex serve /dex.yaml"
redis: bash -c "if [ \"$ARGOCD_REDIS_LOCAL\" = 'true' ]; then redis-server --save '' --appendonly no --port ${ARGOCD_E2E_REDIS_PORT:-6379}; else docker run --rm --name argocd-redis -i -p ${ARGOCD_E2E_REDIS_PORT:-6379}:${ARGOCD_E2E_REDIS_PORT:-6379} docker.io/library/redis:$(grep "image: redis" manifests/base/redis/argocd-redis-deployment.yaml | cut -d':' -f3) --save '' --appendonly no --port ${ARGOCD_E2E_REDIS_PORT:-6379}; fi"
repo-server: [ "$BIN_MODE" = 'true' ] && COMMAND=./dist/argocd || COMMAND='go run ./cmd/main.go' && sh -c "FORCE_LOG_COLORS=1 ARGOCD_FAKE_IN_CLUSTER=true ARGOCD_GNUPGHOME=${ARGOCD_GNUPGHOME:-/tmp/argocd-local/gpg/keys} ARGOCD_PLUGINSOCKFILEPATH=${ARGOCD_PLUGINSOCKFILEPATH:-./test/cmp} ARGOCD_GPG_DATA_PATH=${ARGOCD_GPG_DATA_PATH:-/tmp/argocd-local/gpg/source} ARGOCD_TLS_DATA_PATH=${ARGOCD_TLS_DATA_PATH:-/tmp/argocd-local/tls} ARGOCD_SSH_DATA_PATH=${ARGOCD_SSH_DATA_PATH:-/tmp/argocd-local/ssh} ARGOCD_BINARY_NAME=argocd-repo-server ARGOCD_GPG_ENABLED=${ARGOCD_GPG_ENABLED:-false} $COMMAND --loglevel debug --port ${ARGOCD_E2E_REPOSERVER_PORT:-8081} --redis localhost:${ARGOCD_E2E_REDIS_PORT:-6379} --otlp-address=${ARGOCD_OTLP_ADDRESS}"
repo-server: [ "$BIN_MODE" = 'true' ] && COMMAND=./dist/argocd || COMMAND='go run ./cmd/main.go' && sh -c "GOCOVERDIR=${ARGOCD_COVERAGE_DIR:-/tmp/coverage/repo-server} FORCE_LOG_COLORS=1 ARGOCD_FAKE_IN_CLUSTER=true ARGOCD_GNUPGHOME=${ARGOCD_GNUPGHOME:-/tmp/argocd-local/gpg/keys} ARGOCD_PLUGINSOCKFILEPATH=${ARGOCD_PLUGINSOCKFILEPATH:-./test/cmp} ARGOCD_GPG_DATA_PATH=${ARGOCD_GPG_DATA_PATH:-/tmp/argocd-local/gpg/source} ARGOCD_TLS_DATA_PATH=${ARGOCD_TLS_DATA_PATH:-/tmp/argocd-local/tls} ARGOCD_SSH_DATA_PATH=${ARGOCD_SSH_DATA_PATH:-/tmp/argocd-local/ssh} ARGOCD_BINARY_NAME=argocd-repo-server ARGOCD_GPG_ENABLED=${ARGOCD_GPG_ENABLED:-false} $COMMAND --loglevel debug --port ${ARGOCD_E2E_REPOSERVER_PORT:-8081} --redis localhost:${ARGOCD_E2E_REDIS_PORT:-6379} --otlp-address=${ARGOCD_OTLP_ADDRESS}"
cmp-server: [ "$ARGOCD_E2E_TEST" = 'true' ] && exit 0 || [ "$BIN_MODE" = 'true' ] && COMMAND=./dist/argocd || COMMAND='go run ./cmd/main.go' && sh -c "FORCE_LOG_COLORS=1 ARGOCD_FAKE_IN_CLUSTER=true ARGOCD_BINARY_NAME=argocd-cmp-server ARGOCD_PLUGINSOCKFILEPATH=${ARGOCD_PLUGINSOCKFILEPATH:-./test/cmp} $COMMAND --config-dir-path ./test/cmp --loglevel debug --otlp-address=${ARGOCD_OTLP_ADDRESS}"
ui: sh -c 'cd ui && ${ARGOCD_E2E_YARN_CMD:-yarn} start'
git-server: test/fixture/testrepos/start-git.sh
helm-registry: test/fixture/testrepos/start-helm-registry.sh
dev-mounter: [[ "$ARGOCD_E2E_TEST" != "true" ]] && go run hack/dev-mounter/main.go --configmap argocd-ssh-known-hosts-cm=${ARGOCD_SSH_DATA_PATH:-/tmp/argocd-local/ssh} --configmap argocd-tls-certs-cm=${ARGOCD_TLS_DATA_PATH:-/tmp/argocd-local/tls} --configmap argocd-gpg-keys-cm=${ARGOCD_GPG_DATA_PATH:-/tmp/argocd-local/gpg/source}
applicationset-controller: [ "$BIN_MODE" = 'true' ] && COMMAND=./dist/argocd || COMMAND='go run ./cmd/main.go' && sh -c "FORCE_LOG_COLORS=4 ARGOCD_FAKE_IN_CLUSTER=true ARGOCD_TLS_DATA_PATH=${ARGOCD_TLS_DATA_PATH:-/tmp/argocd-local/tls} ARGOCD_SSH_DATA_PATH=${ARGOCD_SSH_DATA_PATH:-/tmp/argocd-local/ssh} ARGOCD_BINARY_NAME=argocd-applicationset-controller $COMMAND --loglevel debug --metrics-addr localhost:12345 --probe-addr localhost:12346 --argocd-repo-server localhost:${ARGOCD_E2E_REPOSERVER_PORT:-8081}"
notification: [ "$BIN_MODE" = 'true' ] && COMMAND=./dist/argocd || COMMAND='go run ./cmd/main.go' && sh -c "FORCE_LOG_COLORS=4 ARGOCD_FAKE_IN_CLUSTER=true ARGOCD_TLS_DATA_PATH=${ARGOCD_TLS_DATA_PATH:-/tmp/argocd-local/tls} ARGOCD_BINARY_NAME=argocd-notifications $COMMAND --loglevel debug --application-namespaces=${ARGOCD_APPLICATION_NAMESPACES:-''} --self-service-notification-enabled=${ARGOCD_NOTIFICATION_CONTROLLER_SELF_SERVICE_NOTIFICATION_ENABLED:-'false'}"
applicationset-controller: [ "$BIN_MODE" = 'true' ] && COMMAND=./dist/argocd || COMMAND='go run ./cmd/main.go' && sh -c "GOCOVERDIR=${ARGOCD_COVERAGE_DIR:-/tmp/coverage/applicationset-controller} FORCE_LOG_COLORS=4 ARGOCD_FAKE_IN_CLUSTER=true ARGOCD_TLS_DATA_PATH=${ARGOCD_TLS_DATA_PATH:-/tmp/argocd-local/tls} ARGOCD_SSH_DATA_PATH=${ARGOCD_SSH_DATA_PATH:-/tmp/argocd-local/ssh} ARGOCD_BINARY_NAME=argocd-applicationset-controller $COMMAND --loglevel debug --metrics-addr localhost:12345 --probe-addr localhost:12346 --argocd-repo-server localhost:${ARGOCD_E2E_REPOSERVER_PORT:-8081}"
notification: [ "$BIN_MODE" = 'true' ] && COMMAND=./dist/argocd || COMMAND='go run ./cmd/main.go' && sh -c "GOCOVERDIR=${ARGOCD_COVERAGE_DIR:-/tmp/coverage/notification} FORCE_LOG_COLORS=4 ARGOCD_FAKE_IN_CLUSTER=true ARGOCD_TLS_DATA_PATH=${ARGOCD_TLS_DATA_PATH:-/tmp/argocd-local/tls} ARGOCD_BINARY_NAME=argocd-notifications $COMMAND --loglevel debug --application-namespaces=${ARGOCD_APPLICATION_NAMESPACES:-''} --self-service-notification-enabled=${ARGOCD_NOTIFICATION_CONTROLLER_SELF_SERVICE_NOTIFICATION_ENABLED:-'false'}"

View File

@@ -1,3 +1,5 @@
Test for DCO. do not merge
**Releases:**
[![Release Version](https://img.shields.io/github/v/release/argoproj/argo-cd?label=argo-cd)](https://github.com/argoproj/argo-cd/releases/latest)
[![Artifact HUB](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/argo-cd)](https://artifacthub.io/packages/helm/argo/argo-cd)
@@ -7,7 +9,7 @@
[![Integration tests](https://github.com/argoproj/argo-cd/workflows/Integration%20tests/badge.svg?branch=master)](https://github.com/argoproj/argo-cd/actions?query=workflow%3A%22Integration+tests%22)
[![codecov](https://codecov.io/gh/argoproj/argo-cd/branch/master/graph/badge.svg)](https://codecov.io/gh/argoproj/argo-cd)
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/4486/badge)](https://bestpractices.coreinfrastructure.org/projects/4486)
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/argoproj/argo-cd/badge)](https://api.securityscorecards.dev/projects/github.com/argoproj/argo-cd)
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/argoproj/argo-cd/badge)](https://scorecard.dev/viewer/?uri=github.com/argoproj/argo-cd)
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fargoproj%2Fargo-cd.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fargoproj%2Fargo-cd?ref=badge_shield)
**Social:**

View File

@@ -3,9 +3,9 @@ header:
expiration-date: '2024-10-31T00:00:00.000Z' # One year from initial release.
last-updated: '2023-10-27'
last-reviewed: '2023-10-27'
commit-hash: b71277c6beb949d0199d647a582bc25822b88838
commit-hash: fe606708859574b9b6102a505e260fac5d3fb14e
project-url: https://github.com/argoproj/argo-cd
project-release: v2.9.0-rc3
project-release: v2.13.0
changelog: https://github.com/argoproj/argo-cd/releases
license: https://github.com/argoproj/argo-cd/blob/master/LICENSE
project-lifecycle:

View File

@@ -18,9 +18,11 @@ Currently, the following organizations are **officially** using Argo CD:
1. [Albert Heijn](https://ah.nl/)
1. [Alibaba Group](https://www.alibabagroup.com/)
1. [Allianz Direct](https://www.allianzdirect.de/)
1. [AlphaSense](https://www.alpha-sense.com/)
1. [Amadeus IT Group](https://amadeus.com/)
1. [Ambassador Labs](https://www.getambassador.io/)
1. [Ancestry](https://www.ancestry.com/)
1. [Andgo Systems](https://www.andgosystems.com/)
1. [ANSTO - Australian Synchrotron](https://www.synchrotron.org.au/)
1. [Ant Group](https://www.antgroup.com/)
1. [AppDirect](https://www.appdirect.com)
@@ -35,13 +37,17 @@ Currently, the following organizations are **officially** using Argo CD:
1. [BCDevExchange DevOps Platform](https://bcdevexchange.org/DevOpsPlatform)
1. [Beat](https://thebeat.co/en/)
1. [Beez Innovation Labs](https://www.beezlabs.com/)
1. [Bedag Informatik AG](https://www.bedag.ch/)
1. [Beleza Na Web](https://www.belezanaweb.com.br/)
1. [BigPanda](https://bigpanda.io)
1. [BioBox Analytics](https://biobox.io)
1. [BMW Group](https://www.bmwgroup.com/)
1. [Boozt](https://www.booztgroup.com/)
1. [Bosch](https://www.bosch.com/)
1. [Boticario](https://www.boticario.com.br/)
1. [Broker Consulting, a.s.](https://www.bcas.cz/en/)
1. [Bulder Bank](https://bulderbank.no)
1. [Cabify](https://cabify.com/en)
1. [CAM](https://cam-inc.co.jp)
1. [Camptocamp](https://camptocamp.com)
1. [Candis](https://www.candis.io)
@@ -58,12 +64,16 @@ Currently, the following organizations are **officially** using Argo CD:
1. [Cisco ET&I](https://eti.cisco.com/)
1. [Cloud Posse](https://www.cloudposse.com/)
1. [Cloud Scale](https://cloudscaleinc.com/)
1. [CloudScript](https://www.cloudscript.com.br/)
1. [CloudGeometry](https://www.cloudgeometry.io/)
1. [Cloudmate](https://cloudmt.co.kr/)
1. [Cloudogu](https://cloudogu.com/)
1. [Cobalt](https://www.cobalt.io/)
1. [Codefresh](https://www.codefresh.io/)
1. [Codility](https://www.codility.com/)
1. [Cognizant](https://www.cognizant.com/)
1. [Commonbond](https://commonbond.co/)
1. [Contlo](https://contlo.com/)
1. [Coralogix](https://coralogix.com/)
1. [Crédit Agricole CIB](https://www.ca-cib.com)
1. [CROZ d.o.o.](https://croz.net/)
@@ -103,9 +113,11 @@ Currently, the following organizations are **officially** using Argo CD:
1. [Freshop, Inc](https://www.freshop.com/)
1. [Future PLC](https://www.futureplc.com/)
1. [G DATA CyberDefense AG](https://www.gdata-software.com/)
1. [G-Research](https://www.gresearch.com/teams/open-source-software/)
1. [Garner](https://www.garnercorp.com)
1. [Generali Deutschland AG](https://www.generali.de/)
1. [Gepardec](https://gepardec.com/)
1. [Getir](https://getir.com)
1. [GetYourGuide](https://www.getyourguide.com/)
1. [Gitpod](https://www.gitpod.io)
1. [Gllue](https://gllue.com)
@@ -122,6 +134,7 @@ Currently, the following organizations are **officially** using Argo CD:
1. [Groww](https://groww.in)
1. [Grupo MasMovil](https://grupomasmovil.com/en/)
1. [Handelsbanken](https://www.handelsbanken.se)
1. [Hazelcast](https://hazelcast.com/)
1. [Healy](https://www.healyworld.net)
1. [Helio](https://helio.exchange)
1. [Hetki](https://hetki.ai)
@@ -132,6 +145,7 @@ Currently, the following organizations are **officially** using Argo CD:
1. [IABAI](https://www.iab.ai)
1. [IBM](https://www.ibm.com/)
1. [Ibotta](https://home.ibotta.com)
1. [IFS](https://www.ifs.com)
1. [IITS-Consulting](https://iits-consulting.de)
1. [IllumiDesk](https://www.illumidesk.com)
1. [imaware](https://imaware.health)
@@ -139,6 +153,7 @@ Currently, the following organizations are **officially** using Argo CD:
1. [Index Exchange](https://www.indexexchange.com/)
1. [Info Support](https://www.infosupport.com/)
1. [InsideBoard](https://www.insideboard.com)
1. [Instruqt](https://www.instruqt.com)
1. [Intuit](https://www.intuit.com/)
1. [Jellysmack](https://www.jellysmack.com)
1. [Joblift](https://joblift.com/)
@@ -148,6 +163,7 @@ Currently, the following organizations are **officially** using Argo CD:
1. [Karrot](https://www.daangn.com/)
1. [KarrotPay](https://www.daangnpay.com/)
1. [Kasa](https://kasa.co.kr/)
1. [Kave Home](https://kavehome.com)
1. [Keeeb](https://www.keeeb.com/)
1. [KelkooGroup](https://www.kelkoogroup.com)
1. [Keptn](https://keptn.sh)
@@ -159,6 +175,9 @@ Currently, the following organizations are **officially** using Argo CD:
1. [KubeSphere](https://github.com/kubesphere)
1. [Kurly](https://www.kurly.com/)
1. [Kvist](https://kvistsolutions.com)
1. [Kyriba](https://www.kyriba.com/)
1. [LeFigaro](https://www.lefigaro.fr/)
1. [Lely](https://www.lely.com/)
1. [LexisNexis](https://www.lexisnexis.com/)
1. [Lian Chu Securities](https://lczq.com)
1. [Liatrio](https://www.liatrio.com)
@@ -179,6 +198,7 @@ Currently, the following organizations are **officially** using Argo CD:
1. [Meilleurs Agents](https://www.meilleursagents.com/)
1. [Mercedes-Benz Tech Innovation](https://www.mercedes-benz-techinnovation.com/)
1. [Mercedes-Benz.io](https://www.mercedes-benz.io/)
1. [Metacore Games](https://metacoregames.com/)
1. [Metanet](http://www.metanet.co.kr/en/)
1. [MindSpore](https://mindspore.cn)
1. [Mirantis](https://mirantis.com/)
@@ -188,21 +208,26 @@ Currently, the following organizations are **officially** using Argo CD:
1. [Money Forward](https://corp.moneyforward.com/en/)
1. [MOO Print](https://www.moo.com/)
1. [MTN Group](https://www.mtn.com/)
1. [Municipality of The Hague](https://www.denhaag.nl/)
1. [My Job Glasses](https://myjobglasses.com)
1. [Natura &Co](https://naturaeco.com/)
1. [Nethopper](https://nethopper.io)
1. [New Relic](https://newrelic.com/)
1. [Nextbasket](https://nextbasket.com)
1. [Nextdoor](https://nextdoor.com/)
1. [Next Fit Sistemas](https://nextfit.com.br/)
1. [Nikkei](https://www.nikkei.co.jp/nikkeiinfo/en/)
1. [Nitro](https://gonitro.com)
1. [NYCU, CS IT Center](https://it.cs.nycu.edu.tw)
1. [Objective](https://www.objective.com.br/)
1. [OCCMundial](https://occ.com.mx)
1. [Octadesk](https://octadesk.com)
1. [Octopus Deploy](https://octopus.com)
1. [Olfeo](https://www.olfeo.com/)
1. [omegaUp](https://omegaUp.com)
1. [Omni](https://omni.se/)
1. [Oncourse Home Solutions](https://oncoursehome.com/)
1. [Open Analytics](https://openanalytics.eu)
1. [openEuler](https://openeuler.org)
1. [openGauss](https://opengauss.org/)
1. [OpenGov](https://opengov.com)
@@ -225,7 +250,9 @@ Currently, the following organizations are **officially** using Argo CD:
1. [Percona](https://percona.com/)
1. [PGS](https://www.pgs.com)
1. [Pigment](https://www.gopigment.com/)
1. [Pipedrive](https://www.pipedrive.com/)
1. [Pipefy](https://www.pipefy.com/)
1. [Pipekit](https://pipekit.io/)
1. [Pismo](https://pismo.io/)
1. [PITS Globale Datenrettungsdienste](https://www.pitsdatenrettung.de/)
1. [Platform9 Systems](https://platform9.com/)
@@ -233,6 +260,7 @@ Currently, the following organizations are **officially** using Argo CD:
1. [PostFinance](https://github.com/postfinance)
1. [Preferred Networks](https://preferred.jp/en/)
1. [Previder BV](https://previder.nl)
1. [Priceline](https://priceline.com)
1. [Procore](https://www.procore.com)
1. [Productboard](https://www.productboard.com/)
1. [Prudential](https://prudential.com.sg)
@@ -244,17 +272,18 @@ Currently, the following organizations are **officially** using Argo CD:
1. [Quipper](https://www.quipper.com/)
1. [RapidAPI](https://www.rapidapi.com/)
1. [rebuy](https://www.rebuy.de/)
1. [Recreation.gov](https://www.recreation.gov/)
1. [Red Hat](https://www.redhat.com/)
1. [Redpill Linpro](https://www.redpill-linpro.com/)
1. [Reenigne Cloud](https://reenigne.ca)
1. [reev.com](https://www.reev.com/)
1. [Relex Solutions](https://www.relexsolutions.com/)
1. [RightRev](https://rightrev.com/)
1. [Rijkswaterstaat](https://www.rijkswaterstaat.nl/en)
1. [Rise](https://www.risecard.eu/)
1. [Riskified](https://www.riskified.com/)
1. [Robotinfra](https://www.robotinfra.com)
1. [Rocket.Chat](https://rocket.chat)
1. [Rogo](https://rogodata.com)
1. [Rubin Observatory](https://www.lsst.org)
1. [Saildrone](https://www.saildrone.com/)
1. [Salad Technologies](https://salad.com/)
@@ -264,10 +293,13 @@ Currently, the following organizations are **officially** using Argo CD:
1. [Schwarz IT](https://jobs.schwarz/it-mission)
1. [SCRM Lidl International Hub](https://scrm.lidl)
1. [SEEK](https://seek.com.au)
1. [SEKAI](https://www.sekai.io/)
1. [Semgrep](https://semgrep.com)
1. [Shield](https://shield.com)
1. [SI Analytics](https://si-analytics.ai)
1. [Sidewalk Entertainment](https://sidewalkplay.com/)
1. [Skit](https://skit.ai/)
1. [Skribble](https://skribble.com)
1. [Skyscanner](https://www.skyscanner.net/)
1. [Smart Pension](https://www.smartpension.co.uk/)
1. [Smilee.io](https://smilee.io)
@@ -290,6 +322,7 @@ Currently, the following organizations are **officially** using Argo CD:
1. [Swisscom](https://www.swisscom.ch)
1. [Swissquote](https://github.com/swissquote)
1. [Syncier](https://syncier.com/)
1. [Syself](https://syself.com)
1. [TableCheck](https://tablecheck.com/)
1. [Tailor Brands](https://www.tailorbrands.com)
1. [Tamkeen Technologies](https://tamkeentech.sa/)
@@ -319,6 +352,7 @@ Currently, the following organizations are **officially** using Argo CD:
1. [Urbantz](https://urbantz.com/)
1. [Vectra](https://www.vectra.ai)
1. [Veepee](https://www.veepee.com)
1. [Verkada](https://www.verkada.com)
1. [Viaduct](https://www.viaduct.ai/)
1. [VietMoney](https://vietmoney.vn/)
1. [Vinted](https://vinted.com/)

View File

@@ -1 +1 @@
2.11.0
2.13.0

View File

@@ -18,8 +18,11 @@ import (
"context"
"fmt"
"reflect"
"strings"
"time"
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
log "github.com/sirupsen/logrus"
corev1 "k8s.io/api/core/v1"
apierr "k8s.io/apimachinery/pkg/api/errors"
@@ -39,9 +42,10 @@ import (
"sigs.k8s.io/controller-runtime/pkg/event"
"sigs.k8s.io/controller-runtime/pkg/handler"
"sigs.k8s.io/controller-runtime/pkg/predicate"
"sigs.k8s.io/controller-runtime/pkg/source"
"github.com/argoproj/argo-cd/v2/applicationset/controllers/template"
"github.com/argoproj/argo-cd/v2/applicationset/generators"
"github.com/argoproj/argo-cd/v2/applicationset/status"
"github.com/argoproj/argo-cd/v2/applicationset/utils"
"github.com/argoproj/argo-cd/v2/common"
"github.com/argoproj/argo-cd/v2/util/db"
@@ -50,6 +54,7 @@ import (
argov1alpha1 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
appclientset "github.com/argoproj/argo-cd/v2/pkg/client/clientset/versioned"
argoutil "github.com/argoproj/argo-cd/v2/util/argo"
"github.com/argoproj/argo-cd/v2/util/argo/normalizers"
"github.com/argoproj/argo-cd/v2/pkg/apis/application"
)
@@ -62,12 +67,10 @@ const (
ReconcileRequeueOnValidationError = time.Minute * 3
)
var (
defaultPreservedAnnotations = []string{
NotifiedAnnotationKey,
argov1alpha1.AnnotationKeyRefresh,
}
)
var defaultPreservedAnnotations = []string{
NotifiedAnnotationKey,
argov1alpha1.AnnotationKeyRefresh,
}
// ApplicationSetReconciler reconciles a ApplicationSet object
type ApplicationSetReconciler struct {
@@ -108,36 +111,43 @@ func (r *ApplicationSetReconciler) Reconcile(ctx context.Context, req ctrl.Reque
// Do not attempt to further reconcile the ApplicationSet if it is being deleted.
if applicationSetInfo.ObjectMeta.DeletionTimestamp != nil {
appsetName := applicationSetInfo.ObjectMeta.Name
logCtx.Debugf("DeletionTimestamp is set on %s", appsetName)
deleteAllowed := utils.DefaultPolicy(applicationSetInfo.Spec.SyncPolicy, r.Policy, r.EnablePolicyOverride).AllowDelete()
if !deleteAllowed {
logCtx.Debugf("ApplicationSet policy does not allow to delete")
if err := r.removeOwnerReferencesOnDeleteAppSet(ctx, applicationSetInfo); err != nil {
return ctrl.Result{}, err
}
controllerutil.RemoveFinalizer(&applicationSetInfo, argov1alpha1.ResourcesFinalizerName)
if err := r.Update(ctx, &applicationSetInfo); err != nil {
return ctrl.Result{}, err
}
logCtx.Debugf("ownerReferences referring %s is deleted from generated applications", appsetName)
}
controllerutil.RemoveFinalizer(&applicationSetInfo, argov1alpha1.ResourcesFinalizerName)
if err := r.Update(ctx, &applicationSetInfo); err != nil {
return ctrl.Result{}, err
}
return ctrl.Result{}, nil
}
if err := r.migrateStatus(ctx, &applicationSetInfo); err != nil {
logCtx.Errorf("failed to migrate status subresource %v", err)
return ctrl.Result{}, err
}
// Log a warning if there are unrecognized generators
_ = utils.CheckInvalidGenerators(&applicationSetInfo)
// desiredApplications is the main list of all expected Applications from all generators in this appset.
desiredApplications, applicationSetReason, generatorsErr := r.generateApplications(logCtx, applicationSetInfo)
if generatorsErr != nil {
desiredApplications, applicationSetReason, err := template.GenerateApplications(logCtx, applicationSetInfo, r.Generators, r.Renderer, r.Client)
if err != nil {
_ = r.setApplicationSetStatusCondition(ctx,
&applicationSetInfo,
argov1alpha1.ApplicationSetCondition{
Type: argov1alpha1.ApplicationSetConditionErrorOccurred,
Message: generatorsErr.Error(),
Message: err.Error(),
Reason: string(applicationSetReason),
Status: argov1alpha1.ApplicationSetConditionStatusTrue,
}, parametersGenerated,
)
if len(desiredApplications) < 1 {
return ctrl.Result{}, generatorsErr
}
return ctrl.Result{RequeueAfter: ReconcileRequeueOnValidationError}, err
}
parametersGenerated = true
@@ -165,6 +175,16 @@ func (r *ApplicationSetReconciler) Reconcile(ctx context.Context, req ctrl.Reque
return ctrl.Result{RequeueAfter: ReconcileRequeueOnValidationError}, nil
}
currentApplications, err := r.getCurrentApplications(ctx, applicationSetInfo)
if err != nil {
return ctrl.Result{}, fmt.Errorf("failed to get current applications for application set: %w", err)
}
err = r.updateResourcesStatus(ctx, logCtx, &applicationSetInfo, currentApplications)
if err != nil {
return ctrl.Result{}, fmt.Errorf("failed to get update resources status for application set: %w", err)
}
// appMap is a name->app collection of Applications in this ApplicationSet.
appMap := map[string]argov1alpha1.Application{}
// appSyncMap tracks which apps will be synced during this reconciliation.
@@ -181,16 +201,11 @@ func (r *ApplicationSetReconciler) Reconcile(ctx context.Context, req ctrl.Reque
}
} else if applicationSetInfo.Spec.Strategy != nil {
// appset uses progressive sync
applications, err := r.getCurrentApplications(ctx, applicationSetInfo)
if err != nil {
return ctrl.Result{}, fmt.Errorf("failed to get current applications for application set: %w", err)
}
for _, app := range applications {
for _, app := range currentApplications {
appMap[app.Name] = app
}
appSyncMap, err = r.performProgressiveSyncs(ctx, logCtx, applicationSetInfo, applications, desiredApplications, appMap)
appSyncMap, err = r.performProgressiveSyncs(ctx, logCtx, applicationSetInfo, currentApplications, desiredApplications, appMap)
if err != nil {
return ctrl.Result{}, fmt.Errorf("failed to perform progressive sync reconciliation for application set: %w", err)
}
@@ -229,7 +244,6 @@ func (r *ApplicationSetReconciler) Reconcile(ctx context.Context, req ctrl.Reque
// trigger appropriate application syncs if RollingSync strategy is enabled
if progressiveSyncsStrategyEnabled(&applicationSetInfo, "RollingSync") {
validApps, err = r.syncValidApplications(logCtx, &applicationSetInfo, appSyncMap, appMap, validApps)
if err != nil {
_ = r.setApplicationSetStatusCondition(ctx,
&applicationSetInfo,
@@ -311,7 +325,7 @@ func (r *ApplicationSetReconciler) Reconcile(ctx context.Context, req ctrl.Reque
requeueAfter := r.getMinRequeueAfter(&applicationSetInfo)
if len(validateErrors) == 0 && generatorsErr == nil {
if len(validateErrors) == 0 {
if err := r.setApplicationSetStatusCondition(ctx,
&applicationSetInfo,
argov1alpha1.ApplicationSetCondition{
@@ -420,7 +434,7 @@ func (r *ApplicationSetReconciler) setApplicationSetStatusCondition(ctx context.
if client.IgnoreNotFound(err) != nil {
return nil
}
return fmt.Errorf("error fetching updated application set: %v", err)
return fmt.Errorf("error fetching updated application set: %w", err)
}
applicationSet.Status.SetConditions(
@@ -430,7 +444,7 @@ func (r *ApplicationSetReconciler) setApplicationSetStatusCondition(ctx context.
// Update the newly fetched object with new set of conditions
err := r.Client.Status().Update(ctx, applicationSet)
if err != nil && !apierr.IsNotFound(err) {
return fmt.Errorf("unable to set application set condition: %v", err)
return fmt.Errorf("unable to set application set condition: %w", err)
}
}
@@ -443,7 +457,6 @@ func (r *ApplicationSetReconciler) validateGeneratedApplications(ctx context.Con
errorsByIndex := map[int]error{}
namesSet := map[string]bool{}
for i, app := range desiredApplications {
if !namesSet[app.Name] {
namesSet[app.Name] = true
} else {
@@ -463,7 +476,6 @@ func (r *ApplicationSetReconciler) validateGeneratedApplications(ctx context.Con
errorsByIndex[i] = fmt.Errorf("application destination spec is invalid: %s", err.Error())
continue
}
}
return errorsByIndex, nil
@@ -472,7 +484,6 @@ func (r *ApplicationSetReconciler) validateGeneratedApplications(ctx context.Con
func (r *ApplicationSetReconciler) getMinRequeueAfter(applicationSetInfo *argov1alpha1.ApplicationSet) time.Duration {
var res time.Duration
for _, requestedGenerator := range applicationSetInfo.Spec.Generators {
relevantGenerators := generators.GetRelevantGenerators(&requestedGenerator, r.Generators)
for _, g := range relevantGenerators {
@@ -489,91 +500,6 @@ func (r *ApplicationSetReconciler) getMinRequeueAfter(applicationSetInfo *argov1
return res
}
func getTempApplication(applicationSetTemplate argov1alpha1.ApplicationSetTemplate) *argov1alpha1.Application {
var tmplApplication argov1alpha1.Application
tmplApplication.Annotations = applicationSetTemplate.Annotations
tmplApplication.Labels = applicationSetTemplate.Labels
tmplApplication.Namespace = applicationSetTemplate.Namespace
tmplApplication.Name = applicationSetTemplate.Name
tmplApplication.Spec = applicationSetTemplate.Spec
tmplApplication.Finalizers = applicationSetTemplate.Finalizers
return &tmplApplication
}
func (r *ApplicationSetReconciler) generateApplications(logCtx *log.Entry, applicationSetInfo argov1alpha1.ApplicationSet) ([]argov1alpha1.Application, argov1alpha1.ApplicationSetReasonType, error) {
var res []argov1alpha1.Application
var firstError error
var applicationSetReason argov1alpha1.ApplicationSetReasonType
for _, requestedGenerator := range applicationSetInfo.Spec.Generators {
t, err := generators.Transform(requestedGenerator, r.Generators, applicationSetInfo.Spec.Template, &applicationSetInfo, map[string]interface{}{})
if err != nil {
logCtx.WithError(err).WithField("generator", requestedGenerator).
Error("error generating application from params")
if firstError == nil {
firstError = err
applicationSetReason = argov1alpha1.ApplicationSetReasonApplicationParamsGenerationError
}
continue
}
for _, a := range t {
tmplApplication := getTempApplication(a.Template)
for _, p := range a.Params {
app, err := r.Renderer.RenderTemplateParams(tmplApplication, applicationSetInfo.Spec.SyncPolicy, p, applicationSetInfo.Spec.GoTemplate, applicationSetInfo.Spec.GoTemplateOptions)
if err != nil {
logCtx.WithError(err).WithField("params", a.Params).WithField("generator", requestedGenerator).
Error("error generating application from params")
if firstError == nil {
firstError = err
applicationSetReason = argov1alpha1.ApplicationSetReasonRenderTemplateParamsError
}
continue
}
if applicationSetInfo.Spec.TemplatePatch != nil {
patchedApplication, err := r.applyTemplatePatch(app, applicationSetInfo, p)
if err != nil {
log.WithError(err).WithField("params", a.Params).WithField("generator", requestedGenerator).
Error("error generating application from params")
if firstError == nil {
firstError = err
applicationSetReason = argov1alpha1.ApplicationSetReasonRenderTemplateParamsError
}
continue
}
app = patchedApplication
}
res = append(res, *app)
}
}
logCtx.WithField("generator", requestedGenerator).Infof("generated %d applications", len(res))
logCtx.WithField("generator", requestedGenerator).Debugf("apps from generator: %+v", res)
}
return res, applicationSetReason, firstError
}
func (r *ApplicationSetReconciler) applyTemplatePatch(app *argov1alpha1.Application, applicationSetInfo argov1alpha1.ApplicationSet, params map[string]interface{}) (*argov1alpha1.Application, error) {
replacedTemplate, err := r.Renderer.Replace(*applicationSetInfo.Spec.TemplatePatch, params, applicationSetInfo.Spec.GoTemplate, applicationSetInfo.Spec.GoTemplateOptions)
if err != nil {
return nil, fmt.Errorf("error replacing values in templatePatch: %w", err)
}
return applyTemplatePatch(app, replacedTemplate)
}
func ignoreNotAllowedNamespaces(namespaces []string) predicate.Predicate {
return predicate.Funcs{
CreateFunc: func(e event.CreateEvent) bool {
@@ -611,7 +537,7 @@ func (r *ApplicationSetReconciler) SetupWithManager(mgr ctrl.Manager, enableProg
Owns(&argov1alpha1.Application{}, builder.WithPredicates(ownsHandler)).
WithEventFilter(ignoreNotAllowedNamespaces(r.ApplicationSetNamespaces)).
Watches(
&source.Kind{Type: &corev1.Secret{}},
&corev1.Secret{},
&clusterSecretEventHandler{
Client: mgr.GetClient(),
Log: log.WithField("type", "createSecretEventHandler"),
@@ -644,14 +570,9 @@ func (r *ApplicationSetReconciler) updateCache(ctx context.Context, obj client.O
// - For existing application, it will call update
// The function also adds owner reference to all applications, and uses it to delete them.
func (r *ApplicationSetReconciler) createOrUpdateInCluster(ctx context.Context, logCtx *log.Entry, applicationSet argov1alpha1.ApplicationSet, desiredApplications []argov1alpha1.Application) error {
var firstError error
// Creates or updates the application in appList
for _, generatedApp := range desiredApplications {
// The app's namespace must be the same as the AppSet's namespace to preserve the appsets-in-any-namespace
// security boundary.
generatedApp.Namespace = applicationSet.Namespace
appLog := logCtx.WithFields(log.Fields{"app": generatedApp.QualifiedName()})
// Normalize to avoid fighting with the application controller.
@@ -668,7 +589,7 @@ func (r *ApplicationSetReconciler) createOrUpdateInCluster(ctx context.Context,
},
}
action, err := utils.CreateOrUpdate(ctx, appLog, r.Client, applicationSet.Spec.IgnoreApplicationDifferences, found, func() error {
action, err := utils.CreateOrUpdate(ctx, appLog, r.Client, applicationSet.Spec.IgnoreApplicationDifferences, normalizers.IgnoreNormalizerOpts{}, found, func() error {
// Copy only the Application/ObjectMeta fields that are significant, from the generatedApp
found.Spec = generatedApp.Spec
@@ -716,6 +637,17 @@ func (r *ApplicationSetReconciler) createOrUpdateInCluster(ctx context.Context,
}
}
// Preserve post-delete finalizers:
// https://github.com/argoproj/argo-cd/issues/17181
for _, finalizer := range found.ObjectMeta.Finalizers {
if strings.HasPrefix(finalizer, argov1alpha1.PostDeleteFinalizerName) {
if generatedApp.Finalizers == nil {
generatedApp.Finalizers = []string{}
}
generatedApp.Finalizers = append(generatedApp.Finalizers, finalizer)
}
}
found.ObjectMeta.Annotations = generatedApp.Annotations
found.ObjectMeta.Finalizers = generatedApp.Finalizers
@@ -723,7 +655,6 @@ func (r *ApplicationSetReconciler) createOrUpdateInCluster(ctx context.Context,
return controllerutil.SetControllerReference(&applicationSet, found, r.Scheme)
})
if err != nil {
appLog.WithError(err).WithField("action", action).Errorf("failed to %s Application", action)
if firstError == nil {
@@ -749,7 +680,6 @@ func (r *ApplicationSetReconciler) createOrUpdateInCluster(ctx context.Context,
// createInCluster will filter from the desiredApplications only the application that needs to be created
// Then it will call createOrUpdateInCluster to do the actual create
func (r *ApplicationSetReconciler) createInCluster(ctx context.Context, logCtx *log.Entry, applicationSet argov1alpha1.ApplicationSet, desiredApplications []argov1alpha1.Application) error {
var createApps []argov1alpha1.Application
current, err := r.getCurrentApplications(ctx, applicationSet)
if err != nil {
@@ -777,7 +707,6 @@ func (r *ApplicationSetReconciler) createInCluster(ctx context.Context, logCtx *
func (r *ApplicationSetReconciler) getCurrentApplications(ctx context.Context, applicationSet argov1alpha1.ApplicationSet) ([]argov1alpha1.Application, error) {
var current argov1alpha1.ApplicationList
err := r.Client.List(ctx, &current, client.MatchingFields{".metadata.controller": applicationSet.Name}, client.InNamespace(applicationSet.Namespace))
if err != nil {
return nil, fmt.Errorf("error retrieving applications: %w", err)
}
@@ -815,7 +744,6 @@ func (r *ApplicationSetReconciler) deleteInCluster(ctx context.Context, logCtx *
_, exists := m[app.Name]
if !exists {
// Removes the Argo CD resources finalizer if the application contains an invalid target (eg missing cluster)
err := r.removeFinalizerOnInvalidDestination(ctx, applicationSet, &app, clusterList, logCtx)
if err != nil {
@@ -843,7 +771,6 @@ func (r *ApplicationSetReconciler) deleteInCluster(ctx context.Context, logCtx *
// removeFinalizerOnInvalidDestination removes the Argo CD resources finalizer if the application contains an invalid target (eg missing cluster)
func (r *ApplicationSetReconciler) removeFinalizerOnInvalidDestination(ctx context.Context, applicationSet argov1alpha1.ApplicationSet, app *argov1alpha1.Application, clusterList *argov1alpha1.ClusterList, appLog *log.Entry) error {
// Only check if the finalizers need to be removed IF there are finalizers to remove
if len(app.Finalizers) == 0 {
return nil
@@ -856,12 +783,10 @@ func (r *ApplicationSetReconciler) removeFinalizerOnInvalidDestination(ctx conte
appLog.Warnf("The destination cluster for %s couldn't be found: %v", app.Name, err)
validDestination = false
} else {
// Detect if the destination's server field does not match an existing cluster
matchingCluster := false
for _, cluster := range clusterList.Items {
// Server fields must match. Note that ValidateDestination ensures that the server field is set, if applicable.
if app.Spec.Destination.Server != cluster.Server {
continue
@@ -885,7 +810,6 @@ func (r *ApplicationSetReconciler) removeFinalizerOnInvalidDestination(ctx conte
// If the destination is invalid (for example the cluster is no longer defined), then remove
// the application finalizers to avoid triggering Argo CD bug #5817
if !validDestination {
// Filter out the Argo CD finalizer from the finalizer list
var newFinalizers []string
for _, existingFinalizer := range app.Finalizers {
@@ -920,14 +844,14 @@ func (r *ApplicationSetReconciler) removeFinalizerOnInvalidDestination(ctx conte
func (r *ApplicationSetReconciler) removeOwnerReferencesOnDeleteAppSet(ctx context.Context, applicationSet argov1alpha1.ApplicationSet) error {
applications, err := r.getCurrentApplications(ctx, applicationSet)
if err != nil {
return err
return fmt.Errorf("error getting current applications for ApplicationSet: %w", err)
}
for _, app := range applications {
app.SetOwnerReferences([]metav1.OwnerReference{})
err := r.Client.Update(ctx, &app)
if err != nil {
return err
return fmt.Errorf("error updating application: %w", err)
}
}
@@ -935,7 +859,6 @@ func (r *ApplicationSetReconciler) removeOwnerReferencesOnDeleteAppSet(ctx conte
}
func (r *ApplicationSetReconciler) performProgressiveSyncs(ctx context.Context, logCtx *log.Entry, appset argov1alpha1.ApplicationSet, applications []argov1alpha1.Application, desiredApplications []argov1alpha1.Application, appMap map[string]argov1alpha1.Application) (map[string]bool, error) {
appDependencyList, appStepMap, err := r.buildAppDependencyList(logCtx, appset, desiredApplications)
if err != nil {
return nil, fmt.Errorf("failed to build app dependency list: %w", err)
@@ -973,7 +896,6 @@ func (r *ApplicationSetReconciler) performProgressiveSyncs(ctx context.Context,
// this list tracks which Applications belong to each RollingUpdate step
func (r *ApplicationSetReconciler) buildAppDependencyList(logCtx *log.Entry, applicationSet argov1alpha1.ApplicationSet, applications []argov1alpha1.Application) ([][]string, map[string]int, error) {
if applicationSet.Spec.Strategy == nil || applicationSet.Spec.Strategy.Type == "" || applicationSet.Spec.Strategy.Type == "AllAtOnce" {
return [][]string{}, map[string]int{}, nil
}
@@ -993,11 +915,9 @@ func (r *ApplicationSetReconciler) buildAppDependencyList(logCtx *log.Entry, app
// use applicationLabelSelectors to filter generated Applications into steps and status by name
for _, app := range applications {
for i, step := range steps {
selected := true // default to true, assuming the current Application is a match for the given step matchExpression
for _, matchExpression := range step.MatchExpressions {
if val, ok := app.Labels[matchExpression.Key]; ok {
valueMatched := labelMatchedExpression(logCtx, val, matchExpression)
@@ -1061,7 +981,6 @@ func (r *ApplicationSetReconciler) buildAppSyncMap(ctx context.Context, applicat
// detect if we need to halt before progressing to the next step
for _, appName := range appDependencyList[i] {
idx := findApplicationStatusIndex(applicationSet.Status.ApplicationStatus, appName)
if idx == -1 {
// no Application status found, likely because the Application is being newly created
@@ -1072,7 +991,6 @@ func (r *ApplicationSetReconciler) buildAppSyncMap(ctx context.Context, applicat
appStatus := applicationSet.Status.ApplicationStatus[idx]
if app, ok := appMap[appName]; ok {
syncEnabled = appSyncEnabledForNextStep(&applicationSet, app, appStatus)
if !syncEnabled {
break
@@ -1089,7 +1007,6 @@ func (r *ApplicationSetReconciler) buildAppSyncMap(ctx context.Context, applicat
}
func appSyncEnabledForNextStep(appset *argov1alpha1.ApplicationSet, app argov1alpha1.Application, appStatus argov1alpha1.ApplicationSetApplicationStatus) bool {
if progressiveSyncsStrategyEnabled(appset, "RollingSync") {
// we still need to complete the current step if the Application is not yet Healthy or there are still pending Application changes
return isApplicationHealthy(app) && appStatus.Status == "Healthy"
@@ -1132,12 +1049,10 @@ func statusStrings(app argov1alpha1.Application) (string, string, string) {
// check the status of each Application's status and promote Applications to the next status if needed
func (r *ApplicationSetReconciler) updateApplicationSetApplicationStatus(ctx context.Context, logCtx *log.Entry, applicationSet *argov1alpha1.ApplicationSet, applications []argov1alpha1.Application, appStepMap map[string]int) ([]argov1alpha1.ApplicationSetApplicationStatus, error) {
now := metav1.Now()
appStatuses := make([]argov1alpha1.ApplicationSetApplicationStatus, 0, len(applications))
for _, app := range applications {
healthStatusString, syncStatusString, operationPhaseString := statusStrings(app)
idx := findApplicationStatusIndex(applicationSet.Status.ApplicationStatus, app.Name)
@@ -1152,10 +1067,18 @@ func (r *ApplicationSetReconciler) updateApplicationSetApplicationStatus(ctx con
Message: "No Application status found, defaulting status to Waiting.",
Status: "Waiting",
Step: fmt.Sprint(appStepMap[app.Name] + 1),
TargetRevisions: app.Status.GetRevisions(),
}
} else {
// we have an existing AppStatus
currentAppStatus = applicationSet.Status.ApplicationStatus[idx]
// upgrade any existing AppStatus that might have been set by an older argo-cd version
// note: currentAppStatus.TargetRevisions may be set to empty list earlier during migrations,
// to prevent other usage of r.Client.Status().Update to fail before reaching here.
if currentAppStatus.TargetRevisions == nil || len(currentAppStatus.TargetRevisions) == 0 {
currentAppStatus.TargetRevisions = app.Status.GetRevisions()
}
}
appOutdated := false
@@ -1169,20 +1092,25 @@ func (r *ApplicationSetReconciler) updateApplicationSetApplicationStatus(ctx con
currentAppStatus.Status = "Waiting"
currentAppStatus.Message = "Application has pending changes, setting status to Waiting."
currentAppStatus.Step = fmt.Sprint(appStepMap[currentAppStatus.Application] + 1)
currentAppStatus.TargetRevisions = app.Status.GetRevisions()
}
if currentAppStatus.Status == "Pending" {
// check for successful syncs started less than 10s before the Application transitioned to Pending
// this covers race conditions where syncs initiated by RollingSync miraculously have a sync time before the transition to Pending state occurred (could be a few seconds)
if operationPhaseString == "Succeeded" && app.Status.OperationState.StartedAt.Add(time.Duration(10)*time.Second).After(currentAppStatus.LastTransitionTime.Time) {
if !app.Status.OperationState.StartedAt.After(currentAppStatus.LastTransitionTime.Time) {
logCtx.Warnf("Application %v was synced less than 10s prior to entering Pending status, we'll assume the AppSet controller triggered this sync and update its status to Progressing", app.Name)
if operationPhaseString == "Succeeded" {
revisions := []string{}
if len(app.Status.OperationState.SyncResult.Revisions) > 0 {
revisions = app.Status.OperationState.SyncResult.Revisions
} else if app.Status.OperationState.SyncResult.Revision != "" {
revisions = append(revisions, app.Status.OperationState.SyncResult.Revision)
}
if reflect.DeepEqual(currentAppStatus.TargetRevisions, revisions) {
logCtx.Infof("Application %v has completed a sync successfully, updating its ApplicationSet status to Progressing", app.Name)
currentAppStatus.LastTransitionTime = &now
currentAppStatus.Status = "Progressing"
currentAppStatus.Message = "Application resource completed a sync successfully, updating status from Pending to Progressing."
currentAppStatus.Step = fmt.Sprint(appStepMap[currentAppStatus.Application] + 1)
}
logCtx.Infof("Application %v has completed a sync successfully, updating its ApplicationSet status to Progressing", app.Name)
currentAppStatus.LastTransitionTime = &now
currentAppStatus.Status = "Progressing"
currentAppStatus.Message = "Application resource completed a sync successfully, updating status from Pending to Progressing."
currentAppStatus.Step = fmt.Sprint(appStepMap[currentAppStatus.Application] + 1)
} else if operationPhaseString == "Running" || healthStatusString == "Progressing" {
logCtx.Infof("Application %v has entered Progressing status, updating its ApplicationSet status to Progressing", app.Name)
currentAppStatus.LastTransitionTime = &now
@@ -1251,7 +1179,6 @@ func (r *ApplicationSetReconciler) updateApplicationSetApplicationStatusProgress
}
for _, appStatus := range applicationSet.Status.ApplicationStatus {
maxUpdateAllowed := true
maxUpdate := &intstr.IntOrString{}
if progressiveSyncsStrategyEnabled(applicationSet, "RollingSync") {
@@ -1274,7 +1201,6 @@ func (r *ApplicationSetReconciler) updateApplicationSetApplicationStatusProgress
maxUpdateAllowed = false
logCtx.Infof("Application %v is not allowed to update yet, %v/%v Applications already updating in step %v in AppSet %v", appStatus.Application, updateCountMap[appStepMap[appStatus.Application]], maxUpdateVal, appStepMap[appStatus.Application]+1, applicationSet.Name)
}
}
if appStatus.Status == "Waiting" && appSyncMap[appStatus.Application] && maxUpdateAllowed {
@@ -1300,7 +1226,6 @@ func (r *ApplicationSetReconciler) updateApplicationSetApplicationStatusProgress
}
func (r *ApplicationSetReconciler) updateApplicationSetApplicationStatusConditions(ctx context.Context, applicationSet *argov1alpha1.ApplicationSet) ([]argov1alpha1.ApplicationSetCondition, error) {
appSetProgressing := false
for _, appStatus := range applicationSet.Status.ApplicationStatus {
if appStatus.Status != "Healthy" {
@@ -1351,7 +1276,55 @@ func findApplicationStatusIndex(appStatuses []argov1alpha1.ApplicationSetApplica
return -1
}
// setApplicationSetApplicationStatus updates the ApplicatonSet's status field
// migrateStatus run migrations on the status subresource of ApplicationSet early during the run of ApplicationSetReconciler.Reconcile
// this handles any defaulting of values - which would otherwise cause the references to r.Client.Status().Update to fail given missing required fields.
func (r *ApplicationSetReconciler) migrateStatus(ctx context.Context, appset *argov1alpha1.ApplicationSet) error {
update := false
if statusList := appset.Status.ApplicationStatus; statusList != nil {
for idx := range statusList {
if statusList[idx].TargetRevisions == nil {
statusList[idx].TargetRevisions = []string{}
update = true
}
}
}
if update {
if err := r.Client.Status().Update(ctx, appset); err != nil {
return fmt.Errorf("unable to set application set status: %w", err)
}
}
return nil
}
func (r *ApplicationSetReconciler) updateResourcesStatus(ctx context.Context, logCtx *log.Entry, appset *argov1alpha1.ApplicationSet, apps []argov1alpha1.Application) error {
statusMap := status.GetResourceStatusMap(appset)
statusMap = status.BuildResourceStatus(statusMap, apps)
statuses := []argov1alpha1.ResourceStatus{}
for _, status := range statusMap {
statuses = append(statuses, status)
}
appset.Status.Resources = statuses
namespacedName := types.NamespacedName{Namespace: appset.Namespace, Name: appset.Name}
err := r.Client.Status().Update(ctx, appset)
if err != nil {
logCtx.Errorf("unable to set application set status: %v", err)
return fmt.Errorf("unable to set application set status: %w", err)
}
if err := r.Get(ctx, namespacedName, appset); err != nil {
if client.IgnoreNotFound(err) != nil {
return nil
}
return fmt.Errorf("error fetching updated application set: %w", err)
}
return nil
}
// setAppSetApplicationStatus updates the ApplicationSet's status field
// with any new/changed Application statuses.
func (r *ApplicationSetReconciler) setAppSetApplicationStatus(ctx context.Context, logCtx *log.Entry, applicationSet *argov1alpha1.ApplicationSet, applicationStatuses []argov1alpha1.ApplicationSetApplicationStatus) error {
needToUpdateStatus := false
@@ -1386,16 +1359,15 @@ func (r *ApplicationSetReconciler) setAppSetApplicationStatus(ctx context.Contex
// Update the newly fetched object with new set of ApplicationStatus
err := r.Client.Status().Update(ctx, applicationSet)
if err != nil {
logCtx.Errorf("unable to set application set status: %v", err)
return fmt.Errorf("unable to set application set status: %v", err)
return fmt.Errorf("unable to set application set status: %w", err)
}
if err := r.Get(ctx, namespacedName, applicationSet); err != nil {
if client.IgnoreNotFound(err) != nil {
return nil
}
return fmt.Errorf("error fetching updated application set: %v", err)
return fmt.Errorf("error fetching updated application set: %w", err)
}
}
@@ -1432,7 +1404,6 @@ func (r *ApplicationSetReconciler) syncValidApplications(logCtx *log.Entry, appl
// used by the RollingSync Progressive Sync strategy to trigger a sync of a particular Application resource
func syncApplication(application argov1alpha1.Application, prune bool) (argov1alpha1.Application, error) {
operation := argov1alpha1.Operation{
InitiatedBy: argov1alpha1.OperationInitiator{
Username: "applicationset-controller",
@@ -1528,10 +1499,13 @@ func shouldRequeueApplicationSet(appOld *argov1alpha1.Application, appNew *argov
}
// the applicationset controller owns the application spec, labels, annotations, and finalizers on the applications
if !reflect.DeepEqual(appOld.Spec, appNew.Spec) ||
!reflect.DeepEqual(appOld.ObjectMeta.GetAnnotations(), appNew.ObjectMeta.GetAnnotations()) ||
!reflect.DeepEqual(appOld.ObjectMeta.GetLabels(), appNew.ObjectMeta.GetLabels()) ||
!reflect.DeepEqual(appOld.ObjectMeta.GetFinalizers(), appNew.ObjectMeta.GetFinalizers()) {
// reflect.DeepEqual considers nil slices/maps not equal to empty slices/maps
// https://pkg.go.dev/reflect#DeepEqual
// ApplicationDestination has an unexported field so we can just use the == for comparison
if !cmp.Equal(appOld.Spec, appNew.Spec, cmpopts.EquateEmpty(), cmpopts.EquateComparable(argov1alpha1.ApplicationDestination{})) ||
!cmp.Equal(appOld.ObjectMeta.GetAnnotations(), appNew.ObjectMeta.GetAnnotations(), cmpopts.EquateEmpty()) ||
!cmp.Equal(appOld.ObjectMeta.GetLabels(), appNew.ObjectMeta.GetLabels(), cmpopts.EquateEmpty()) ||
!cmp.Equal(appOld.ObjectMeta.GetFinalizers(), appNew.ObjectMeta.GetFinalizers(), cmpopts.EquateEmpty()) {
return true
}

File diff suppressed because it is too large Load Diff

View File

@@ -19,25 +19,25 @@ import (
// clusterSecretEventHandler is used when watching Secrets to check if they are ArgoCD Cluster Secrets, and if so
// requeue any related ApplicationSets.
type clusterSecretEventHandler struct {
//handler.EnqueueRequestForOwner
// handler.EnqueueRequestForOwner
Log log.FieldLogger
Client client.Client
}
func (h *clusterSecretEventHandler) Create(e event.CreateEvent, q workqueue.RateLimitingInterface) {
h.queueRelatedAppGenerators(q, e.Object)
func (h *clusterSecretEventHandler) Create(ctx context.Context, e event.CreateEvent, q workqueue.RateLimitingInterface) {
h.queueRelatedAppGenerators(ctx, q, e.Object)
}
func (h *clusterSecretEventHandler) Update(e event.UpdateEvent, q workqueue.RateLimitingInterface) {
h.queueRelatedAppGenerators(q, e.ObjectNew)
func (h *clusterSecretEventHandler) Update(ctx context.Context, e event.UpdateEvent, q workqueue.RateLimitingInterface) {
h.queueRelatedAppGenerators(ctx, q, e.ObjectNew)
}
func (h *clusterSecretEventHandler) Delete(e event.DeleteEvent, q workqueue.RateLimitingInterface) {
h.queueRelatedAppGenerators(q, e.Object)
func (h *clusterSecretEventHandler) Delete(ctx context.Context, e event.DeleteEvent, q workqueue.RateLimitingInterface) {
h.queueRelatedAppGenerators(ctx, q, e.Object)
}
func (h *clusterSecretEventHandler) Generic(e event.GenericEvent, q workqueue.RateLimitingInterface) {
h.queueRelatedAppGenerators(q, e.Object)
func (h *clusterSecretEventHandler) Generic(ctx context.Context, e event.GenericEvent, q workqueue.RateLimitingInterface) {
h.queueRelatedAppGenerators(ctx, q, e.Object)
}
// addRateLimitingInterface defines the Add method of workqueue.RateLimitingInterface, allow us to easily mock
@@ -46,7 +46,7 @@ type addRateLimitingInterface interface {
Add(item interface{})
}
func (h *clusterSecretEventHandler) queueRelatedAppGenerators(q addRateLimitingInterface, object client.Object) {
func (h *clusterSecretEventHandler) queueRelatedAppGenerators(ctx context.Context, q addRateLimitingInterface, object client.Object) {
// Check for label, lookup all ApplicationSets that might match the cluster, queue them all
if object.GetLabels()[generators.ArgoCDSecretTypeLabel] != generators.ArgoCDSecretTypeCluster {
return
@@ -58,7 +58,7 @@ func (h *clusterSecretEventHandler) queueRelatedAppGenerators(q addRateLimitingI
}).Info("processing event for cluster secret")
appSetList := &argoprojiov1alpha1.ApplicationSetList{}
err := h.Client.List(context.Background(), appSetList)
err := h.Client.List(ctx, appSetList)
if err != nil {
h.Log.WithError(err).Error("unable to list ApplicationSets")
return
@@ -66,7 +66,6 @@ func (h *clusterSecretEventHandler) queueRelatedAppGenerators(q addRateLimitingI
h.Log.WithField("count", len(appSetList.Items)).Info("listed ApplicationSets")
for _, appSet := range appSetList.Items {
foundClusterGenerator := false
for _, generator := range appSet.Spec.Generators {
if generator.Clusters != nil {
@@ -109,7 +108,6 @@ func (h *clusterSecretEventHandler) queueRelatedAppGenerators(q addRateLimitingI
}
}
if foundClusterGenerator {
// TODO: only queue the AppGenerator if the labels match this cluster
req := ctrl.Request{NamespacedName: types.NamespacedName{Namespace: appSet.Namespace, Name: appSet.Name}}
q.Add(req)

View File

@@ -1,10 +1,12 @@
package controllers
import (
"context"
"testing"
log "github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
corev1 "k8s.io/api/core/v1"
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -19,13 +21,12 @@ import (
)
func TestClusterEventHandler(t *testing.T) {
scheme := runtime.NewScheme()
err := argov1alpha1.AddToScheme(scheme)
assert.Nil(t, err)
require.NoError(t, err)
err = argov1alpha1.AddToScheme(scheme)
assert.Nil(t, err)
require.NoError(t, err)
tests := []struct {
name string
@@ -534,9 +535,7 @@ func TestClusterEventHandler(t *testing.T) {
}
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
appSetList := argov1alpha1.ApplicationSetList{
Items: test.items,
}
@@ -550,14 +549,12 @@ func TestClusterEventHandler(t *testing.T) {
mockAddRateLimitingInterface := mockAddRateLimitingInterface{}
handler.queueRelatedAppGenerators(&mockAddRateLimitingInterface, &test.secret)
handler.queueRelatedAppGenerators(context.Background(), &mockAddRateLimitingInterface, &test.secret)
assert.False(t, mockAddRateLimitingInterface.errorOccurred)
assert.ElementsMatch(t, mockAddRateLimitingInterface.addedItems, test.expectedRequests)
})
}
}
// Add checks the type, and adds it to the internal list of received additions
@@ -581,7 +578,7 @@ func TestNestedGeneratorHasClusterGenerator_NestedClusterGenerator(t *testing.T)
hasClusterGenerator, err := nestedGeneratorHasClusterGenerator(nested)
assert.Nil(t, err)
require.NoError(t, err)
assert.True(t, hasClusterGenerator)
}
@@ -608,7 +605,7 @@ func TestNestedGeneratorHasClusterGenerator_NestedMergeGenerator(t *testing.T) {
hasClusterGenerator, err := nestedGeneratorHasClusterGenerator(nested)
assert.Nil(t, err)
require.NoError(t, err)
assert.True(t, hasClusterGenerator)
}
@@ -635,6 +632,6 @@ func TestNestedGeneratorHasClusterGenerator_NestedMergeGeneratorWithInvalidJSON(
hasClusterGenerator, err := nestedGeneratorHasClusterGenerator(nested)
assert.NotNil(t, err)
require.Error(t, err)
assert.False(t, hasClusterGenerator)
}

View File

@@ -6,6 +6,7 @@ import (
"time"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
@@ -25,7 +26,7 @@ func TestRequeueAfter(t *testing.T) {
ctx := context.Background()
scheme := runtime.NewScheme()
err := argov1alpha1.AddToScheme(scheme)
assert.Nil(t, err)
require.NoError(t, err)
gvrToListKind := map[schema.GroupVersionResource]string{{
Group: "mallard.io",
Version: "v1",
@@ -55,14 +56,14 @@ func TestRequeueAfter(t *testing.T) {
},
}
fakeDynClient := dynfake.NewSimpleDynamicClientWithCustomListKinds(runtime.NewScheme(), gvrToListKind, duckType)
scmConfig := generators.NewSCMConfig("", []string{""}, true, nil)
terminalGenerators := map[string]generators.Generator{
"List": generators.NewListGenerator(),
"Clusters": generators.NewClusterGenerator(k8sClient, ctx, appClientset, "argocd"),
"Git": generators.NewGitGenerator(mockServer),
"SCMProvider": generators.NewSCMProviderGenerator(fake.NewClientBuilder().WithObjects(&corev1.Secret{}).Build(), generators.SCMAuthProviders{}, "", []string{""}, true),
"SCMProvider": generators.NewSCMProviderGenerator(fake.NewClientBuilder().WithObjects(&corev1.Secret{}).Build(), scmConfig),
"ClusterDecisionResource": generators.NewDuckTypeGenerator(ctx, fakeDynClient, appClientset, "argocd"),
"PullRequest": generators.NewPullRequestGenerator(k8sClient, generators.SCMAuthProviders{}, "", []string{""}, true),
"PullRequest": generators.NewPullRequestGenerator(k8sClient, scmConfig),
}
nestedGenerators := map[string]generators.Generator{

View File

@@ -1,4 +1,4 @@
package controllers
package template
import (
"encoding/json"
@@ -11,14 +11,12 @@ import (
)
func applyTemplatePatch(app *appv1.Application, templatePatch string) (*appv1.Application, error) {
appString, err := json.Marshal(app)
if err != nil {
return nil, fmt.Errorf("error while marhsalling Application %w", err)
}
convertedTemplatePatch, err := utils.ConvertYAMLToJSON(templatePatch)
if err != nil {
return nil, fmt.Errorf("error while converting template to json %q: %w", convertedTemplatePatch, err)
}
@@ -28,7 +26,6 @@ func applyTemplatePatch(app *appv1.Application, templatePatch string) (*appv1.Ap
}
data, err := strategicpatch.StrategicMergePatch(appString, []byte(convertedTemplatePatch), appv1.Application{})
if err != nil {
return nil, fmt.Errorf("error while applying templatePatch template to json %q: %w", convertedTemplatePatch, err)
}

View File

@@ -1,4 +1,4 @@
package controllers
package template
import (
"testing"

View File

@@ -0,0 +1,99 @@
package template
import (
"fmt"
"sigs.k8s.io/controller-runtime/pkg/client"
log "github.com/sirupsen/logrus"
"github.com/argoproj/argo-cd/v2/applicationset/generators"
"github.com/argoproj/argo-cd/v2/applicationset/utils"
argov1alpha1 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
)
func GenerateApplications(logCtx *log.Entry, applicationSetInfo argov1alpha1.ApplicationSet, g map[string]generators.Generator, renderer utils.Renderer, client client.Client) ([]argov1alpha1.Application, argov1alpha1.ApplicationSetReasonType, error) {
var res []argov1alpha1.Application
var firstError error
var applicationSetReason argov1alpha1.ApplicationSetReasonType
for _, requestedGenerator := range applicationSetInfo.Spec.Generators {
t, err := generators.Transform(requestedGenerator, g, applicationSetInfo.Spec.Template, &applicationSetInfo, map[string]interface{}{}, client)
if err != nil {
logCtx.WithError(err).WithField("generator", requestedGenerator).
Error("error generating application from params")
if firstError == nil {
firstError = err
applicationSetReason = argov1alpha1.ApplicationSetReasonApplicationParamsGenerationError
}
continue
}
for _, a := range t {
tmplApplication := GetTempApplication(a.Template)
for _, p := range a.Params {
app, err := renderer.RenderTemplateParams(tmplApplication, applicationSetInfo.Spec.SyncPolicy, p, applicationSetInfo.Spec.GoTemplate, applicationSetInfo.Spec.GoTemplateOptions)
if err != nil {
logCtx.WithError(err).WithField("params", a.Params).WithField("generator", requestedGenerator).
Error("error generating application from params")
if firstError == nil {
firstError = err
applicationSetReason = argov1alpha1.ApplicationSetReasonRenderTemplateParamsError
}
continue
}
if applicationSetInfo.Spec.TemplatePatch != nil {
patchedApplication, err := renderTemplatePatch(renderer, app, applicationSetInfo, p)
if err != nil {
log.WithError(err).WithField("params", a.Params).WithField("generator", requestedGenerator).
Error("error generating application from params")
if firstError == nil {
firstError = err
applicationSetReason = argov1alpha1.ApplicationSetReasonRenderTemplateParamsError
}
continue
}
app = patchedApplication
}
// The app's namespace must be the same as the AppSet's namespace to preserve the appsets-in-any-namespace
// security boundary.
app.Namespace = applicationSetInfo.Namespace
res = append(res, *app)
}
}
logCtx.WithField("generator", requestedGenerator).Infof("generated %d applications", len(res))
logCtx.WithField("generator", requestedGenerator).Debugf("apps from generator: %+v", res)
}
return res, applicationSetReason, firstError
}
func renderTemplatePatch(r utils.Renderer, app *argov1alpha1.Application, applicationSetInfo argov1alpha1.ApplicationSet, params map[string]interface{}) (*argov1alpha1.Application, error) {
replacedTemplate, err := r.Replace(*applicationSetInfo.Spec.TemplatePatch, params, applicationSetInfo.Spec.GoTemplate, applicationSetInfo.Spec.GoTemplateOptions)
if err != nil {
return nil, fmt.Errorf("error replacing values in templatePatch: %w", err)
}
return applyTemplatePatch(app, replacedTemplate)
}
func GetTempApplication(applicationSetTemplate argov1alpha1.ApplicationSetTemplate) *argov1alpha1.Application {
var tmplApplication argov1alpha1.Application
tmplApplication.Annotations = applicationSetTemplate.Annotations
tmplApplication.Labels = applicationSetTemplate.Labels
tmplApplication.Namespace = applicationSetTemplate.Namespace
tmplApplication.Name = applicationSetTemplate.Name
tmplApplication.Spec = applicationSetTemplate.Spec
tmplApplication.Finalizers = applicationSetTemplate.Finalizers
return &tmplApplication
}

View File

@@ -0,0 +1,350 @@
package template
import (
"fmt"
"testing"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"
log "github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"github.com/argoproj/argo-cd/v2/applicationset/generators"
genmock "github.com/argoproj/argo-cd/v2/applicationset/generators/mocks"
"github.com/argoproj/argo-cd/v2/applicationset/utils"
rendmock "github.com/argoproj/argo-cd/v2/applicationset/utils/mocks"
"github.com/argoproj/argo-cd/v2/pkg/apis/application"
"github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
"github.com/argoproj/argo-cd/v2/util/collections"
)
func TestGenerateApplications(t *testing.T) {
scheme := runtime.NewScheme()
err := v1alpha1.AddToScheme(scheme)
require.NoError(t, err)
err = v1alpha1.AddToScheme(scheme)
require.NoError(t, err)
for _, c := range []struct {
name string
params []map[string]interface{}
template v1alpha1.ApplicationSetTemplate
generateParamsError error
rendererError error
expectErr bool
expectedReason v1alpha1.ApplicationSetReasonType
}{
{
name: "Generate two applications",
params: []map[string]interface{}{{"name": "app1"}, {"name": "app2"}},
template: v1alpha1.ApplicationSetTemplate{
ApplicationSetTemplateMeta: v1alpha1.ApplicationSetTemplateMeta{
Name: "name",
Namespace: "namespace",
Labels: map[string]string{"label_name": "label_value"},
},
Spec: v1alpha1.ApplicationSpec{},
},
expectedReason: "",
},
{
name: "Handles error from the generator",
generateParamsError: fmt.Errorf("error"),
expectErr: true,
expectedReason: v1alpha1.ApplicationSetReasonApplicationParamsGenerationError,
},
{
name: "Handles error from the render",
params: []map[string]interface{}{{"name": "app1"}, {"name": "app2"}},
template: v1alpha1.ApplicationSetTemplate{
ApplicationSetTemplateMeta: v1alpha1.ApplicationSetTemplateMeta{
Name: "name",
Namespace: "namespace",
Labels: map[string]string{"label_name": "label_value"},
},
Spec: v1alpha1.ApplicationSpec{},
},
rendererError: fmt.Errorf("error"),
expectErr: true,
expectedReason: v1alpha1.ApplicationSetReasonRenderTemplateParamsError,
},
} {
cc := c
app := v1alpha1.Application{
ObjectMeta: metav1.ObjectMeta{
Name: "test",
Namespace: "namespace",
},
TypeMeta: metav1.TypeMeta{
Kind: application.ApplicationKind,
APIVersion: "argoproj.io/v1alpha1",
},
}
t.Run(cc.name, func(t *testing.T) {
generatorMock := genmock.Generator{}
generator := v1alpha1.ApplicationSetGenerator{
List: &v1alpha1.ListGenerator{},
}
generatorMock.On("GenerateParams", &generator, mock.AnythingOfType("*v1alpha1.ApplicationSet"), mock.Anything).
Return(cc.params, cc.generateParamsError)
generatorMock.On("GetTemplate", &generator).
Return(&v1alpha1.ApplicationSetTemplate{})
rendererMock := rendmock.Renderer{}
var expectedApps []v1alpha1.Application
if cc.generateParamsError == nil {
for _, p := range cc.params {
if cc.rendererError != nil {
rendererMock.On("RenderTemplateParams", GetTempApplication(cc.template), mock.AnythingOfType("*v1alpha1.ApplicationSetSyncPolicy"), p, false, []string(nil)).
Return(nil, cc.rendererError)
} else {
rendererMock.On("RenderTemplateParams", GetTempApplication(cc.template), mock.AnythingOfType("*v1alpha1.ApplicationSetSyncPolicy"), p, false, []string(nil)).
Return(&app, nil)
expectedApps = append(expectedApps, app)
}
}
}
generators := map[string]generators.Generator{
"List": &generatorMock,
}
renderer := &rendererMock
got, reason, err := GenerateApplications(log.NewEntry(log.StandardLogger()), v1alpha1.ApplicationSet{
ObjectMeta: metav1.ObjectMeta{
Name: "name",
Namespace: "namespace",
},
Spec: v1alpha1.ApplicationSetSpec{
Generators: []v1alpha1.ApplicationSetGenerator{generator},
Template: cc.template,
},
},
generators,
renderer,
nil,
)
if cc.expectErr {
require.Error(t, err)
} else {
require.NoError(t, err)
}
assert.Equal(t, expectedApps, got)
assert.Equal(t, cc.expectedReason, reason)
generatorMock.AssertNumberOfCalls(t, "GenerateParams", 1)
if cc.generateParamsError == nil {
rendererMock.AssertNumberOfCalls(t, "RenderTemplateParams", len(cc.params))
}
})
}
}
func TestMergeTemplateApplications(t *testing.T) {
for _, c := range []struct {
name string
params []map[string]interface{}
template v1alpha1.ApplicationSetTemplate
overrideTemplate v1alpha1.ApplicationSetTemplate
expectedMerged v1alpha1.ApplicationSetTemplate
expectedApps []v1alpha1.Application
}{
{
name: "Generate app",
params: []map[string]interface{}{{"name": "app1"}},
template: v1alpha1.ApplicationSetTemplate{
ApplicationSetTemplateMeta: v1alpha1.ApplicationSetTemplateMeta{
Name: "name",
Namespace: "namespace",
Labels: map[string]string{"label_name": "label_value"},
},
Spec: v1alpha1.ApplicationSpec{},
},
overrideTemplate: v1alpha1.ApplicationSetTemplate{
ApplicationSetTemplateMeta: v1alpha1.ApplicationSetTemplateMeta{
Name: "test",
Labels: map[string]string{"foo": "bar"},
},
Spec: v1alpha1.ApplicationSpec{},
},
expectedMerged: v1alpha1.ApplicationSetTemplate{
ApplicationSetTemplateMeta: v1alpha1.ApplicationSetTemplateMeta{
Name: "test",
Namespace: "namespace",
Labels: map[string]string{"label_name": "label_value", "foo": "bar"},
},
Spec: v1alpha1.ApplicationSpec{},
},
expectedApps: []v1alpha1.Application{
{
ObjectMeta: metav1.ObjectMeta{
Name: "test",
Namespace: "test",
Labels: map[string]string{"foo": "bar"},
},
Spec: v1alpha1.ApplicationSpec{},
},
},
},
} {
cc := c
t.Run(cc.name, func(t *testing.T) {
generatorMock := genmock.Generator{}
generator := v1alpha1.ApplicationSetGenerator{
List: &v1alpha1.ListGenerator{},
}
generatorMock.On("GenerateParams", &generator, mock.AnythingOfType("*v1alpha1.ApplicationSet"), mock.Anything).
Return(cc.params, nil)
generatorMock.On("GetTemplate", &generator).
Return(&cc.overrideTemplate)
rendererMock := rendmock.Renderer{}
rendererMock.On("RenderTemplateParams", GetTempApplication(cc.expectedMerged), mock.AnythingOfType("*v1alpha1.ApplicationSetSyncPolicy"), cc.params[0], false, []string(nil)).
Return(&cc.expectedApps[0], nil)
generators := map[string]generators.Generator{
"List": &generatorMock,
}
renderer := &rendererMock
got, _, _ := GenerateApplications(log.NewEntry(log.StandardLogger()), v1alpha1.ApplicationSet{
ObjectMeta: metav1.ObjectMeta{
Name: "name",
Namespace: "namespace",
},
Spec: v1alpha1.ApplicationSetSpec{
Generators: []v1alpha1.ApplicationSetGenerator{generator},
Template: cc.template,
},
},
generators,
renderer,
nil,
)
assert.Equal(t, cc.expectedApps, got)
})
}
}
// Test app generation from a go template application set using a pull request generator
func TestGenerateAppsUsingPullRequestGenerator(t *testing.T) {
for _, cases := range []struct {
name string
params []map[string]interface{}
template v1alpha1.ApplicationSetTemplate
expectedApp []v1alpha1.Application
}{
{
name: "Generate an application from a go template application set manifest using a pull request generator",
params: []map[string]interface{}{
{
"number": "1",
"title": "title1",
"branch": "branch1",
"branch_slug": "branchSlug1",
"head_sha": "089d92cbf9ff857a39e6feccd32798ca700fb958",
"head_short_sha": "089d92cb",
"branch_slugify_default": "feat/a_really+long_pull_request_name_to_test_argo_slugification_and_branch_name_shortening_feature",
"branch_slugify_smarttruncate_disabled": "feat/areallylongpullrequestnametotestargoslugificationandbranchnameshorteningfeature",
"branch_slugify_smarttruncate_enabled": "feat/testwithsmarttruncateenabledramdomlonglistofcharacters",
"labels": []string{"label1"},
},
},
template: v1alpha1.ApplicationSetTemplate{
ApplicationSetTemplateMeta: v1alpha1.ApplicationSetTemplateMeta{
Name: "AppSet-{{.branch}}-{{.number}}",
Labels: map[string]string{
"app1": "{{index .labels 0}}",
"branch-test1": "AppSet-{{.branch_slugify_default | slugify }}",
"branch-test2": "AppSet-{{.branch_slugify_smarttruncate_disabled | slugify 49 false }}",
"branch-test3": "AppSet-{{.branch_slugify_smarttruncate_enabled | slugify 50 true }}",
},
},
Spec: v1alpha1.ApplicationSpec{
Source: &v1alpha1.ApplicationSource{
RepoURL: "https://testurl/testRepo",
TargetRevision: "{{.head_short_sha}}",
},
Destination: v1alpha1.ApplicationDestination{
Server: "https://kubernetes.default.svc",
Namespace: "AppSet-{{.branch_slug}}-{{.head_sha}}",
},
},
},
expectedApp: []v1alpha1.Application{
{
ObjectMeta: metav1.ObjectMeta{
Name: "AppSet-branch1-1",
Labels: map[string]string{
"app1": "label1",
"branch-test1": "AppSet-feat-a-really-long-pull-request-name-to-test-argo",
"branch-test2": "AppSet-feat-areallylongpullrequestnametotestargoslugific",
"branch-test3": "AppSet-feat",
},
},
Spec: v1alpha1.ApplicationSpec{
Source: &v1alpha1.ApplicationSource{
RepoURL: "https://testurl/testRepo",
TargetRevision: "089d92cb",
},
Destination: v1alpha1.ApplicationDestination{
Server: "https://kubernetes.default.svc",
Namespace: "AppSet-branchSlug1-089d92cbf9ff857a39e6feccd32798ca700fb958",
},
},
},
},
},
} {
t.Run(cases.name, func(t *testing.T) {
generatorMock := genmock.Generator{}
generator := v1alpha1.ApplicationSetGenerator{
PullRequest: &v1alpha1.PullRequestGenerator{},
}
generatorMock.On("GenerateParams", &generator, mock.AnythingOfType("*v1alpha1.ApplicationSet"), mock.Anything).
Return(cases.params, nil)
generatorMock.On("GetTemplate", &generator).
Return(&cases.template, nil)
generators := map[string]generators.Generator{
"PullRequest": &generatorMock,
}
renderer := &utils.Render{}
gotApp, _, _ := GenerateApplications(log.NewEntry(log.StandardLogger()), v1alpha1.ApplicationSet{
Spec: v1alpha1.ApplicationSetSpec{
GoTemplate: true,
Generators: []v1alpha1.ApplicationSetGenerator{{
PullRequest: &v1alpha1.PullRequestGenerator{},
}},
Template: cases.template,
},
},
generators,
renderer,
nil,
)
assert.EqualValues(t, cases.expectedApp[0].ObjectMeta.Name, gotApp[0].ObjectMeta.Name)
assert.EqualValues(t, cases.expectedApp[0].Spec.Source.TargetRevision, gotApp[0].Spec.Source.TargetRevision)
assert.EqualValues(t, cases.expectedApp[0].Spec.Destination.Namespace, gotApp[0].Spec.Destination.Namespace)
assert.True(t, collections.StringMapsEqual(cases.expectedApp[0].ObjectMeta.Labels, gotApp[0].ObjectMeta.Labels))
})
}
}

View File

@@ -38,7 +38,6 @@ type ClusterGenerator struct {
var render = &utils.Render{}
func NewClusterGenerator(c client.Client, ctx context.Context, clientset kubernetes.Interface, namespace string) Generator {
settingsManager := settings.NewSettingsManager(ctx, clientset, namespace)
g := &ClusterGenerator{
@@ -61,8 +60,7 @@ func (g *ClusterGenerator) GetTemplate(appSetGenerator *argoappsetv1alpha1.Appli
return &appSetGenerator.Clusters.Template
}
func (g *ClusterGenerator) GenerateParams(appSetGenerator *argoappsetv1alpha1.ApplicationSetGenerator, appSet *argoappsetv1alpha1.ApplicationSet) ([]map[string]interface{}, error) {
func (g *ClusterGenerator) GenerateParams(appSetGenerator *argoappsetv1alpha1.ApplicationSetGenerator, appSet *argoappsetv1alpha1.ApplicationSet, _ client.Client) ([]map[string]interface{}, error) {
if appSetGenerator == nil {
return nil, EmptyAppSetGeneratorError
}
@@ -87,7 +85,7 @@ func (g *ClusterGenerator) GenerateParams(appSetGenerator *argoappsetv1alpha1.Ap
clusterSecrets, err := g.getSecretsByClusterName(appSetGenerator)
if err != nil {
return nil, err
return nil, fmt.Errorf("error getting cluster secrets: %w", err)
}
res := []map[string]interface{}{}
@@ -95,12 +93,10 @@ func (g *ClusterGenerator) GenerateParams(appSetGenerator *argoappsetv1alpha1.Ap
secretsFound := []corev1.Secret{}
for _, cluster := range clustersFromArgoCD.Items {
// If there is a secret for this cluster, then it's a non-local cluster, so it will be
// handled by the next step.
if secretForCluster, exists := clusterSecrets[cluster.Name]; exists {
secretsFound = append(secretsFound, secretForCluster)
} else if !ignoreLocalClusters {
// If there is no secret for the cluster, it's the local cluster, so handle it here.
params := map[string]interface{}{}
@@ -110,7 +106,7 @@ func (g *ClusterGenerator) GenerateParams(appSetGenerator *argoappsetv1alpha1.Ap
err = appendTemplatedValues(appSetGenerator.Clusters.Values, params, appSet.Spec.GoTemplate, appSet.Spec.GoTemplateOptions)
if err != nil {
return nil, err
return nil, fmt.Errorf("error appending templated values for local cluster: %w", err)
}
res = append(res, params)
@@ -150,7 +146,7 @@ func (g *ClusterGenerator) GenerateParams(appSetGenerator *argoappsetv1alpha1.Ap
err = appendTemplatedValues(appSetGenerator.Clusters.Values, params, appSet.Spec.GoTemplate, appSet.Spec.GoTemplateOptions)
if err != nil {
return nil, err
return nil, fmt.Errorf("error appending templated values for cluster: %w", err)
}
res = append(res, params)
@@ -168,7 +164,7 @@ func (g *ClusterGenerator) getSecretsByClusterName(appSetGenerator *argoappsetv1
selector := metav1.AddLabelToSelector(&appSetGenerator.Clusters.Selector, ArgoCDSecretTypeLabel, ArgoCDSecretTypeCluster)
secretSelector, err := metav1.LabelSelectorAsSelector(selector)
if err != nil {
return nil, err
return nil, fmt.Errorf("error converting label selector: %w", err)
}
if err := g.Client.List(context.Background(), clusterSecretList, client.MatchingLabelsSelector{Selector: secretSelector}); err != nil {
@@ -185,5 +181,4 @@ func (g *ClusterGenerator) getSecretsByClusterName(appSetGenerator *argoappsetv1
}
return res, nil
}

View File

@@ -17,6 +17,7 @@ import (
argoprojiov1alpha1 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
type possiblyErroringFakeCtrlRuntimeClient struct {
@@ -104,11 +105,15 @@ func TestGenerateParams(t *testing.T) {
"aaa": "{{ server }}",
"no-op": "{{ this-does-not-exist }}",
}, expected: []map[string]interface{}{
{"values.lol1": "lol", "values.lol2": "{{values.lol1}}{{values.lol1}}", "values.lol3": "{{values.lol2}}{{values.lol2}}{{values.lol2}}", "values.foo": "bar", "values.bar": "production", "values.no-op": "{{ this-does-not-exist }}", "values.bat": "production", "values.aaa": "https://production-01.example.com", "name": "production_01/west", "nameNormalized": "production-01-west", "server": "https://production-01.example.com", "metadata.labels.environment": "production", "metadata.labels.org": "bar",
"metadata.labels.argocd.argoproj.io/secret-type": "cluster", "metadata.annotations.foo.argoproj.io": "production"},
{
"values.lol1": "lol", "values.lol2": "{{values.lol1}}{{values.lol1}}", "values.lol3": "{{values.lol2}}{{values.lol2}}{{values.lol2}}", "values.foo": "bar", "values.bar": "production", "values.no-op": "{{ this-does-not-exist }}", "values.bat": "production", "values.aaa": "https://production-01.example.com", "name": "production_01/west", "nameNormalized": "production-01-west", "server": "https://production-01.example.com", "metadata.labels.environment": "production", "metadata.labels.org": "bar",
"metadata.labels.argocd.argoproj.io/secret-type": "cluster", "metadata.annotations.foo.argoproj.io": "production",
},
{"values.lol1": "lol", "values.lol2": "{{values.lol1}}{{values.lol1}}", "values.lol3": "{{values.lol2}}{{values.lol2}}{{values.lol2}}", "values.foo": "bar", "values.bar": "staging", "values.no-op": "{{ this-does-not-exist }}", "values.bat": "staging", "values.aaa": "https://staging-01.example.com", "name": "staging-01", "nameNormalized": "staging-01", "server": "https://staging-01.example.com", "metadata.labels.environment": "staging", "metadata.labels.org": "foo",
"metadata.labels.argocd.argoproj.io/secret-type": "cluster", "metadata.annotations.foo.argoproj.io": "staging"},
{
"values.lol1": "lol", "values.lol2": "{{values.lol1}}{{values.lol1}}", "values.lol3": "{{values.lol2}}{{values.lol2}}{{values.lol2}}", "values.foo": "bar", "values.bar": "staging", "values.no-op": "{{ this-does-not-exist }}", "values.bat": "staging", "values.aaa": "https://staging-01.example.com", "name": "staging-01", "nameNormalized": "staging-01", "server": "https://staging-01.example.com", "metadata.labels.environment": "staging", "metadata.labels.org": "foo",
"metadata.labels.argocd.argoproj.io/secret-type": "cluster", "metadata.annotations.foo.argoproj.io": "staging",
},
{"values.lol1": "lol", "values.lol2": "{{values.lol1}}{{values.lol1}}", "values.lol3": "{{values.lol2}}{{values.lol2}}{{values.lol2}}", "values.foo": "bar", "values.bar": "{{ metadata.annotations.foo.argoproj.io }}", "values.no-op": "{{ this-does-not-exist }}", "values.bat": "{{ metadata.labels.environment }}", "values.aaa": "https://kubernetes.default.svc", "nameNormalized": "in-cluster", "name": "in-cluster", "server": "https://kubernetes.default.svc"},
},
@@ -124,11 +129,15 @@ func TestGenerateParams(t *testing.T) {
},
values: nil,
expected: []map[string]interface{}{
{"name": "production_01/west", "nameNormalized": "production-01-west", "server": "https://production-01.example.com", "metadata.labels.environment": "production", "metadata.labels.org": "bar",
"metadata.labels.argocd.argoproj.io/secret-type": "cluster", "metadata.annotations.foo.argoproj.io": "production"},
{
"name": "production_01/west", "nameNormalized": "production-01-west", "server": "https://production-01.example.com", "metadata.labels.environment": "production", "metadata.labels.org": "bar",
"metadata.labels.argocd.argoproj.io/secret-type": "cluster", "metadata.annotations.foo.argoproj.io": "production",
},
{"name": "staging-01", "nameNormalized": "staging-01", "server": "https://staging-01.example.com", "metadata.labels.environment": "staging", "metadata.labels.org": "foo",
"metadata.labels.argocd.argoproj.io/secret-type": "cluster", "metadata.annotations.foo.argoproj.io": "staging"},
{
"name": "staging-01", "nameNormalized": "staging-01", "server": "https://staging-01.example.com", "metadata.labels.environment": "staging", "metadata.labels.org": "foo",
"metadata.labels.argocd.argoproj.io/secret-type": "cluster", "metadata.annotations.foo.argoproj.io": "staging",
},
},
clientError: false,
expectedError: nil,
@@ -144,8 +153,10 @@ func TestGenerateParams(t *testing.T) {
"foo": "bar",
},
expected: []map[string]interface{}{
{"values.foo": "bar", "name": "production_01/west", "nameNormalized": "production-01-west", "server": "https://production-01.example.com", "metadata.labels.environment": "production", "metadata.labels.org": "bar",
"metadata.labels.argocd.argoproj.io/secret-type": "cluster", "metadata.annotations.foo.argoproj.io": "production"},
{
"values.foo": "bar", "name": "production_01/west", "nameNormalized": "production-01-west", "server": "https://production-01.example.com", "metadata.labels.environment": "production", "metadata.labels.org": "bar",
"metadata.labels.argocd.argoproj.io/secret-type": "cluster", "metadata.annotations.foo.argoproj.io": "production",
},
},
clientError: false,
expectedError: nil,
@@ -168,10 +179,14 @@ func TestGenerateParams(t *testing.T) {
"foo": "bar",
},
expected: []map[string]interface{}{
{"values.foo": "bar", "name": "staging-01", "nameNormalized": "staging-01", "server": "https://staging-01.example.com", "metadata.labels.environment": "staging", "metadata.labels.org": "foo",
"metadata.labels.argocd.argoproj.io/secret-type": "cluster", "metadata.annotations.foo.argoproj.io": "staging"},
{"values.foo": "bar", "name": "production_01/west", "nameNormalized": "production-01-west", "server": "https://production-01.example.com", "metadata.labels.environment": "production", "metadata.labels.org": "bar",
"metadata.labels.argocd.argoproj.io/secret-type": "cluster", "metadata.annotations.foo.argoproj.io": "production"},
{
"values.foo": "bar", "name": "staging-01", "nameNormalized": "staging-01", "server": "https://staging-01.example.com", "metadata.labels.environment": "staging", "metadata.labels.org": "foo",
"metadata.labels.argocd.argoproj.io/secret-type": "cluster", "metadata.annotations.foo.argoproj.io": "staging",
},
{
"values.foo": "bar", "name": "production_01/west", "nameNormalized": "production-01-west", "server": "https://production-01.example.com", "metadata.labels.environment": "production", "metadata.labels.org": "bar",
"metadata.labels.argocd.argoproj.io/secret-type": "cluster", "metadata.annotations.foo.argoproj.io": "production",
},
},
clientError: false,
expectedError: nil,
@@ -197,8 +212,10 @@ func TestGenerateParams(t *testing.T) {
"name": "baz",
},
expected: []map[string]interface{}{
{"values.name": "baz", "name": "staging-01", "nameNormalized": "staging-01", "server": "https://staging-01.example.com", "metadata.labels.environment": "staging", "metadata.labels.org": "foo",
"metadata.labels.argocd.argoproj.io/secret-type": "cluster", "metadata.annotations.foo.argoproj.io": "staging"},
{
"values.name": "baz", "name": "staging-01", "nameNormalized": "staging-01", "server": "https://staging-01.example.com", "metadata.labels.environment": "staging", "metadata.labels.org": "foo",
"metadata.labels.argocd.argoproj.io/secret-type": "cluster", "metadata.annotations.foo.argoproj.io": "staging",
},
},
clientError: false,
expectedError: nil,
@@ -209,7 +226,7 @@ func TestGenerateParams(t *testing.T) {
values: nil,
expected: nil,
clientError: true,
expectedError: fmt.Errorf("could not list Secrets"),
expectedError: fmt.Errorf("error getting cluster secrets: could not list Secrets"),
},
}
@@ -220,9 +237,7 @@ func TestGenerateParams(t *testing.T) {
}
for _, testCase := range testCases {
t.Run(testCase.name, func(t *testing.T) {
appClientset := kubefake.NewSimpleClientset(runtimeClusters...)
fakeClient := fake.NewClientBuilder().WithObjects(clusters...).Build()
@@ -231,7 +246,7 @@ func TestGenerateParams(t *testing.T) {
testCase.clientError,
}
var clusterGenerator = NewClusterGenerator(cl, context.Background(), appClientset, "namespace")
clusterGenerator := NewClusterGenerator(cl, context.Background(), appClientset, "namespace")
applicationSetInfo := argoprojiov1alpha1.ApplicationSet{
ObjectMeta: metav1.ObjectMeta{
@@ -245,15 +260,14 @@ func TestGenerateParams(t *testing.T) {
Selector: testCase.selector,
Values: testCase.values,
},
}, &applicationSetInfo)
}, &applicationSetInfo, nil)
if testCase.expectedError != nil {
assert.EqualError(t, err, testCase.expectedError.Error())
require.EqualError(t, err, testCase.expectedError.Error())
} else {
assert.NoError(t, err)
require.NoError(t, err)
assert.ElementsMatch(t, testCase.expected, got)
}
})
}
}
@@ -583,7 +597,7 @@ func TestGenerateParamsGoTemplate(t *testing.T) {
values: nil,
expected: nil,
clientError: true,
expectedError: fmt.Errorf("could not list Secrets"),
expectedError: fmt.Errorf("error getting cluster secrets: could not list Secrets"),
},
}
@@ -594,9 +608,7 @@ func TestGenerateParamsGoTemplate(t *testing.T) {
}
for _, testCase := range testCases {
t.Run(testCase.name, func(t *testing.T) {
appClientset := kubefake.NewSimpleClientset(runtimeClusters...)
fakeClient := fake.NewClientBuilder().WithObjects(clusters...).Build()
@@ -605,7 +617,7 @@ func TestGenerateParamsGoTemplate(t *testing.T) {
testCase.clientError,
}
var clusterGenerator = NewClusterGenerator(cl, context.Background(), appClientset, "namespace")
clusterGenerator := NewClusterGenerator(cl, context.Background(), appClientset, "namespace")
applicationSetInfo := argoprojiov1alpha1.ApplicationSet{
ObjectMeta: metav1.ObjectMeta{
@@ -621,15 +633,14 @@ func TestGenerateParamsGoTemplate(t *testing.T) {
Selector: testCase.selector,
Values: testCase.values,
},
}, &applicationSetInfo)
}, &applicationSetInfo, nil)
if testCase.expectedError != nil {
assert.EqualError(t, err, testCase.expectedError.Error())
require.EqualError(t, err, testCase.expectedError.Error())
} else {
assert.NoError(t, err)
require.NoError(t, err)
assert.ElementsMatch(t, testCase.expected, got)
}
})
}
}

View File

@@ -7,6 +7,7 @@ import (
"time"
log "github.com/sirupsen/logrus"
"sigs.k8s.io/controller-runtime/pkg/client"
"github.com/argoproj/argo-cd/v2/util/settings"
@@ -32,7 +33,6 @@ type DuckTypeGenerator struct {
}
func NewDuckTypeGenerator(ctx context.Context, dynClient dynamic.Interface, clientset kubernetes.Interface, namespace string) Generator {
settingsManager := settings.NewSettingsManager(ctx, clientset, namespace)
g := &DuckTypeGenerator{
@@ -46,7 +46,6 @@ func NewDuckTypeGenerator(ctx context.Context, dynClient dynamic.Interface, clie
}
func (g *DuckTypeGenerator) GetRequeueAfter(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator) time.Duration {
// Return a requeue default of 3 minutes, if no override is specified.
if appSetGenerator.ClusterDecisionResource.RequeueAfterSeconds != nil {
@@ -60,8 +59,7 @@ func (g *DuckTypeGenerator) GetTemplate(appSetGenerator *argoprojiov1alpha1.Appl
return &appSetGenerator.ClusterDecisionResource.Template
}
func (g *DuckTypeGenerator) GenerateParams(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator, appSet *argoprojiov1alpha1.ApplicationSet) ([]map[string]interface{}, error) {
func (g *DuckTypeGenerator) GenerateParams(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator, appSet *argoprojiov1alpha1.ApplicationSet, _ client.Client) ([]map[string]interface{}, error) {
if appSetGenerator == nil {
return nil, EmptyAppSetGeneratorError
}
@@ -83,7 +81,6 @@ func (g *DuckTypeGenerator) GenerateParams(appSetGenerator *argoprojiov1alpha1.A
// Read the configMapRef
cm, err := g.clientset.CoreV1().ConfigMaps(g.namespace).Get(g.ctx, appSetGenerator.ClusterDecisionResource.ConfigMapRef, metav1.GetOptions{})
if err != nil {
return nil, fmt.Errorf("error reading configMapRef: %w", err)
}
@@ -104,7 +101,6 @@ func (g *DuckTypeGenerator) GenerateParams(appSetGenerator *argoprojiov1alpha1.A
if (resourceName == "" && labelSelector.MatchLabels == nil && labelSelector.MatchExpressions == nil) ||
(resourceName != "" && (labelSelector.MatchExpressions != nil || labelSelector.MatchLabels != nil)) {
log.Warningf("You must choose either resourceName=%v, labelSelector.matchLabels=%v or labelSelect.matchExpressions=%v", resourceName, labelSelector.MatchLabels, labelSelector.MatchExpressions)
return nil, fmt.Errorf("There is a problem with the definition of the ClusterDecisionResource generator")
}
@@ -122,15 +118,14 @@ func (g *DuckTypeGenerator) GenerateParams(appSetGenerator *argoprojiov1alpha1.A
log.WithField("listOptions.LabelSelector", listOptions.LabelSelector).Info("selection type")
} else {
listOptions.FieldSelector = fields.OneTermEqualSelector("metadata.name", resourceName).String()
//metav1.Convert_fields_Selector_To_string(fields.).Sprintf("metadata.name=%s", resourceName)
// metav1.Convert_fields_Selector_To_string(fields.).Sprintf("metadata.name=%s", resourceName)
log.WithField("listOptions.FieldSelector", listOptions.FieldSelector).Info("selection type")
}
duckResources, err := g.dynClient.Resource(duckGVR).Namespace(g.namespace).List(g.ctx, listOptions)
if err != nil {
log.WithField("GVK", duckGVR).Warning("resources were not found")
return nil, err
return nil, fmt.Errorf("failed to get dynamic resources: %w", err)
}
if len(duckResources.Items) == 0 {
@@ -149,7 +144,6 @@ func (g *DuckTypeGenerator) GenerateParams(appSetGenerator *argoprojiov1alpha1.A
if matchKey == "" {
log.WithField("matchKey", matchKey).Warning("matchKey not found in " + cm.Name)
return nil, nil
}
res := []map[string]interface{}{}
@@ -167,7 +161,6 @@ func (g *DuckTypeGenerator) GenerateParams(appSetGenerator *argoprojiov1alpha1.A
log.WithField("duckResourceStatus", duckResource.Object["status"]).Debug("found resource")
clusterDecisions = append(clusterDecisions, duckResource.Object["status"].(map[string]interface{})[statusListKey].([]interface{})...)
}
log.Infof("Number of decisions found: %v", len(clusterDecisions))
@@ -176,7 +169,6 @@ func (g *DuckTypeGenerator) GenerateParams(appSetGenerator *argoprojiov1alpha1.A
if len(clusterDecisions) > 0 {
for _, cluster := range clusterDecisions {
// generated instance of cluster params
params := map[string]interface{}{}
@@ -194,7 +186,6 @@ func (g *DuckTypeGenerator) GenerateParams(appSetGenerator *argoprojiov1alpha1.A
for _, argoCluster := range argoClusters {
if argoCluster.Name == strMatchValue {
log.WithField(matchKey, argoCluster.Name).Info("matched cluster in ArgoCD")
params["name"] = argoCluster.Name
params["server"] = argoCluster.Server
@@ -202,7 +193,6 @@ func (g *DuckTypeGenerator) GenerateParams(appSetGenerator *argoprojiov1alpha1.A
found = true
break // Stop looking
}
}
if !found {

View File

@@ -6,6 +6,7 @@ import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
@@ -18,9 +19,11 @@ import (
argoprojiov1alpha1 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
)
const resourceApiVersion = "mallard.io/v1"
const resourceKind = "ducks"
const resourceName = "quak"
const (
resourceApiVersion = "mallard.io/v1"
resourceKind = "ducks"
resourceName = "quak"
)
func TestGenerateParamsForDuckType(t *testing.T) {
clusters := []client.Object{
@@ -279,9 +282,7 @@ func TestGenerateParamsForDuckType(t *testing.T) {
}
for _, testCase := range testCases {
t.Run(testCase.name, func(t *testing.T) {
appClientset := kubefake.NewSimpleClientset(append(runtimeClusters, configMap)...)
gvrToListKind := map[schema.GroupVersionResource]string{{
@@ -292,7 +293,7 @@ func TestGenerateParamsForDuckType(t *testing.T) {
fakeDynClient := dynfake.NewSimpleDynamicClientWithCustomListKinds(runtime.NewScheme(), gvrToListKind, testCase.resource)
var duckTypeGenerator = NewDuckTypeGenerator(context.Background(), fakeDynClient, appClientset, "namespace")
duckTypeGenerator := NewDuckTypeGenerator(context.Background(), fakeDynClient, appClientset, "namespace")
applicationSetInfo := argoprojiov1alpha1.ApplicationSet{
ObjectMeta: metav1.ObjectMeta{
@@ -308,12 +309,12 @@ func TestGenerateParamsForDuckType(t *testing.T) {
LabelSelector: testCase.labelSelector,
Values: testCase.values,
},
}, &applicationSetInfo)
}, &applicationSetInfo, nil)
if testCase.expectedError != nil {
assert.EqualError(t, err, testCase.expectedError.Error())
require.EqualError(t, err, testCase.expectedError.Error())
} else {
assert.NoError(t, err)
require.NoError(t, err)
assert.ElementsMatch(t, testCase.expected, got)
}
})
@@ -577,9 +578,7 @@ func TestGenerateParamsForDuckTypeGoTemplate(t *testing.T) {
}
for _, testCase := range testCases {
t.Run(testCase.name, func(t *testing.T) {
appClientset := kubefake.NewSimpleClientset(append(runtimeClusters, configMap)...)
gvrToListKind := map[schema.GroupVersionResource]string{{
@@ -590,7 +589,7 @@ func TestGenerateParamsForDuckTypeGoTemplate(t *testing.T) {
fakeDynClient := dynfake.NewSimpleDynamicClientWithCustomListKinds(runtime.NewScheme(), gvrToListKind, testCase.resource)
var duckTypeGenerator = NewDuckTypeGenerator(context.Background(), fakeDynClient, appClientset, "namespace")
duckTypeGenerator := NewDuckTypeGenerator(context.Background(), fakeDynClient, appClientset, "namespace")
applicationSetInfo := argoprojiov1alpha1.ApplicationSet{
ObjectMeta: metav1.ObjectMeta{
@@ -608,12 +607,12 @@ func TestGenerateParamsForDuckTypeGoTemplate(t *testing.T) {
LabelSelector: testCase.labelSelector,
Values: testCase.values,
},
}, &applicationSetInfo)
}, &applicationSetInfo, nil)
if testCase.expectedError != nil {
assert.EqualError(t, err, testCase.expectedError.Error())
require.EqualError(t, err, testCase.expectedError.Error())
} else {
assert.NoError(t, err)
require.NoError(t, err)
assert.ElementsMatch(t, testCase.expected, got)
}
})

View File

@@ -5,6 +5,7 @@ import (
"reflect"
"github.com/jeremywohl/flatten"
"sigs.k8s.io/controller-runtime/pkg/client"
"github.com/argoproj/argo-cd/v2/applicationset/utils"
@@ -26,7 +27,7 @@ type TransformResult struct {
}
// Transform a spec generator to list of paramSets and a template
func Transform(requestedGenerator argoprojiov1alpha1.ApplicationSetGenerator, allGenerators map[string]Generator, baseTemplate argoprojiov1alpha1.ApplicationSetTemplate, appSet *argoprojiov1alpha1.ApplicationSet, genParams map[string]interface{}) ([]TransformResult, error) {
func Transform(requestedGenerator argoprojiov1alpha1.ApplicationSetGenerator, allGenerators map[string]Generator, baseTemplate argoprojiov1alpha1.ApplicationSetTemplate, appSet *argoprojiov1alpha1.ApplicationSet, genParams map[string]interface{}, client client.Client) ([]TransformResult, error) {
// This is a custom version of the `LabelSelectorAsSelector` that is in k8s.io/apimachinery. This has been copied
// verbatim from that package, with the difference that we do not have any restrictions on label values. This is done
// so that, among other things, we can match on cluster urls.
@@ -64,7 +65,7 @@ func Transform(requestedGenerator argoprojiov1alpha1.ApplicationSetGenerator, al
continue
}
}
params, err = g.GenerateParams(interpolatedGenerator, appSet)
params, err = g.GenerateParams(interpolatedGenerator, appSet, client)
if err != nil {
log.WithError(err).WithField("generator", g).
Error("error generating params")

View File

@@ -65,8 +65,8 @@ func TestMatchValues(t *testing.T) {
for _, testCase := range testCases {
t.Run(testCase.name, func(t *testing.T) {
var listGenerator = NewListGenerator()
var data = map[string]Generator{
listGenerator := NewListGenerator()
data := map[string]Generator{
"List": listGenerator,
}
@@ -84,12 +84,13 @@ func TestMatchValues(t *testing.T) {
List: &argov1alpha1.ListGenerator{
Elements: testCase.elements,
Template: emptyTemplate(),
}},
},
},
data,
emptyTemplate(),
&applicationSetInfo, nil)
&applicationSetInfo, nil, nil)
assert.NoError(t, err)
require.NoError(t, err)
assert.ElementsMatch(t, testCase.expected, results[0].Params)
})
}
@@ -148,8 +149,8 @@ func TestMatchValuesGoTemplate(t *testing.T) {
for _, testCase := range testCases {
t.Run(testCase.name, func(t *testing.T) {
var listGenerator = NewListGenerator()
var data = map[string]Generator{
listGenerator := NewListGenerator()
data := map[string]Generator{
"List": listGenerator,
}
@@ -167,12 +168,13 @@ func TestMatchValuesGoTemplate(t *testing.T) {
List: &argov1alpha1.ListGenerator{
Elements: testCase.elements,
Template: emptyTemplate(),
}},
},
},
data,
emptyTemplate(),
&applicationSetInfo, nil)
&applicationSetInfo, nil, nil)
assert.NoError(t, err)
require.NoError(t, err)
assert.ElementsMatch(t, testCase.expected, results[0].Params)
})
}
@@ -236,12 +238,13 @@ func TestTransForm(t *testing.T) {
Selector: metav1.LabelSelector{},
Template: argov1alpha1.ApplicationSetTemplate{},
Values: nil,
}},
},
},
testGenerators,
emptyTemplate(),
&applicationSetInfo, nil)
&applicationSetInfo, nil, nil)
assert.NoError(t, err)
require.NoError(t, err)
assert.ElementsMatch(t, testCase.expected, results[0].Params)
})
}
@@ -343,12 +346,11 @@ func getMockClusterGenerator() Generator {
func getMockGitGenerator() Generator {
argoCDServiceMock := mocks.Repos{}
argoCDServiceMock.On("GetDirectories", mock.Anything, mock.Anything, mock.Anything).Return([]string{"app1", "app2", "app_3", "p1/app4"}, nil)
var gitGenerator = NewGitGenerator(&argoCDServiceMock)
gitGenerator := NewGitGenerator(&argoCDServiceMock)
return gitGenerator
}
func TestGetRelevantGenerators(t *testing.T) {
testGenerators := map[string]Generator{
"Clusters": getMockClusterGenerator(),
"Git": getMockGitGenerator(),
@@ -361,7 +363,8 @@ func TestGetRelevantGenerators(t *testing.T) {
requestedGenerator := &argov1alpha1.ApplicationSetGenerator{
List: &argov1alpha1.ListGenerator{
Elements: []apiextensionsv1.JSON{{Raw: []byte(`{"cluster": "cluster","url": "url","values":{"foo":"bar"}}`)}},
}}
},
}
relevantGenerators := GetRelevantGenerators(requestedGenerator, testGenerators)
assert.Len(t, relevantGenerators, 1)
@@ -404,7 +407,8 @@ func TestInterpolateGenerator(t *testing.T) {
"path-basename": "{{path.basename}}",
"path-zero": "{{path[0]}}",
"path-full": "{{path}}",
}},
},
},
},
}
gitGeneratorParams := map[string]interface{}{
@@ -458,7 +462,8 @@ func TestInterpolateGenerator_go(t *testing.T) {
"path-zero": "{{index .path.segments 0}}",
"path-full": "{{.path.path}}",
"kubernetes.io/environment": `{{default "foo" .my_label}}`,
}},
},
},
},
}
gitGeneratorParams := map[string]interface{}{
@@ -550,7 +555,7 @@ func TestInterpolateGeneratorError(t *testing.T) {
t.Run(tt.name, func(t *testing.T) {
got, err := InterpolateGenerator(tt.args.requestedGenerator, tt.args.params, tt.args.useGoTemplate, tt.args.goTemplateOptions)
if tt.expectedErrStr != "" {
assert.EqualError(t, err, tt.expectedErrStr)
require.EqualError(t, err, tt.expectedErrStr)
} else {
require.NoError(t, err)
}

View File

@@ -11,11 +11,14 @@ import (
"github.com/jeremywohl/flatten"
log "github.com/sirupsen/logrus"
"k8s.io/apimachinery/pkg/types"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/yaml"
"github.com/argoproj/argo-cd/v2/applicationset/services"
"github.com/argoproj/argo-cd/v2/applicationset/utils"
argoprojiov1alpha1 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
"github.com/argoproj/argo-cd/v2/util/gpg"
)
var _ Generator = (*GitGenerator)(nil)
@@ -36,7 +39,6 @@ func (g *GitGenerator) GetTemplate(appSetGenerator *argoprojiov1alpha1.Applicati
}
func (g *GitGenerator) GetRequeueAfter(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator) time.Duration {
// Return a requeue default of 3 minutes, if no default is specified.
if appSetGenerator.Git.RequeueAfterSeconds != nil {
@@ -46,8 +48,7 @@ func (g *GitGenerator) GetRequeueAfter(appSetGenerator *argoprojiov1alpha1.Appli
return DefaultRequeueAfterSeconds
}
func (g *GitGenerator) GenerateParams(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator, appSet *argoprojiov1alpha1.ApplicationSet) ([]map[string]interface{}, error) {
func (g *GitGenerator) GenerateParams(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator, appSet *argoprojiov1alpha1.ApplicationSet, client client.Client) ([]map[string]interface{}, error) {
if appSetGenerator == nil {
return nil, EmptyAppSetGeneratorError
}
@@ -58,12 +59,27 @@ func (g *GitGenerator) GenerateParams(appSetGenerator *argoprojiov1alpha1.Applic
noRevisionCache := appSet.RefreshRequired()
var project string
if strings.Contains(appSet.Spec.Template.Spec.Project, "{{") {
project = appSetGenerator.Git.Template.Spec.Project
} else {
project = appSet.Spec.Template.Spec.Project
}
appProject := &argoprojiov1alpha1.AppProject{}
if err := client.Get(context.TODO(), types.NamespacedName{Name: appSet.Spec.Template.Spec.Project, Namespace: appSet.Namespace}, appProject); err != nil {
return nil, fmt.Errorf("error getting project %s: %w", project, err)
}
// we need to verify the signature on the Git revision if GPG is enabled
verifyCommit := appProject.Spec.SignatureKeys != nil && len(appProject.Spec.SignatureKeys) > 0 && gpg.IsGPGEnabled()
var err error
var res []map[string]interface{}
if len(appSetGenerator.Git.Directories) != 0 {
res, err = g.generateParamsForGitDirectories(appSetGenerator, noRevisionCache, appSet.Spec.GoTemplate, appSet.Spec.GoTemplateOptions)
res, err = g.generateParamsForGitDirectories(appSetGenerator, noRevisionCache, verifyCommit, appSet.Spec.GoTemplate, appSet.Spec.GoTemplateOptions)
} else if len(appSetGenerator.Git.Files) != 0 {
res, err = g.generateParamsForGitFiles(appSetGenerator, noRevisionCache, appSet.Spec.GoTemplate, appSet.Spec.GoTemplateOptions)
res, err = g.generateParamsForGitFiles(appSetGenerator, noRevisionCache, verifyCommit, appSet.Spec.GoTemplate, appSet.Spec.GoTemplateOptions)
} else {
return nil, EmptyAppSetGeneratorError
}
@@ -74,10 +90,9 @@ func (g *GitGenerator) GenerateParams(appSetGenerator *argoprojiov1alpha1.Applic
return res, nil
}
func (g *GitGenerator) generateParamsForGitDirectories(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator, noRevisionCache bool, useGoTemplate bool, goTemplateOptions []string) ([]map[string]interface{}, error) {
func (g *GitGenerator) generateParamsForGitDirectories(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator, noRevisionCache, verifyCommit bool, useGoTemplate bool, goTemplateOptions []string) ([]map[string]interface{}, error) {
// Directories, not files
allPaths, err := g.repos.GetDirectories(context.TODO(), appSetGenerator.Git.RepoURL, appSetGenerator.Git.Revision, noRevisionCache)
allPaths, err := g.repos.GetDirectories(context.TODO(), appSetGenerator.Git.RepoURL, appSetGenerator.Git.Revision, noRevisionCache, verifyCommit)
if err != nil {
return nil, fmt.Errorf("error getting directories from repo: %w", err)
}
@@ -100,12 +115,11 @@ func (g *GitGenerator) generateParamsForGitDirectories(appSetGenerator *argoproj
return res, nil
}
func (g *GitGenerator) generateParamsForGitFiles(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator, noRevisionCache bool, useGoTemplate bool, goTemplateOptions []string) ([]map[string]interface{}, error) {
func (g *GitGenerator) generateParamsForGitFiles(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator, noRevisionCache, verifyCommit bool, useGoTemplate bool, goTemplateOptions []string) ([]map[string]interface{}, error) {
// Get all files that match the requested path string, removing duplicates
allFiles := make(map[string][]byte)
for _, requestedPath := range appSetGenerator.Git.Files {
files, err := g.repos.GetFiles(context.TODO(), appSetGenerator.Git.RepoURL, appSetGenerator.Git.Revision, requestedPath.Path, noRevisionCache)
files, err := g.repos.GetFiles(context.TODO(), appSetGenerator.Git.RepoURL, appSetGenerator.Git.Revision, requestedPath.Path, noRevisionCache, verifyCommit)
if err != nil {
return nil, err
}
@@ -125,11 +139,10 @@ func (g *GitGenerator) generateParamsForGitFiles(appSetGenerator *argoprojiov1al
// Generate params from each path, and return
res := []map[string]interface{}{}
for _, path := range allPaths {
// A JSON / YAML file path can contain multiple sets of parameters (ie it is an array)
paramsArray, err := g.generateParamsFromGitFile(path, allFiles[path], appSetGenerator.Git.Values, useGoTemplate, goTemplateOptions, appSetGenerator.Git.PathParamPrefix)
if err != nil {
return nil, fmt.Errorf("unable to process file '%s': %v", path, err)
return nil, fmt.Errorf("unable to process file '%s': %w", path, err)
}
res = append(res, paramsArray...)
@@ -147,7 +160,7 @@ func (g *GitGenerator) generateParamsFromGitFile(filePath string, fileContent []
singleObj := make(map[string]interface{})
err = yaml.Unmarshal(fileContent, &singleObj)
if err != nil {
return nil, fmt.Errorf("unable to parse file: %v", err)
return nil, fmt.Errorf("unable to parse file: %w", err)
}
objectsFound = append(objectsFound, singleObj)
} else if len(objectsFound) == 0 {
@@ -158,7 +171,6 @@ func (g *GitGenerator) generateParamsFromGitFile(filePath string, fileContent []
res := []map[string]interface{}{}
for _, objectFound := range objectsFound {
params := map[string]interface{}{}
if useGoTemplate {
@@ -214,13 +226,13 @@ func (g *GitGenerator) generateParamsFromGitFile(filePath string, fileContent []
return res, nil
}
func (g *GitGenerator) filterApps(Directories []argoprojiov1alpha1.GitDirectoryGeneratorItem, allPaths []string) []string {
func (g *GitGenerator) filterApps(directories []argoprojiov1alpha1.GitDirectoryGeneratorItem, allPaths []string) []string {
res := []string{}
for _, appPath := range allPaths {
appInclude := false
appExclude := false
// Iterating over each appPath and check whether directories object has requestedPath that matches the appPath
for _, requestedPath := range Directories {
for _, requestedPath := range directories {
match, err := path.Match(requestedPath.Path, appPath)
if err != nil {
log.WithError(err).WithField("requestedPath", requestedPath).
@@ -245,7 +257,6 @@ func (g *GitGenerator) filterApps(Directories []argoprojiov1alpha1.GitDirectoryG
func (g *GitGenerator) generateParamsFromApps(requestedApps []string, appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator, useGoTemplate bool, goTemplateOptions []string) ([]map[string]interface{}, error) {
res := make([]map[string]interface{}, len(requestedApps))
for i, a := range requestedApps {
params := make(map[string]interface{}, 5)
if useGoTemplate {

View File

@@ -4,11 +4,16 @@ import (
"fmt"
"testing"
"github.com/argoproj/argo-cd/v2/applicationset/services/mocks"
argoprojiov1alpha1 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"sigs.k8s.io/controller-runtime/pkg/client/fake"
"github.com/argoproj/argo-cd/v2/applicationset/services/mocks"
"github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
argoprojiov1alpha1 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
)
func Test_generateParamsFromGitFile(t *testing.T) {
@@ -174,7 +179,6 @@ foo:
}
func TestGitGenerateParamsFromDirectories(t *testing.T) {
cases := []struct {
name string
directories []argoprojiov1alpha1.GitDirectoryGeneratorItem
@@ -317,9 +321,9 @@ func TestGitGenerateParamsFromDirectories(t *testing.T) {
argoCDServiceMock := mocks.Repos{}
argoCDServiceMock.On("GetDirectories", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(testCaseCopy.repoApps, testCaseCopy.repoError)
argoCDServiceMock.On("GetDirectories", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(testCaseCopy.repoApps, testCaseCopy.repoError)
var gitGenerator = NewGitGenerator(&argoCDServiceMock)
gitGenerator := NewGitGenerator(&argoCDServiceMock)
applicationSetInfo := argoprojiov1alpha1.ApplicationSet{
ObjectMeta: metav1.ObjectMeta{
Name: "set",
@@ -337,12 +341,19 @@ func TestGitGenerateParamsFromDirectories(t *testing.T) {
},
}
got, err := gitGenerator.GenerateParams(&applicationSetInfo.Spec.Generators[0], &applicationSetInfo)
scheme := runtime.NewScheme()
err := v1alpha1.AddToScheme(scheme)
require.NoError(t, err)
appProject := argoprojiov1alpha1.AppProject{}
client := fake.NewClientBuilder().WithScheme(scheme).WithObjects(&appProject).Build()
got, err := gitGenerator.GenerateParams(&applicationSetInfo.Spec.Generators[0], &applicationSetInfo, client)
if testCaseCopy.expectedError != nil {
assert.EqualError(t, err, testCaseCopy.expectedError.Error())
require.EqualError(t, err, testCaseCopy.expectedError.Error())
} else {
assert.NoError(t, err)
require.NoError(t, err)
assert.Equal(t, testCaseCopy.expected, got)
}
@@ -352,7 +363,6 @@ func TestGitGenerateParamsFromDirectories(t *testing.T) {
}
func TestGitGenerateParamsFromDirectoriesGoTemplate(t *testing.T) {
cases := []struct {
name string
directories []argoprojiov1alpha1.GitDirectoryGeneratorItem
@@ -552,7 +562,6 @@ func TestGitGenerateParamsFromDirectoriesGoTemplate(t *testing.T) {
},
repoError: nil,
expected: []map[string]interface{}{
{
"path": map[string]interface{}{
"path": "app1",
@@ -613,9 +622,9 @@ func TestGitGenerateParamsFromDirectoriesGoTemplate(t *testing.T) {
argoCDServiceMock := mocks.Repos{}
argoCDServiceMock.On("GetDirectories", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(testCaseCopy.repoApps, testCaseCopy.repoError)
argoCDServiceMock.On("GetDirectories", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(testCaseCopy.repoApps, testCaseCopy.repoError)
var gitGenerator = NewGitGenerator(&argoCDServiceMock)
gitGenerator := NewGitGenerator(&argoCDServiceMock)
applicationSetInfo := argoprojiov1alpha1.ApplicationSet{
ObjectMeta: metav1.ObjectMeta{
Name: "set",
@@ -633,23 +642,28 @@ func TestGitGenerateParamsFromDirectoriesGoTemplate(t *testing.T) {
},
}
got, err := gitGenerator.GenerateParams(&applicationSetInfo.Spec.Generators[0], &applicationSetInfo)
scheme := runtime.NewScheme()
err := v1alpha1.AddToScheme(scheme)
require.NoError(t, err)
appProject := argoprojiov1alpha1.AppProject{}
client := fake.NewClientBuilder().WithScheme(scheme).WithObjects(&appProject).Build()
got, err := gitGenerator.GenerateParams(&applicationSetInfo.Spec.Generators[0], &applicationSetInfo, client)
if testCaseCopy.expectedError != nil {
assert.EqualError(t, err, testCaseCopy.expectedError.Error())
require.EqualError(t, err, testCaseCopy.expectedError.Error())
} else {
assert.NoError(t, err)
require.NoError(t, err)
assert.Equal(t, testCaseCopy.expected, got)
}
argoCDServiceMock.AssertExpectations(t)
})
}
}
func TestGitGenerateParamsFromFiles(t *testing.T) {
cases := []struct {
name string
// files is the list of paths/globs to match
@@ -972,10 +986,10 @@ cluster:
t.Parallel()
argoCDServiceMock := mocks.Repos{}
argoCDServiceMock.On("GetFiles", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).
argoCDServiceMock.On("GetFiles", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).
Return(testCaseCopy.repoFileContents, testCaseCopy.repoPathsError)
var gitGenerator = NewGitGenerator(&argoCDServiceMock)
gitGenerator := NewGitGenerator(&argoCDServiceMock)
applicationSetInfo := argoprojiov1alpha1.ApplicationSet{
ObjectMeta: metav1.ObjectMeta{
Name: "set",
@@ -992,13 +1006,20 @@ cluster:
},
}
got, err := gitGenerator.GenerateParams(&applicationSetInfo.Spec.Generators[0], &applicationSetInfo)
scheme := runtime.NewScheme()
err := v1alpha1.AddToScheme(scheme)
require.NoError(t, err)
appProject := argoprojiov1alpha1.AppProject{}
client := fake.NewClientBuilder().WithScheme(scheme).WithObjects(&appProject).Build()
got, err := gitGenerator.GenerateParams(&applicationSetInfo.Spec.Generators[0], &applicationSetInfo, client)
fmt.Println(got, err)
if testCaseCopy.expectedError != nil {
assert.EqualError(t, err, testCaseCopy.expectedError.Error())
require.EqualError(t, err, testCaseCopy.expectedError.Error())
} else {
assert.NoError(t, err)
require.NoError(t, err)
assert.ElementsMatch(t, testCaseCopy.expected, got)
}
@@ -1008,7 +1029,6 @@ cluster:
}
func TestGitGenerateParamsFromFilesGoTemplate(t *testing.T) {
cases := []struct {
name string
// files is the list of paths/globs to match
@@ -1322,10 +1342,10 @@ cluster:
t.Parallel()
argoCDServiceMock := mocks.Repos{}
argoCDServiceMock.On("GetFiles", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).
argoCDServiceMock.On("GetFiles", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).
Return(testCaseCopy.repoFileContents, testCaseCopy.repoPathsError)
var gitGenerator = NewGitGenerator(&argoCDServiceMock)
gitGenerator := NewGitGenerator(&argoCDServiceMock)
applicationSetInfo := argoprojiov1alpha1.ApplicationSet{
ObjectMeta: metav1.ObjectMeta{
Name: "set",
@@ -1342,13 +1362,20 @@ cluster:
},
}
got, err := gitGenerator.GenerateParams(&applicationSetInfo.Spec.Generators[0], &applicationSetInfo)
scheme := runtime.NewScheme()
err := v1alpha1.AddToScheme(scheme)
require.NoError(t, err)
appProject := argoprojiov1alpha1.AppProject{}
client := fake.NewClientBuilder().WithScheme(scheme).WithObjects(&appProject).Build()
got, err := gitGenerator.GenerateParams(&applicationSetInfo.Spec.Generators[0], &applicationSetInfo, client)
fmt.Println(got, err)
if testCaseCopy.expectedError != nil {
assert.EqualError(t, err, testCaseCopy.expectedError.Error())
require.EqualError(t, err, testCaseCopy.expectedError.Error())
} else {
assert.NoError(t, err)
require.NoError(t, err)
assert.ElementsMatch(t, testCaseCopy.expected, got)
}

View File

@@ -4,6 +4,8 @@ import (
"fmt"
"time"
"sigs.k8s.io/controller-runtime/pkg/client"
argoprojiov1alpha1 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
)
@@ -12,7 +14,7 @@ type Generator interface {
// GenerateParams interprets the ApplicationSet and generates all relevant parameters for the application template.
// The expected / desired list of parameters is returned, it then will be render and reconciled
// against the current state of the Applications in the cluster.
GenerateParams(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator, applicationSetInfo *argoprojiov1alpha1.ApplicationSet) ([]map[string]interface{}, error)
GenerateParams(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator, applicationSetInfo *argoprojiov1alpha1.ApplicationSet, client client.Client) ([]map[string]interface{}, error)
// GetRequeueAfter is the generator can controller the next reconciled loop
// In case there is more then one generator the time will be the minimum of the times.
@@ -23,8 +25,10 @@ type Generator interface {
GetTemplate(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator) *argoprojiov1alpha1.ApplicationSetTemplate
}
var EmptyAppSetGeneratorError = fmt.Errorf("ApplicationSet is empty")
var NoRequeueAfter time.Duration
var (
EmptyAppSetGeneratorError = fmt.Errorf("ApplicationSet is empty")
NoRequeueAfter time.Duration
)
// DefaultRequeueAfterSeconds is used when GetRequeueAfter is not specified, it is the default time to wait before the next reconcile loop
const (

View File

@@ -5,6 +5,7 @@ import (
"fmt"
"time"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/yaml"
argoprojiov1alpha1 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
@@ -12,8 +13,7 @@ import (
var _ Generator = (*ListGenerator)(nil)
type ListGenerator struct {
}
type ListGenerator struct{}
func NewListGenerator() Generator {
g := &ListGenerator{}
@@ -28,7 +28,7 @@ func (g *ListGenerator) GetTemplate(appSetGenerator *argoprojiov1alpha1.Applicat
return &appSetGenerator.List.Template
}
func (g *ListGenerator) GenerateParams(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator, appSet *argoprojiov1alpha1.ApplicationSet) ([]map[string]interface{}, error) {
func (g *ListGenerator) GenerateParams(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator, appSet *argoprojiov1alpha1.ApplicationSet, _ client.Client) ([]map[string]interface{}, error) {
if appSetGenerator == nil {
return nil, EmptyAppSetGeneratorError
}
@@ -44,7 +44,7 @@ func (g *ListGenerator) GenerateParams(appSetGenerator *argoprojiov1alpha1.Appli
var element map[string]interface{}
err := json.Unmarshal(tmpItem.Raw, &element)
if err != nil {
return nil, fmt.Errorf("error unmarshling list element %v", err)
return nil, fmt.Errorf("error unmarshling list element %w", err)
}
if appSet.Spec.GoTemplate {
@@ -59,14 +59,14 @@ func (g *ListGenerator) GenerateParams(appSetGenerator *argoprojiov1alpha1.Appli
for k, v := range values {
value, ok := v.(string)
if !ok {
return nil, fmt.Errorf("error parsing value as string %v", err)
return nil, fmt.Errorf("error parsing value as string %w", err)
}
params[fmt.Sprintf("values.%s", k)] = value
}
} else {
v, ok := value.(string)
if !ok {
return nil, fmt.Errorf("error parsing value as string %v", err)
return nil, fmt.Errorf("error parsing value as string %w", err)
}
params[key] = v
}
@@ -77,11 +77,10 @@ func (g *ListGenerator) GenerateParams(appSetGenerator *argoprojiov1alpha1.Appli
// Append elements from ElementsYaml to the response
if len(appSetGenerator.List.ElementsYaml) > 0 {
var yamlElements []map[string]interface{}
err := yaml.Unmarshal([]byte(appSetGenerator.List.ElementsYaml), &yamlElements)
if err != nil {
return nil, fmt.Errorf("error unmarshling decoded ElementsYaml %v", err)
return nil, fmt.Errorf("error unmarshling decoded ElementsYaml %w", err)
}
res = append(res, yamlElements...)
}

View File

@@ -4,6 +4,7 @@ import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -25,8 +26,7 @@ func TestGenerateListParams(t *testing.T) {
}
for _, testCase := range testCases {
var listGenerator = NewListGenerator()
listGenerator := NewListGenerator()
applicationSetInfo := argoprojiov1alpha1.ApplicationSet{
ObjectMeta: metav1.ObjectMeta{
@@ -38,11 +38,11 @@ func TestGenerateListParams(t *testing.T) {
got, err := listGenerator.GenerateParams(&argoprojiov1alpha1.ApplicationSetGenerator{
List: &argoprojiov1alpha1.ListGenerator{
Elements: testCase.elements,
}}, &applicationSetInfo)
},
}, &applicationSetInfo, nil)
assert.NoError(t, err)
require.NoError(t, err)
assert.ElementsMatch(t, testCase.expected, got)
}
}
@@ -61,8 +61,7 @@ func TestGenerateListParamsGoTemplate(t *testing.T) {
}
for _, testCase := range testCases {
var listGenerator = NewListGenerator()
listGenerator := NewListGenerator()
applicationSetInfo := argoprojiov1alpha1.ApplicationSet{
ObjectMeta: metav1.ObjectMeta{
@@ -76,9 +75,10 @@ func TestGenerateListParamsGoTemplate(t *testing.T) {
got, err := listGenerator.GenerateParams(&argoprojiov1alpha1.ApplicationSetGenerator{
List: &argoprojiov1alpha1.ListGenerator{
Elements: testCase.elements,
}}, &applicationSetInfo)
},
}, &applicationSetInfo, nil)
assert.NoError(t, err)
require.NoError(t, err)
assert.ElementsMatch(t, testCase.expected, got)
}
}

View File

@@ -5,6 +5,7 @@ import (
"time"
"github.com/imdario/mergo"
"sigs.k8s.io/controller-runtime/pkg/client"
"github.com/argoproj/argo-cd/v2/applicationset/utils"
argoprojiov1alpha1 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
@@ -32,8 +33,7 @@ func NewMatrixGenerator(supportedGenerators map[string]Generator) Generator {
return m
}
func (m *MatrixGenerator) GenerateParams(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator, appSet *argoprojiov1alpha1.ApplicationSet) ([]map[string]interface{}, error) {
func (m *MatrixGenerator) GenerateParams(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator, appSet *argoprojiov1alpha1.ApplicationSet, client client.Client) ([]map[string]interface{}, error) {
if appSetGenerator.Matrix == nil {
return nil, EmptyAppSetGeneratorError
}
@@ -48,17 +48,16 @@ func (m *MatrixGenerator) GenerateParams(appSetGenerator *argoprojiov1alpha1.App
res := []map[string]interface{}{}
g0, err := m.getParams(appSetGenerator.Matrix.Generators[0], appSet, nil)
g0, err := m.getParams(appSetGenerator.Matrix.Generators[0], appSet, nil, client)
if err != nil {
return nil, fmt.Errorf("error failed to get params for first generator in matrix generator: %w", err)
}
for _, a := range g0 {
g1, err := m.getParams(appSetGenerator.Matrix.Generators[1], appSet, a)
g1, err := m.getParams(appSetGenerator.Matrix.Generators[1], appSet, a, client)
if err != nil {
return nil, fmt.Errorf("failed to get params for second generator in the matrix generator: %w", err)
}
for _, b := range g1 {
if appSet.Spec.GoTemplate {
tmp := map[string]interface{}{}
if err := mergo.Merge(&tmp, b, mergo.WithOverride); err != nil {
@@ -81,7 +80,7 @@ func (m *MatrixGenerator) GenerateParams(appSetGenerator *argoprojiov1alpha1.App
return res, nil
}
func (m *MatrixGenerator) getParams(appSetBaseGenerator argoprojiov1alpha1.ApplicationSetNestedGenerator, appSet *argoprojiov1alpha1.ApplicationSet, params map[string]interface{}) ([]map[string]interface{}, error) {
func (m *MatrixGenerator) getParams(appSetBaseGenerator argoprojiov1alpha1.ApplicationSetNestedGenerator, appSet *argoprojiov1alpha1.ApplicationSet, params map[string]interface{}, client client.Client) ([]map[string]interface{}, error) {
matrixGen, err := getMatrixGenerator(appSetBaseGenerator)
if err != nil {
return nil, err
@@ -119,10 +118,10 @@ func (m *MatrixGenerator) getParams(appSetBaseGenerator argoprojiov1alpha1.Appli
m.supportedGenerators,
argoprojiov1alpha1.ApplicationSetTemplate{},
appSet,
params)
params,
client)
if err != nil {
return nil, fmt.Errorf("child generator returned an error on parameter generation: %v", err)
return nil, fmt.Errorf("child generator returned an error on parameter generation: %w", err)
}
if len(t) == 0 {
@@ -172,7 +171,6 @@ func (m *MatrixGenerator) GetRequeueAfter(appSetGenerator *argoprojiov1alpha1.Ap
} else {
return NoRequeueAfter
}
}
func getMatrixGenerator(r argoprojiov1alpha1.ApplicationSetNestedGenerator) (*argoprojiov1alpha1.MatrixGenerator, error) {

View File

@@ -19,11 +19,11 @@ import (
"github.com/stretchr/testify/mock"
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
"github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
argoprojiov1alpha1 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
)
func TestMatrixGenerate(t *testing.T) {
gitGenerator := &argoprojiov1alpha1.GitGenerator{
RepoURL: "RepoURL",
Revision: "Revision",
@@ -147,12 +147,11 @@ func TestMatrixGenerate(t *testing.T) {
}
for _, g := range testCaseCopy.baseGenerators {
gitGeneratorSpec := argoprojiov1alpha1.ApplicationSetGenerator{
Git: g.Git,
List: g.List,
}
genMock.On("GenerateParams", mock.AnythingOfType("*v1alpha1.ApplicationSetGenerator"), appSet).Return([]map[string]interface{}{
genMock.On("GenerateParams", mock.AnythingOfType("*v1alpha1.ApplicationSetGenerator"), appSet, mock.Anything).Return([]map[string]interface{}{
{
"path": "app1",
"path.basename": "app1",
@@ -169,7 +168,7 @@ func TestMatrixGenerate(t *testing.T) {
Return(&argoprojiov1alpha1.ApplicationSetTemplate{})
}
var matrixGenerator = NewMatrixGenerator(
matrixGenerator := NewMatrixGenerator(
map[string]Generator{
"Git": genMock,
"List": &ListGenerator{},
@@ -181,22 +180,19 @@ func TestMatrixGenerate(t *testing.T) {
Generators: testCaseCopy.baseGenerators,
Template: argoprojiov1alpha1.ApplicationSetTemplate{},
},
}, appSet)
}, appSet, nil)
if testCaseCopy.expectedErr != nil {
assert.ErrorIs(t, err, testCaseCopy.expectedErr)
require.ErrorIs(t, err, testCaseCopy.expectedErr)
} else {
assert.NoError(t, err)
require.NoError(t, err)
assert.Equal(t, testCaseCopy.expected, got)
}
})
}
}
func TestMatrixGenerateGoTemplate(t *testing.T) {
gitGenerator := &argoprojiov1alpha1.GitGenerator{
RepoURL: "RepoURL",
Revision: "Revision",
@@ -360,12 +356,11 @@ func TestMatrixGenerateGoTemplate(t *testing.T) {
}
for _, g := range testCaseCopy.baseGenerators {
gitGeneratorSpec := argoprojiov1alpha1.ApplicationSetGenerator{
Git: g.Git,
List: g.List,
}
genMock.On("GenerateParams", mock.AnythingOfType("*v1alpha1.ApplicationSetGenerator"), appSet).Return([]map[string]interface{}{
genMock.On("GenerateParams", mock.AnythingOfType("*v1alpha1.ApplicationSetGenerator"), appSet, mock.Anything).Return([]map[string]interface{}{
{
"path": map[string]string{
"path": "app1",
@@ -386,7 +381,7 @@ func TestMatrixGenerateGoTemplate(t *testing.T) {
Return(&argoprojiov1alpha1.ApplicationSetTemplate{})
}
var matrixGenerator = NewMatrixGenerator(
matrixGenerator := NewMatrixGenerator(
map[string]Generator{
"Git": genMock,
"List": &ListGenerator{},
@@ -398,22 +393,19 @@ func TestMatrixGenerateGoTemplate(t *testing.T) {
Generators: testCaseCopy.baseGenerators,
Template: argoprojiov1alpha1.ApplicationSetTemplate{},
},
}, appSet)
}, appSet, nil)
if testCaseCopy.expectedErr != nil {
assert.ErrorIs(t, err, testCaseCopy.expectedErr)
require.ErrorIs(t, err, testCaseCopy.expectedErr)
} else {
assert.NoError(t, err)
require.NoError(t, err)
assert.Equal(t, testCaseCopy.expected, got)
}
})
}
}
func TestMatrixGetRequeueAfter(t *testing.T) {
gitGenerator := &argoprojiov1alpha1.GitGenerator{
RepoURL: "RepoURL",
Revision: "Revision",
@@ -530,7 +522,7 @@ func TestMatrixGetRequeueAfter(t *testing.T) {
mock.On("GetRequeueAfter", &gitGeneratorSpec).Return(testCaseCopy.gitGetRequeueAfter, nil)
}
var matrixGenerator = NewMatrixGenerator(
matrixGenerator := NewMatrixGenerator(
map[string]Generator{
"Git": mock,
"List": &ListGenerator{},
@@ -548,9 +540,7 @@ func TestMatrixGetRequeueAfter(t *testing.T) {
})
assert.Equal(t, testCaseCopy.expected, got)
})
}
}
@@ -655,10 +645,9 @@ func TestInterpolatedMatrixGenerate(t *testing.T) {
fakeClient,
testCase.clientError,
}
var clusterGenerator = NewClusterGenerator(cl, context.Background(), appClientset, "namespace")
clusterGenerator := NewClusterGenerator(cl, context.Background(), appClientset, "namespace")
for _, g := range testCaseCopy.baseGenerators {
gitGeneratorSpec := argoprojiov1alpha1.ApplicationSetGenerator{
Git: g.Git,
Clusters: g.Clusters,
@@ -678,7 +667,7 @@ func TestInterpolatedMatrixGenerate(t *testing.T) {
genMock.On("GetTemplate", &gitGeneratorSpec).
Return(&argoprojiov1alpha1.ApplicationSetTemplate{})
}
var matrixGenerator = NewMatrixGenerator(
matrixGenerator := NewMatrixGenerator(
map[string]Generator{
"Git": genMock,
"Clusters": clusterGenerator,
@@ -690,15 +679,14 @@ func TestInterpolatedMatrixGenerate(t *testing.T) {
Generators: testCaseCopy.baseGenerators,
Template: argoprojiov1alpha1.ApplicationSetTemplate{},
},
}, appSet)
}, appSet, nil)
if testCaseCopy.expectedErr != nil {
assert.ErrorIs(t, err, testCaseCopy.expectedErr)
require.ErrorIs(t, err, testCaseCopy.expectedErr)
} else {
assert.NoError(t, err)
require.NoError(t, err)
assert.Equal(t, testCaseCopy.expected, got)
}
})
}
}
@@ -838,16 +826,14 @@ func TestInterpolatedMatrixGenerateGoTemplate(t *testing.T) {
fakeClient,
testCase.clientError,
}
var clusterGenerator = NewClusterGenerator(cl, context.Background(), appClientset, "namespace")
clusterGenerator := NewClusterGenerator(cl, context.Background(), appClientset, "namespace")
for _, g := range testCaseCopy.baseGenerators {
gitGeneratorSpec := argoprojiov1alpha1.ApplicationSetGenerator{
Git: g.Git,
Clusters: g.Clusters,
}
genMock.On("GenerateParams", mock.AnythingOfType("*v1alpha1.ApplicationSetGenerator"), appSet).Return([]map[string]interface{}{
{
"path": map[string]string{
"path": "examples/git-generator-files-discovery/cluster-config/dev/config.json",
@@ -866,7 +852,7 @@ func TestInterpolatedMatrixGenerateGoTemplate(t *testing.T) {
genMock.On("GetTemplate", &gitGeneratorSpec).
Return(&argoprojiov1alpha1.ApplicationSetTemplate{})
}
var matrixGenerator = NewMatrixGenerator(
matrixGenerator := NewMatrixGenerator(
map[string]Generator{
"Git": genMock,
"Clusters": clusterGenerator,
@@ -878,22 +864,19 @@ func TestInterpolatedMatrixGenerateGoTemplate(t *testing.T) {
Generators: testCaseCopy.baseGenerators,
Template: argoprojiov1alpha1.ApplicationSetTemplate{},
},
}, appSet)
}, appSet, nil)
if testCaseCopy.expectedErr != nil {
assert.ErrorIs(t, err, testCaseCopy.expectedErr)
require.ErrorIs(t, err, testCaseCopy.expectedErr)
} else {
assert.NoError(t, err)
require.NoError(t, err)
assert.Equal(t, testCaseCopy.expected, got)
}
})
}
}
func TestMatrixGenerateListElementsYaml(t *testing.T) {
gitGenerator := &argoprojiov1alpha1.GitGenerator{
RepoURL: "RepoURL",
Revision: "Revision",
@@ -997,7 +980,6 @@ func TestMatrixGenerateListElementsYaml(t *testing.T) {
}
for _, g := range testCaseCopy.baseGenerators {
gitGeneratorSpec := argoprojiov1alpha1.ApplicationSetGenerator{
Git: g.Git,
List: g.List,
@@ -1029,10 +1011,9 @@ func TestMatrixGenerateListElementsYaml(t *testing.T) {
}}, nil)
genMock.On("GetTemplate", &gitGeneratorSpec).
Return(&argoprojiov1alpha1.ApplicationSetTemplate{})
}
var matrixGenerator = NewMatrixGenerator(
matrixGenerator := NewMatrixGenerator(
map[string]Generator{
"Git": genMock,
"List": &ListGenerator{},
@@ -1044,17 +1025,15 @@ func TestMatrixGenerateListElementsYaml(t *testing.T) {
Generators: testCaseCopy.baseGenerators,
Template: argoprojiov1alpha1.ApplicationSetTemplate{},
},
}, appSet)
}, appSet, nil)
if testCaseCopy.expectedErr != nil {
assert.ErrorIs(t, err, testCaseCopy.expectedErr)
require.ErrorIs(t, err, testCaseCopy.expectedErr)
} else {
assert.NoError(t, err)
require.NoError(t, err)
assert.Equal(t, testCaseCopy.expected, got)
}
})
}
}
@@ -1068,7 +1047,7 @@ func (g *generatorMock) GetTemplate(appSetGenerator *argoprojiov1alpha1.Applicat
return args.Get(0).(*argoprojiov1alpha1.ApplicationSetTemplate)
}
func (g *generatorMock) GenerateParams(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator, appSet *argoprojiov1alpha1.ApplicationSet) ([]map[string]interface{}, error) {
func (g *generatorMock) GenerateParams(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator, appSet *argoprojiov1alpha1.ApplicationSet, _ client.Client) ([]map[string]interface{}, error) {
args := g.Called(appSetGenerator, appSet)
return args.Get(0).([]map[string]interface{}), args.Error(1)
@@ -1078,7 +1057,6 @@ func (g *generatorMock) GetRequeueAfter(appSetGenerator *argoprojiov1alpha1.Appl
args := g.Called(appSetGenerator)
return args.Get(0).(time.Duration)
}
func TestGitGenerator_GenerateParams_list_x_git_matrix_generator(t *testing.T) {
@@ -1095,7 +1073,7 @@ func TestGitGenerator_GenerateParams_list_x_git_matrix_generator(t *testing.T) {
// of that bug.
listGeneratorMock := &generatorMock{}
listGeneratorMock.On("GenerateParams", mock.AnythingOfType("*v1alpha1.ApplicationSetGenerator"), mock.AnythingOfType("*v1alpha1.ApplicationSet")).Return([]map[string]interface{}{
listGeneratorMock.On("GenerateParams", mock.AnythingOfType("*v1alpha1.ApplicationSetGenerator"), mock.AnythingOfType("*v1alpha1.ApplicationSet"), mock.Anything).Return([]map[string]interface{}{
{"some": "value"},
}, nil)
listGeneratorMock.On("GetTemplate", mock.AnythingOfType("*v1alpha1.ApplicationSetGenerator")).Return(&argoprojiov1alpha1.ApplicationSetTemplate{})
@@ -1108,7 +1086,7 @@ func TestGitGenerator_GenerateParams_list_x_git_matrix_generator(t *testing.T) {
}
repoServiceMock := &mocks.Repos{}
repoServiceMock.On("GetFiles", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(map[string][]byte{
repoServiceMock.On("GetFiles", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(map[string][]byte{
"some/path.json": []byte("test: content"),
}, nil)
gitGenerator := NewGitGenerator(repoServiceMock)
@@ -1134,9 +1112,17 @@ func TestGitGenerator_GenerateParams_list_x_git_matrix_generator(t *testing.T) {
},
},
}
scheme := runtime.NewScheme()
err := v1alpha1.AddToScheme(scheme)
require.NoError(t, err)
appProject := argoprojiov1alpha1.AppProject{}
client := fake.NewClientBuilder().WithScheme(scheme).WithObjects(&appProject).Build()
params, err := matrixGenerator.GenerateParams(&argoprojiov1alpha1.ApplicationSetGenerator{
Matrix: matrixGeneratorSpec,
}, &argoprojiov1alpha1.ApplicationSet{})
}, &argoprojiov1alpha1.ApplicationSet{}, client)
require.NoError(t, err)
assert.Equal(t, []map[string]interface{}{{
"path": "some",

View File

@@ -6,6 +6,7 @@ import (
"time"
"github.com/imdario/mergo"
"sigs.k8s.io/controller-runtime/pkg/client"
"github.com/argoproj/argo-cd/v2/applicationset/utils"
argoprojiov1alpha1 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
@@ -36,10 +37,10 @@ func NewMergeGenerator(supportedGenerators map[string]Generator) Generator {
// getParamSetsForAllGenerators generates params for each child generator in a MergeGenerator. Param sets are returned
// in slices ordered according to the order of the given generators.
func (m *MergeGenerator) getParamSetsForAllGenerators(generators []argoprojiov1alpha1.ApplicationSetNestedGenerator, appSet *argoprojiov1alpha1.ApplicationSet) ([][]map[string]interface{}, error) {
func (m *MergeGenerator) getParamSetsForAllGenerators(generators []argoprojiov1alpha1.ApplicationSetNestedGenerator, appSet *argoprojiov1alpha1.ApplicationSet, client client.Client) ([][]map[string]interface{}, error) {
var paramSets [][]map[string]interface{}
for i, generator := range generators {
generatorParamSets, err := m.getParams(generator, appSet)
generatorParamSets, err := m.getParams(generator, appSet, client)
if err != nil {
return nil, fmt.Errorf("error getting params from generator %d of %d: %w", i+1, len(generators), err)
}
@@ -50,7 +51,7 @@ func (m *MergeGenerator) getParamSetsForAllGenerators(generators []argoprojiov1a
}
// GenerateParams gets the params produced by the MergeGenerator.
func (m *MergeGenerator) GenerateParams(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator, appSet *argoprojiov1alpha1.ApplicationSet) ([]map[string]interface{}, error) {
func (m *MergeGenerator) GenerateParams(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator, appSet *argoprojiov1alpha1.ApplicationSet, client client.Client) ([]map[string]interface{}, error) {
if appSetGenerator.Merge == nil {
return nil, EmptyAppSetGeneratorError
}
@@ -59,7 +60,7 @@ func (m *MergeGenerator) GenerateParams(appSetGenerator *argoprojiov1alpha1.Appl
return nil, ErrLessThanTwoGeneratorsInMerge
}
paramSetsFromGenerators, err := m.getParamSetsForAllGenerators(appSetGenerator.Merge.Generators, appSet)
paramSetsFromGenerators, err := m.getParamSetsForAllGenerators(appSetGenerator.Merge.Generators, appSet, client)
if err != nil {
return nil, fmt.Errorf("error getting param sets from generators: %w", err)
}
@@ -77,7 +78,6 @@ func (m *MergeGenerator) GenerateParams(appSetGenerator *argoprojiov1alpha1.Appl
for mergeKeyValue, baseParamSet := range baseParamSetsByMergeKey {
if overrideParamSet, exists := paramSetsByMergeKey[mergeKeyValue]; exists {
if appSet.Spec.GoTemplate {
if err := mergo.Merge(&baseParamSet, overrideParamSet, mergo.WithOverride); err != nil {
return nil, fmt.Errorf("error merging base param set with override param set: %w", err)
@@ -95,7 +95,7 @@ func (m *MergeGenerator) GenerateParams(appSetGenerator *argoprojiov1alpha1.Appl
}
mergedParamSets := make([]map[string]interface{}, len(baseParamSetsByMergeKey))
var i = 0
i := 0
for _, mergedParamSet := range baseParamSetsByMergeKey {
mergedParamSets[i] = mergedParamSet
i += 1
@@ -138,7 +138,7 @@ func getParamSetsByMergeKey(mergeKeys []string, paramSets []map[string]interface
}
// getParams get the parameters generated by this generator.
func (m *MergeGenerator) getParams(appSetBaseGenerator argoprojiov1alpha1.ApplicationSetNestedGenerator, appSet *argoprojiov1alpha1.ApplicationSet) ([]map[string]interface{}, error) {
func (m *MergeGenerator) getParams(appSetBaseGenerator argoprojiov1alpha1.ApplicationSetNestedGenerator, appSet *argoprojiov1alpha1.ApplicationSet, client client.Client) ([]map[string]interface{}, error) {
matrixGen, err := getMatrixGenerator(appSetBaseGenerator)
if err != nil {
return nil, err
@@ -176,10 +176,9 @@ func (m *MergeGenerator) getParams(appSetBaseGenerator argoprojiov1alpha1.Applic
m.supportedGenerators,
argoprojiov1alpha1.ApplicationSetTemplate{},
appSet,
map[string]interface{}{})
map[string]interface{}{}, client)
if err != nil {
return nil, fmt.Errorf("child generator returned an error on parameter generation: %v", err)
return nil, fmt.Errorf("child generator returned an error on parameter generation: %w", err)
}
if len(t) == 0 {
@@ -227,7 +226,6 @@ func (m *MergeGenerator) GetRequeueAfter(appSetGenerator *argoprojiov1alpha1.App
} else {
return NoRequeueAfter
}
}
func getMergeGenerator(r argoprojiov1alpha1.ApplicationSetNestedGenerator) (*argoprojiov1alpha1.MergeGenerator, error) {

View File

@@ -6,6 +6,7 @@ import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
argoprojiov1alpha1 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
@@ -49,7 +50,6 @@ func listOfMapsToSet(maps []map[string]interface{}) (map[string]bool, error) {
}
func TestMergeGenerate(t *testing.T) {
testCases := []struct {
name string
baseGenerators []argoprojiov1alpha1.ApplicationSetNestedGenerator
@@ -156,7 +156,7 @@ func TestMergeGenerate(t *testing.T) {
appSet := &argoprojiov1alpha1.ApplicationSet{}
var mergeGenerator = NewMergeGenerator(
mergeGenerator := NewMergeGenerator(
map[string]Generator{
"List": &ListGenerator{},
"Matrix": &MatrixGenerator{
@@ -178,18 +178,18 @@ func TestMergeGenerate(t *testing.T) {
MergeKeys: testCaseCopy.mergeKeys,
Template: argoprojiov1alpha1.ApplicationSetTemplate{},
},
}, appSet)
}, appSet, nil)
if testCaseCopy.expectedErr != nil {
assert.EqualError(t, err, testCaseCopy.expectedErr.Error())
require.EqualError(t, err, testCaseCopy.expectedErr.Error())
} else {
expectedSet, err := listOfMapsToSet(testCaseCopy.expected)
assert.NoError(t, err)
require.NoError(t, err)
actualSet, err := listOfMapsToSet(got)
assert.NoError(t, err)
require.NoError(t, err)
assert.NoError(t, err)
require.NoError(t, err)
assert.Equal(t, expectedSet, actualSet)
}
})
@@ -197,7 +197,6 @@ func TestMergeGenerate(t *testing.T) {
}
func toAPIExtensionsJSON(t *testing.T, g interface{}) *apiextensionsv1.JSON {
resVal, err := json.Marshal(g)
if err != nil {
t.Error("unable to unmarshal json", g)
@@ -339,13 +338,11 @@ func TestParamSetsAreUniqueByMergeKeys(t *testing.T) {
got, err := getParamSetsByMergeKey(testCaseCopy.mergeKeys, testCaseCopy.paramSets)
if testCaseCopy.expectedErr != nil {
assert.EqualError(t, err, testCaseCopy.expectedErr.Error())
require.EqualError(t, err, testCaseCopy.expectedErr.Error())
} else {
assert.NoError(t, err)
require.NoError(t, err)
assert.Equal(t, testCaseCopy.expected, got)
}
})
}
}

View File

@@ -0,0 +1,100 @@
// Code generated by mockery v2.43.2. DO NOT EDIT.
package mocks
import (
client "sigs.k8s.io/controller-runtime/pkg/client"
mock "github.com/stretchr/testify/mock"
time "time"
v1alpha1 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
)
// Generator is an autogenerated mock type for the Generator type
type Generator struct {
mock.Mock
}
// GenerateParams provides a mock function with given fields: appSetGenerator, applicationSetInfo, _a2
func (_m *Generator) GenerateParams(appSetGenerator *v1alpha1.ApplicationSetGenerator, applicationSetInfo *v1alpha1.ApplicationSet, _a2 client.Client) ([]map[string]interface{}, error) {
ret := _m.Called(appSetGenerator, applicationSetInfo, _a2)
if len(ret) == 0 {
panic("no return value specified for GenerateParams")
}
var r0 []map[string]interface{}
var r1 error
if rf, ok := ret.Get(0).(func(*v1alpha1.ApplicationSetGenerator, *v1alpha1.ApplicationSet, client.Client) ([]map[string]interface{}, error)); ok {
return rf(appSetGenerator, applicationSetInfo, _a2)
}
if rf, ok := ret.Get(0).(func(*v1alpha1.ApplicationSetGenerator, *v1alpha1.ApplicationSet, client.Client) []map[string]interface{}); ok {
r0 = rf(appSetGenerator, applicationSetInfo, _a2)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]map[string]interface{})
}
}
if rf, ok := ret.Get(1).(func(*v1alpha1.ApplicationSetGenerator, *v1alpha1.ApplicationSet, client.Client) error); ok {
r1 = rf(appSetGenerator, applicationSetInfo, _a2)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// GetRequeueAfter provides a mock function with given fields: appSetGenerator
func (_m *Generator) GetRequeueAfter(appSetGenerator *v1alpha1.ApplicationSetGenerator) time.Duration {
ret := _m.Called(appSetGenerator)
if len(ret) == 0 {
panic("no return value specified for GetRequeueAfter")
}
var r0 time.Duration
if rf, ok := ret.Get(0).(func(*v1alpha1.ApplicationSetGenerator) time.Duration); ok {
r0 = rf(appSetGenerator)
} else {
r0 = ret.Get(0).(time.Duration)
}
return r0
}
// GetTemplate provides a mock function with given fields: appSetGenerator
func (_m *Generator) GetTemplate(appSetGenerator *v1alpha1.ApplicationSetGenerator) *v1alpha1.ApplicationSetTemplate {
ret := _m.Called(appSetGenerator)
if len(ret) == 0 {
panic("no return value specified for GetTemplate")
}
var r0 *v1alpha1.ApplicationSetTemplate
if rf, ok := ret.Get(0).(func(*v1alpha1.ApplicationSetGenerator) *v1alpha1.ApplicationSetTemplate); ok {
r0 = rf(appSetGenerator)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*v1alpha1.ApplicationSetTemplate)
}
}
return r0
}
// NewGenerator creates a new instance of Generator. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewGenerator(t interface {
mock.TestingT
Cleanup(func())
}) *Generator {
mock := &Generator{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}

View File

@@ -55,8 +55,7 @@ func (g *PluginGenerator) GetTemplate(appSetGenerator *argoprojiov1alpha1.Applic
return &appSetGenerator.Plugin.Template
}
func (g *PluginGenerator) GenerateParams(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator, applicationSetInfo *argoprojiov1alpha1.ApplicationSet) ([]map[string]interface{}, error) {
func (g *PluginGenerator) GenerateParams(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator, applicationSetInfo *argoprojiov1alpha1.ApplicationSet, _ client.Client) ([]map[string]interface{}, error) {
if appSetGenerator == nil {
return nil, EmptyAppSetGeneratorError
}
@@ -94,7 +93,7 @@ func (g *PluginGenerator) getPluginFromGenerator(ctx context.Context, appSetName
}
token, err := g.getToken(ctx, cm["token"])
if err != nil {
return nil, fmt.Errorf("error fetching Secret token: %v", err)
return nil, fmt.Errorf("error fetching Secret token: %w", err)
}
var requestTimeout int
@@ -117,7 +116,6 @@ func (g *PluginGenerator) generateParams(appSetGenerator *argoprojiov1alpha1.App
res := []map[string]interface{}{}
for _, objectFound := range objectsFound {
params := map[string]interface{}{}
if useGoTemplate {
@@ -152,7 +150,6 @@ func (g *PluginGenerator) generateParams(appSetGenerator *argoprojiov1alpha1.App
}
func (g *PluginGenerator) getToken(ctx context.Context, tokenRef string) (string, error) {
if tokenRef == "" || !strings.HasPrefix(tokenRef, "$") {
return "", fmt.Errorf("token is empty, or does not reference a secret key starting with '$': %v", tokenRef)
}
@@ -167,9 +164,8 @@ func (g *PluginGenerator) getToken(ctx context.Context, tokenRef string) (string
Namespace: g.namespace,
},
secret)
if err != nil {
return "", fmt.Errorf("error fetching secret %s/%s: %v", g.namespace, secretName, err)
return "", fmt.Errorf("error fetching secret %s/%s: %w", g.namespace, secretName, err)
}
secretValues := make(map[string]string, len(secret.Data))
@@ -192,7 +188,6 @@ func (g *PluginGenerator) getConfigMap(ctx context.Context, configMapRef string)
Namespace: g.namespace,
},
cm)
if err != nil {
return nil, err
}

View File

@@ -631,9 +631,7 @@ func TestPluginGenerateParams(t *testing.T) {
ctx := context.Background()
for _, testCase := range testCases {
t.Run(testCase.name, func(t *testing.T) {
generatorConfig := argoprojiov1alpha1.ApplicationSetGenerator{
Plugin: &argoprojiov1alpha1.PluginGenerator{
ConfigMapRef: argoprojiov1alpha1.PluginConfigMapRef{Name: testCase.configmap.Name},
@@ -645,10 +643,9 @@ func TestPluginGenerateParams(t *testing.T) {
}
handler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
authHeader := r.Header.Get("Authorization")
_, tokenKey := plugin.ParseSecretKey(testCase.configmap.Data["token"])
expectedToken := testCase.secret.Data[strings.Replace(tokenKey, "$", "", -1)]
expectedToken := testCase.secret.Data[strings.ReplaceAll(tokenKey, "$", "")]
if authHeader != "Bearer "+string(expectedToken) {
w.WriteHeader(http.StatusUnauthorized)
return
@@ -657,7 +654,7 @@ func TestPluginGenerateParams(t *testing.T) {
w.Header().Set("Content-Type", "application/json")
_, err := w.Write(testCase.content)
if err != nil {
assert.NoError(t, fmt.Errorf("Error Write %v", err))
require.NoError(t, fmt.Errorf("Error Write %w", err))
}
})
@@ -673,7 +670,7 @@ func TestPluginGenerateParams(t *testing.T) {
fakeClientWithCache := fake.NewClientBuilder().WithObjects([]client.Object{testCase.configmap, testCase.secret}...).Build()
var pluginGenerator = NewPluginGenerator(fakeClientWithCache, ctx, fakeClient, "default")
pluginGenerator := NewPluginGenerator(fakeClientWithCache, ctx, fakeClient, "default")
applicationSetInfo := argoprojiov1alpha1.ApplicationSet{
ObjectMeta: metav1.ObjectMeta{
@@ -684,16 +681,15 @@ func TestPluginGenerateParams(t *testing.T) {
},
}
got, err := pluginGenerator.GenerateParams(&generatorConfig, &applicationSetInfo)
got, err := pluginGenerator.GenerateParams(&generatorConfig, &applicationSetInfo, nil)
if err != nil {
fmt.Println(err)
}
if testCase.expectedError != nil {
assert.EqualError(t, err, testCase.expectedError.Error())
require.EqualError(t, err, testCase.expectedError.Error())
} else {
assert.NoError(t, err)
require.NoError(t, err)
expectedJson, err := json.Marshal(testCase.expected)
require.NoError(t, err)
gotJson, err := json.Marshal(got)

View File

@@ -6,12 +6,12 @@ import (
"strconv"
"time"
corev1 "k8s.io/api/core/v1"
"sigs.k8s.io/controller-runtime/pkg/client"
"github.com/gosimple/slug"
pullrequest "github.com/argoproj/argo-cd/v2/applicationset/services/pull_request"
"github.com/argoproj/argo-cd/v2/applicationset/utils"
argoprojiov1alpha1 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
)
@@ -24,19 +24,13 @@ const (
type PullRequestGenerator struct {
client client.Client
selectServiceProviderFunc func(context.Context, *argoprojiov1alpha1.PullRequestGenerator, *argoprojiov1alpha1.ApplicationSet) (pullrequest.PullRequestService, error)
auth SCMAuthProviders
scmRootCAPath string
allowedSCMProviders []string
enableSCMProviders bool
SCMConfig
}
func NewPullRequestGenerator(client client.Client, auth SCMAuthProviders, scmRootCAPath string, allowedScmProviders []string, enableSCMProviders bool) Generator {
func NewPullRequestGenerator(client client.Client, scmConfig SCMConfig) Generator {
g := &PullRequestGenerator{
client: client,
auth: auth,
scmRootCAPath: scmRootCAPath,
allowedSCMProviders: allowedScmProviders,
enableSCMProviders: enableSCMProviders,
client: client,
SCMConfig: scmConfig,
}
g.selectServiceProviderFunc = g.selectServiceProvider
return g
@@ -56,7 +50,7 @@ func (g *PullRequestGenerator) GetTemplate(appSetGenerator *argoprojiov1alpha1.A
return &appSetGenerator.PullRequest.Template
}
func (g *PullRequestGenerator) GenerateParams(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator, applicationSetInfo *argoprojiov1alpha1.ApplicationSet) ([]map[string]interface{}, error) {
func (g *PullRequestGenerator) GenerateParams(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator, applicationSetInfo *argoprojiov1alpha1.ApplicationSet, _ client.Client) ([]map[string]interface{}, error) {
if appSetGenerator == nil {
return nil, EmptyAppSetGeneratorError
}
@@ -73,7 +67,7 @@ func (g *PullRequestGenerator) GenerateParams(appSetGenerator *argoprojiov1alpha
pulls, err := pullrequest.ListPullRequests(ctx, svc, appSetGenerator.PullRequest.Filters)
if err != nil {
return nil, fmt.Errorf("error listing repos: %v", err)
return nil, fmt.Errorf("error listing repos: %w", err)
}
params := make([]map[string]interface{}, 0, len(pulls))
@@ -103,6 +97,7 @@ func (g *PullRequestGenerator) GenerateParams(appSetGenerator *argoprojiov1alpha
paramMap := map[string]interface{}{
"number": strconv.Itoa(pull.Number),
"title": pull.Title,
"branch": pull.Branch,
"branch_slug": slug.Make(pull.Branch),
"target_branch": pull.TargetBranch,
@@ -110,6 +105,7 @@ func (g *PullRequestGenerator) GenerateParams(appSetGenerator *argoprojiov1alpha
"head_sha": pull.HeadSHA,
"head_short_sha": pull.HeadSHA[:shortSHALength],
"head_short_sha_7": pull.HeadSHA[:shortSHALength7],
"author": pull.Author,
}
// PR lables will only be supported for Go Template appsets, since fasttemplate will be deprecated.
@@ -135,44 +131,66 @@ func (g *PullRequestGenerator) selectServiceProvider(ctx context.Context, genera
}
if generatorConfig.GitLab != nil {
providerConfig := generatorConfig.GitLab
token, err := g.getSecretRef(ctx, providerConfig.TokenRef, applicationSetInfo.Namespace)
if err != nil {
return nil, fmt.Errorf("error fetching Secret token: %v", err)
var caCerts []byte
var prErr error
if providerConfig.CARef != nil {
caCerts, prErr = utils.GetConfigMapData(ctx, g.client, providerConfig.CARef, applicationSetInfo.Namespace)
if prErr != nil {
return nil, fmt.Errorf("error fetching CA certificates from ConfigMap: %w", prErr)
}
}
return pullrequest.NewGitLabService(ctx, token, providerConfig.API, providerConfig.Project, providerConfig.Labels, providerConfig.PullRequestState, g.scmRootCAPath, providerConfig.Insecure)
token, err := utils.GetSecretRef(ctx, g.client, providerConfig.TokenRef, applicationSetInfo.Namespace)
if err != nil {
return nil, fmt.Errorf("error fetching Secret token: %w", err)
}
return pullrequest.NewGitLabService(ctx, token, providerConfig.API, providerConfig.Project, providerConfig.Labels, providerConfig.PullRequestState, g.scmRootCAPath, providerConfig.Insecure, caCerts)
}
if generatorConfig.Gitea != nil {
providerConfig := generatorConfig.Gitea
token, err := g.getSecretRef(ctx, providerConfig.TokenRef, applicationSetInfo.Namespace)
token, err := utils.GetSecretRef(ctx, g.client, providerConfig.TokenRef, applicationSetInfo.Namespace)
if err != nil {
return nil, fmt.Errorf("error fetching Secret token: %v", err)
return nil, fmt.Errorf("error fetching Secret token: %w", err)
}
return pullrequest.NewGiteaService(ctx, token, providerConfig.API, providerConfig.Owner, providerConfig.Repo, providerConfig.Insecure)
}
if generatorConfig.BitbucketServer != nil {
providerConfig := generatorConfig.BitbucketServer
if providerConfig.BasicAuth != nil {
password, err := g.getSecretRef(ctx, providerConfig.BasicAuth.PasswordRef, applicationSetInfo.Namespace)
if err != nil {
return nil, fmt.Errorf("error fetching Secret token: %v", err)
var caCerts []byte
var prErr error
if providerConfig.CARef != nil {
caCerts, prErr = utils.GetConfigMapData(ctx, g.client, providerConfig.CARef, applicationSetInfo.Namespace)
if prErr != nil {
return nil, fmt.Errorf("error fetching CA certificates from ConfigMap: %w", prErr)
}
return pullrequest.NewBitbucketServiceBasicAuth(ctx, providerConfig.BasicAuth.Username, password, providerConfig.API, providerConfig.Project, providerConfig.Repo)
}
if providerConfig.BearerToken != nil {
appToken, err := utils.GetSecretRef(ctx, g.client, providerConfig.BearerToken.TokenRef, applicationSetInfo.Namespace)
if err != nil {
return nil, fmt.Errorf("error fetching Secret Bearer token: %w", err)
}
return pullrequest.NewBitbucketServiceBearerToken(ctx, providerConfig.API, appToken, providerConfig.Project, providerConfig.Repo, g.scmRootCAPath, providerConfig.Insecure, caCerts)
} else if providerConfig.BasicAuth != nil {
password, err := utils.GetSecretRef(ctx, g.client, providerConfig.BasicAuth.PasswordRef, applicationSetInfo.Namespace)
if err != nil {
return nil, fmt.Errorf("error fetching Secret token: %w", err)
}
return pullrequest.NewBitbucketServiceBasicAuth(ctx, providerConfig.BasicAuth.Username, password, providerConfig.API, providerConfig.Project, providerConfig.Repo, g.scmRootCAPath, providerConfig.Insecure, caCerts)
} else {
return pullrequest.NewBitbucketServiceNoAuth(ctx, providerConfig.API, providerConfig.Project, providerConfig.Repo)
return pullrequest.NewBitbucketServiceNoAuth(ctx, providerConfig.API, providerConfig.Project, providerConfig.Repo, g.scmRootCAPath, providerConfig.Insecure, caCerts)
}
}
if generatorConfig.Bitbucket != nil {
providerConfig := generatorConfig.Bitbucket
if providerConfig.BearerToken != nil {
appToken, err := g.getSecretRef(ctx, providerConfig.BearerToken.TokenRef, applicationSetInfo.Namespace)
appToken, err := utils.GetSecretRef(ctx, g.client, providerConfig.BearerToken.TokenRef, applicationSetInfo.Namespace)
if err != nil {
return nil, fmt.Errorf("error fetching Secret Bearer token: %v", err)
return nil, fmt.Errorf("error fetching Secret Bearer token: %w", err)
}
return pullrequest.NewBitbucketCloudServiceBearerToken(providerConfig.API, appToken, providerConfig.Owner, providerConfig.Repo)
} else if providerConfig.BasicAuth != nil {
password, err := g.getSecretRef(ctx, providerConfig.BasicAuth.PasswordRef, applicationSetInfo.Namespace)
password, err := utils.GetSecretRef(ctx, g.client, providerConfig.BasicAuth.PasswordRef, applicationSetInfo.Namespace)
if err != nil {
return nil, fmt.Errorf("error fetching Secret token: %v", err)
return nil, fmt.Errorf("error fetching Secret token: %w", err)
}
return pullrequest.NewBitbucketCloudServiceBasicAuth(providerConfig.API, providerConfig.BasicAuth.Username, password, providerConfig.Owner, providerConfig.Repo)
} else {
@@ -181,9 +199,9 @@ func (g *PullRequestGenerator) selectServiceProvider(ctx context.Context, genera
}
if generatorConfig.AzureDevOps != nil {
providerConfig := generatorConfig.AzureDevOps
token, err := g.getSecretRef(ctx, providerConfig.TokenRef, applicationSetInfo.Namespace)
token, err := utils.GetSecretRef(ctx, g.client, providerConfig.TokenRef, applicationSetInfo.Namespace)
if err != nil {
return nil, fmt.Errorf("error fetching Secret token: %v", err)
return nil, fmt.Errorf("error fetching Secret token: %w", err)
}
return pullrequest.NewAzureDevOpsService(ctx, token, providerConfig.API, providerConfig.Organization, providerConfig.Project, providerConfig.Repo, providerConfig.Labels)
}
@@ -193,41 +211,17 @@ func (g *PullRequestGenerator) selectServiceProvider(ctx context.Context, genera
func (g *PullRequestGenerator) github(ctx context.Context, cfg *argoprojiov1alpha1.PullRequestGeneratorGithub, applicationSetInfo *argoprojiov1alpha1.ApplicationSet) (pullrequest.PullRequestService, error) {
// use an app if it was configured
if cfg.AppSecretName != "" {
auth, err := g.auth.GitHubApps.GetAuthSecret(ctx, cfg.AppSecretName)
auth, err := g.GitHubApps.GetAuthSecret(ctx, cfg.AppSecretName)
if err != nil {
return nil, fmt.Errorf("error getting GitHub App secret: %v", err)
return nil, fmt.Errorf("error getting GitHub App secret: %w", err)
}
return pullrequest.NewGithubAppService(*auth, cfg.API, cfg.Owner, cfg.Repo, cfg.Labels)
}
// always default to token, even if not set (public access)
token, err := g.getSecretRef(ctx, cfg.TokenRef, applicationSetInfo.Namespace)
token, err := utils.GetSecretRef(ctx, g.client, cfg.TokenRef, applicationSetInfo.Namespace)
if err != nil {
return nil, fmt.Errorf("error fetching Secret token: %v", err)
return nil, fmt.Errorf("error fetching Secret token: %w", err)
}
return pullrequest.NewGithubService(ctx, token, cfg.API, cfg.Owner, cfg.Repo, cfg.Labels)
}
// getSecretRef gets the value of the key for the specified Secret resource.
func (g *PullRequestGenerator) getSecretRef(ctx context.Context, ref *argoprojiov1alpha1.SecretRef, namespace string) (string, error) {
if ref == nil {
return "", nil
}
secret := &corev1.Secret{}
err := g.client.Get(
ctx,
client.ObjectKey{
Name: ref.SecretName,
Namespace: namespace,
},
secret)
if err != nil {
return "", fmt.Errorf("error fetching secret %s/%s: %v", namespace, ref.SecretName, err)
}
tokenBytes, ok := secret.Data[ref.Key]
if !ok {
return "", fmt.Errorf("key %q in secret %s/%s not found", ref.Key, namespace, ref.SecretName)
}
return string(tokenBytes), nil
}

View File

@@ -6,9 +6,8 @@ import (
"testing"
"github.com/stretchr/testify/assert"
corev1 "k8s.io/api/core/v1"
"github.com/stretchr/testify/require"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/controller-runtime/pkg/client/fake"
pullrequest "github.com/argoproj/argo-cd/v2/applicationset/services/pull_request"
argoprojiov1alpha1 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
@@ -29,9 +28,11 @@ func TestPullRequestGithubGenerateParams(t *testing.T) {
[]*pullrequest.PullRequest{
{
Number: 1,
Title: "title1",
Branch: "branch1",
TargetBranch: "master",
HeadSHA: "089d92cbf9ff857a39e6feccd32798ca700fb958",
Author: "testName",
},
},
nil,
@@ -40,6 +41,7 @@ func TestPullRequestGithubGenerateParams(t *testing.T) {
expected: []map[string]interface{}{
{
"number": "1",
"title": "title1",
"branch": "branch1",
"branch_slug": "branch1",
"target_branch": "master",
@@ -47,6 +49,7 @@ func TestPullRequestGithubGenerateParams(t *testing.T) {
"head_sha": "089d92cbf9ff857a39e6feccd32798ca700fb958",
"head_short_sha": "089d92cb",
"head_short_sha_7": "089d92c",
"author": "testName",
},
},
expectedErr: nil,
@@ -58,9 +61,11 @@ func TestPullRequestGithubGenerateParams(t *testing.T) {
[]*pullrequest.PullRequest{
{
Number: 2,
Title: "title2",
Branch: "feat/areally+long_pull_request_name_to_test_argo_slugification_and_branch_name_shortening_feature",
TargetBranch: "feat/anotherreally+long_pull_request_name_to_test_argo_slugification_and_branch_name_shortening_feature",
HeadSHA: "9b34ff5bd418e57d58891eb0aa0728043ca1e8be",
Author: "testName",
},
},
nil,
@@ -69,6 +74,7 @@ func TestPullRequestGithubGenerateParams(t *testing.T) {
expected: []map[string]interface{}{
{
"number": "2",
"title": "title2",
"branch": "feat/areally+long_pull_request_name_to_test_argo_slugification_and_branch_name_shortening_feature",
"branch_slug": "feat-areally-long-pull-request-name-to-test-argo",
"target_branch": "feat/anotherreally+long_pull_request_name_to_test_argo_slugification_and_branch_name_shortening_feature",
@@ -76,6 +82,7 @@ func TestPullRequestGithubGenerateParams(t *testing.T) {
"head_sha": "9b34ff5bd418e57d58891eb0aa0728043ca1e8be",
"head_short_sha": "9b34ff5b",
"head_short_sha_7": "9b34ff5",
"author": "testName",
},
},
expectedErr: nil,
@@ -87,9 +94,11 @@ func TestPullRequestGithubGenerateParams(t *testing.T) {
[]*pullrequest.PullRequest{
{
Number: 1,
Title: "title1",
Branch: "a-very-short-sha",
TargetBranch: "master",
HeadSHA: "abcd",
Author: "testName",
},
},
nil,
@@ -98,6 +107,7 @@ func TestPullRequestGithubGenerateParams(t *testing.T) {
expected: []map[string]interface{}{
{
"number": "1",
"title": "title1",
"branch": "a-very-short-sha",
"branch_slug": "a-very-short-sha",
"target_branch": "master",
@@ -105,6 +115,7 @@ func TestPullRequestGithubGenerateParams(t *testing.T) {
"head_sha": "abcd",
"head_short_sha": "abcd",
"head_short_sha_7": "abcd",
"author": "testName",
},
},
expectedErr: nil,
@@ -127,10 +138,12 @@ func TestPullRequestGithubGenerateParams(t *testing.T) {
[]*pullrequest.PullRequest{
{
Number: 1,
Title: "title1",
Branch: "branch1",
TargetBranch: "master",
HeadSHA: "089d92cbf9ff857a39e6feccd32798ca700fb958",
Labels: []string{"preview"},
Author: "testName",
},
},
nil,
@@ -139,6 +152,7 @@ func TestPullRequestGithubGenerateParams(t *testing.T) {
expected: []map[string]interface{}{
{
"number": "1",
"title": "title1",
"branch": "branch1",
"branch_slug": "branch1",
"target_branch": "master",
@@ -147,6 +161,7 @@ func TestPullRequestGithubGenerateParams(t *testing.T) {
"head_short_sha": "089d92cb",
"head_short_sha_7": "089d92c",
"labels": []string{"preview"},
"author": "testName",
},
},
expectedErr: nil,
@@ -164,10 +179,12 @@ func TestPullRequestGithubGenerateParams(t *testing.T) {
[]*pullrequest.PullRequest{
{
Number: 1,
Title: "title1",
Branch: "branch1",
TargetBranch: "master",
HeadSHA: "089d92cbf9ff857a39e6feccd32798ca700fb958",
Labels: []string{"preview"},
Author: "testName",
},
},
nil,
@@ -176,6 +193,7 @@ func TestPullRequestGithubGenerateParams(t *testing.T) {
expected: []map[string]interface{}{
{
"number": "1",
"title": "title1",
"branch": "branch1",
"branch_slug": "branch1",
"target_branch": "master",
@@ -183,6 +201,7 @@ func TestPullRequestGithubGenerateParams(t *testing.T) {
"head_sha": "089d92cbf9ff857a39e6feccd32798ca700fb958",
"head_short_sha": "089d92cb",
"head_short_sha_7": "089d92c",
"author": "testName",
},
},
expectedErr: nil,
@@ -203,82 +222,20 @@ func TestPullRequestGithubGenerateParams(t *testing.T) {
PullRequest: &argoprojiov1alpha1.PullRequestGenerator{},
}
got, gotErr := gen.GenerateParams(&generatorConfig, &c.applicationSet)
assert.Equal(t, c.expectedErr, gotErr)
got, gotErr := gen.GenerateParams(&generatorConfig, &c.applicationSet, nil)
if c.expectedErr != nil {
assert.Equal(t, c.expectedErr.Error(), gotErr.Error())
} else {
require.NoError(t, gotErr)
}
assert.ElementsMatch(t, c.expected, got)
}
}
func TestPullRequestGetSecretRef(t *testing.T) {
secret := &corev1.Secret{
ObjectMeta: metav1.ObjectMeta{Name: "test-secret", Namespace: "test"},
Data: map[string][]byte{
"my-token": []byte("secret"),
},
}
gen := &PullRequestGenerator{client: fake.NewClientBuilder().WithObjects(secret).Build()}
ctx := context.Background()
cases := []struct {
name, namespace, token string
ref *argoprojiov1alpha1.SecretRef
hasError bool
}{
{
name: "valid ref",
ref: &argoprojiov1alpha1.SecretRef{SecretName: "test-secret", Key: "my-token"},
namespace: "test",
token: "secret",
hasError: false,
},
{
name: "nil ref",
ref: nil,
namespace: "test",
token: "",
hasError: false,
},
{
name: "wrong name",
ref: &argoprojiov1alpha1.SecretRef{SecretName: "other", Key: "my-token"},
namespace: "test",
token: "",
hasError: true,
},
{
name: "wrong key",
ref: &argoprojiov1alpha1.SecretRef{SecretName: "test-secret", Key: "other-token"},
namespace: "test",
token: "",
hasError: true,
},
{
name: "wrong namespace",
ref: &argoprojiov1alpha1.SecretRef{SecretName: "test-secret", Key: "my-token"},
namespace: "other",
token: "",
hasError: true,
},
}
for _, c := range cases {
t.Run(c.name, func(t *testing.T) {
token, err := gen.getSecretRef(ctx, c.ref, c.namespace)
if c.hasError {
assert.NotNil(t, err)
} else {
assert.Nil(t, err)
}
assert.Equal(t, c.token, token)
})
}
}
func TestAllowedSCMProviderPullRequest(t *testing.T) {
cases := []struct {
name string
providerConfig *argoprojiov1alpha1.PullRequestGenerator
expectedError error
}{
{
name: "Error Github",
@@ -287,7 +244,6 @@ func TestAllowedSCMProviderPullRequest(t *testing.T) {
API: "https://myservice.mynamespace.svc.cluster.local",
},
},
expectedError: &ErrDisallowedSCMProvider{},
},
{
name: "Error Gitlab",
@@ -296,7 +252,6 @@ func TestAllowedSCMProviderPullRequest(t *testing.T) {
API: "https://myservice.mynamespace.svc.cluster.local",
},
},
expectedError: &ErrDisallowedSCMProvider{},
},
{
name: "Error Gitea",
@@ -305,7 +260,6 @@ func TestAllowedSCMProviderPullRequest(t *testing.T) {
API: "https://myservice.mynamespace.svc.cluster.local",
},
},
expectedError: &ErrDisallowedSCMProvider{},
},
{
name: "Error Bitbucket",
@@ -314,7 +268,6 @@ func TestAllowedSCMProviderPullRequest(t *testing.T) {
API: "https://myservice.mynamespace.svc.cluster.local",
},
},
expectedError: &ErrDisallowedSCMProvider{},
},
}
@@ -324,13 +277,13 @@ func TestAllowedSCMProviderPullRequest(t *testing.T) {
t.Run(testCaseCopy.name, func(t *testing.T) {
t.Parallel()
pullRequestGenerator := NewPullRequestGenerator(nil, SCMAuthProviders{}, "", []string{
pullRequestGenerator := NewPullRequestGenerator(nil, NewSCMConfig("", []string{
"github.myorg.com",
"gitlab.myorg.com",
"gitea.myorg.com",
"bitbucket.myorg.com",
"azuredevops.myorg.com",
}, true)
}, true, nil))
applicationSetInfo := argoprojiov1alpha1.ApplicationSet{
ObjectMeta: metav1.ObjectMeta{
@@ -343,16 +296,17 @@ func TestAllowedSCMProviderPullRequest(t *testing.T) {
},
}
_, err := pullRequestGenerator.GenerateParams(&applicationSetInfo.Spec.Generators[0], &applicationSetInfo)
_, err := pullRequestGenerator.GenerateParams(&applicationSetInfo.Spec.Generators[0], &applicationSetInfo, nil)
assert.Error(t, err, "Must return an error")
assert.ErrorAs(t, err, testCaseCopy.expectedError)
require.Error(t, err, "Must return an error")
var expectedError ErrDisallowedSCMProvider
assert.ErrorAs(t, err, &expectedError)
})
}
}
func TestSCMProviderDisabled_PRGenerator(t *testing.T) {
generator := NewPullRequestGenerator(nil, SCMAuthProviders{}, "", []string{}, false)
generator := NewPullRequestGenerator(nil, NewSCMConfig("", []string{}, false, nil))
applicationSetInfo := argoprojiov1alpha1.ApplicationSet{
ObjectMeta: metav1.ObjectMeta{
@@ -369,6 +323,6 @@ func TestSCMProviderDisabled_PRGenerator(t *testing.T) {
},
}
_, err := generator.GenerateParams(&applicationSetInfo.Spec.Generators[0], &applicationSetInfo)
_, err := generator.GenerateParams(&applicationSetInfo.Spec.Generators[0], &applicationSetInfo, nil)
assert.ErrorIs(t, err, ErrSCMProvidersDisabled)
}

View File

@@ -7,7 +7,6 @@ import (
"strings"
"time"
corev1 "k8s.io/api/core/v1"
"sigs.k8s.io/controller-runtime/pkg/client"
log "github.com/sirupsen/logrus"
@@ -29,29 +28,36 @@ type SCMProviderGenerator struct {
client client.Client
// Testing hooks.
overrideProvider scm_provider.SCMProviderService
SCMAuthProviders
SCMConfig
}
type SCMConfig struct {
scmRootCAPath string
allowedSCMProviders []string
enableSCMProviders bool
GitHubApps github_app_auth.Credentials
}
type SCMAuthProviders struct {
GitHubApps github_app_auth.Credentials
}
func NewSCMProviderGenerator(client client.Client, providers SCMAuthProviders, scmRootCAPath string, allowedSCMProviders []string, enableSCMProviders bool) Generator {
return &SCMProviderGenerator{
client: client,
SCMAuthProviders: providers,
func NewSCMConfig(scmRootCAPath string, allowedSCMProviders []string, enableSCMProviders bool, gitHubApps github_app_auth.Credentials) SCMConfig {
return SCMConfig{
scmRootCAPath: scmRootCAPath,
allowedSCMProviders: allowedSCMProviders,
enableSCMProviders: enableSCMProviders,
GitHubApps: gitHubApps,
}
}
func NewSCMProviderGenerator(client client.Client, scmConfig SCMConfig) Generator {
return &SCMProviderGenerator{
client: client,
SCMConfig: scmConfig,
}
}
// Testing generator
func NewTestSCMProviderGenerator(overrideProvider scm_provider.SCMProviderService) Generator {
return &SCMProviderGenerator{overrideProvider: overrideProvider, enableSCMProviders: true}
return &SCMProviderGenerator{overrideProvider: overrideProvider, SCMConfig: SCMConfig{
enableSCMProviders: true,
}}
}
func (g *SCMProviderGenerator) GetRequeueAfter(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator) time.Duration {
@@ -108,7 +114,7 @@ func ScmProviderAllowed(applicationSetInfo *argoprojiov1alpha1.ApplicationSet, g
return NewErrDisallowedSCMProvider(url, allowedScmProviders)
}
func (g *SCMProviderGenerator) GenerateParams(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator, applicationSetInfo *argoprojiov1alpha1.ApplicationSet) ([]map[string]interface{}, error) {
func (g *SCMProviderGenerator) GenerateParams(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator, applicationSetInfo *argoprojiov1alpha1.ApplicationSet, _ client.Client) ([]map[string]interface{}, error) {
if appSetGenerator == nil {
return nil, EmptyAppSetGeneratorError
}
@@ -139,61 +145,83 @@ func (g *SCMProviderGenerator) GenerateParams(appSetGenerator *argoprojiov1alpha
return nil, fmt.Errorf("scm provider: %w", err)
}
} else if providerConfig.Gitlab != nil {
token, err := g.getSecretRef(ctx, providerConfig.Gitlab.TokenRef, applicationSetInfo.Namespace)
if err != nil {
return nil, fmt.Errorf("error fetching Gitlab token: %v", err)
providerConfig := providerConfig.Gitlab
var caCerts []byte
var scmError error
if providerConfig.CARef != nil {
caCerts, scmError = utils.GetConfigMapData(ctx, g.client, providerConfig.CARef, applicationSetInfo.Namespace)
if scmError != nil {
return nil, fmt.Errorf("error fetching CA certificates from ConfigMap: %w", scmError)
}
}
provider, err = scm_provider.NewGitlabProvider(ctx, providerConfig.Gitlab.Group, token, providerConfig.Gitlab.API, providerConfig.Gitlab.AllBranches, providerConfig.Gitlab.IncludeSubgroups, providerConfig.Gitlab.WillIncludeSharedProjects(), providerConfig.Gitlab.Insecure, g.scmRootCAPath, providerConfig.Gitlab.Topic)
token, err := utils.GetSecretRef(ctx, g.client, providerConfig.TokenRef, applicationSetInfo.Namespace)
if err != nil {
return nil, fmt.Errorf("error initializing Gitlab service: %v", err)
return nil, fmt.Errorf("error fetching Gitlab token: %w", err)
}
provider, err = scm_provider.NewGitlabProvider(ctx, providerConfig.Group, token, providerConfig.API, providerConfig.AllBranches, providerConfig.IncludeSubgroups, providerConfig.WillIncludeSharedProjects(), providerConfig.Insecure, g.scmRootCAPath, providerConfig.Topic, caCerts)
if err != nil {
return nil, fmt.Errorf("error initializing Gitlab service: %w", err)
}
} else if providerConfig.Gitea != nil {
token, err := g.getSecretRef(ctx, providerConfig.Gitea.TokenRef, applicationSetInfo.Namespace)
token, err := utils.GetSecretRef(ctx, g.client, providerConfig.Gitea.TokenRef, applicationSetInfo.Namespace)
if err != nil {
return nil, fmt.Errorf("error fetching Gitea token: %v", err)
return nil, fmt.Errorf("error fetching Gitea token: %w", err)
}
provider, err = scm_provider.NewGiteaProvider(ctx, providerConfig.Gitea.Owner, token, providerConfig.Gitea.API, providerConfig.Gitea.AllBranches, providerConfig.Gitea.Insecure)
if err != nil {
return nil, fmt.Errorf("error initializing Gitea service: %v", err)
return nil, fmt.Errorf("error initializing Gitea service: %w", err)
}
} else if providerConfig.BitbucketServer != nil {
providerConfig := providerConfig.BitbucketServer
var caCerts []byte
var scmError error
if providerConfig.BasicAuth != nil {
password, err := g.getSecretRef(ctx, providerConfig.BasicAuth.PasswordRef, applicationSetInfo.Namespace)
if err != nil {
return nil, fmt.Errorf("error fetching Secret token: %v", err)
if providerConfig.CARef != nil {
caCerts, scmError = utils.GetConfigMapData(ctx, g.client, providerConfig.CARef, applicationSetInfo.Namespace)
if scmError != nil {
return nil, fmt.Errorf("error fetching CA certificates from ConfigMap: %w", scmError)
}
provider, scmError = scm_provider.NewBitbucketServerProviderBasicAuth(ctx, providerConfig.BasicAuth.Username, password, providerConfig.API, providerConfig.Project, providerConfig.AllBranches)
}
if providerConfig.BearerToken != nil {
appToken, err := utils.GetSecretRef(ctx, g.client, providerConfig.BearerToken.TokenRef, applicationSetInfo.Namespace)
if err != nil {
return nil, fmt.Errorf("error fetching Secret Bearer token: %w", err)
}
provider, scmError = scm_provider.NewBitbucketServerProviderBearerToken(ctx, appToken, providerConfig.API, providerConfig.Project, providerConfig.AllBranches, g.scmRootCAPath, providerConfig.Insecure, caCerts)
} else if providerConfig.BasicAuth != nil {
password, err := utils.GetSecretRef(ctx, g.client, providerConfig.BasicAuth.PasswordRef, applicationSetInfo.Namespace)
if err != nil {
return nil, fmt.Errorf("error fetching Secret token: %w", err)
}
provider, scmError = scm_provider.NewBitbucketServerProviderBasicAuth(ctx, providerConfig.BasicAuth.Username, password, providerConfig.API, providerConfig.Project, providerConfig.AllBranches, g.scmRootCAPath, providerConfig.Insecure, caCerts)
} else {
provider, scmError = scm_provider.NewBitbucketServerProviderNoAuth(ctx, providerConfig.API, providerConfig.Project, providerConfig.AllBranches)
provider, scmError = scm_provider.NewBitbucketServerProviderNoAuth(ctx, providerConfig.API, providerConfig.Project, providerConfig.AllBranches, g.scmRootCAPath, providerConfig.Insecure, caCerts)
}
if scmError != nil {
return nil, fmt.Errorf("error initializing Bitbucket Server service: %v", scmError)
return nil, fmt.Errorf("error initializing Bitbucket Server service: %w", scmError)
}
} else if providerConfig.AzureDevOps != nil {
token, err := g.getSecretRef(ctx, providerConfig.AzureDevOps.AccessTokenRef, applicationSetInfo.Namespace)
token, err := utils.GetSecretRef(ctx, g.client, providerConfig.AzureDevOps.AccessTokenRef, applicationSetInfo.Namespace)
if err != nil {
return nil, fmt.Errorf("error fetching Azure Devops access token: %v", err)
return nil, fmt.Errorf("error fetching Azure Devops access token: %w", err)
}
provider, err = scm_provider.NewAzureDevOpsProvider(ctx, token, providerConfig.AzureDevOps.Organization, providerConfig.AzureDevOps.API, providerConfig.AzureDevOps.TeamProject, providerConfig.AzureDevOps.AllBranches)
if err != nil {
return nil, fmt.Errorf("error initializing Azure Devops service: %v", err)
return nil, fmt.Errorf("error initializing Azure Devops service: %w", err)
}
} else if providerConfig.Bitbucket != nil {
appPassword, err := g.getSecretRef(ctx, providerConfig.Bitbucket.AppPasswordRef, applicationSetInfo.Namespace)
appPassword, err := utils.GetSecretRef(ctx, g.client, providerConfig.Bitbucket.AppPasswordRef, applicationSetInfo.Namespace)
if err != nil {
return nil, fmt.Errorf("error fetching Bitbucket cloud appPassword: %v", err)
return nil, fmt.Errorf("error fetching Bitbucket cloud appPassword: %w", err)
}
provider, err = scm_provider.NewBitBucketCloudProvider(ctx, providerConfig.Bitbucket.Owner, providerConfig.Bitbucket.User, appPassword, providerConfig.Bitbucket.AllBranches)
if err != nil {
return nil, fmt.Errorf("error initializing Bitbucket cloud service: %v", err)
return nil, fmt.Errorf("error initializing Bitbucket cloud service: %w", err)
}
} else if providerConfig.AWSCodeCommit != nil {
var awsErr error
provider, awsErr = scm_provider.NewAWSCodeCommitProvider(ctx, providerConfig.AWSCodeCommit.TagFilters, providerConfig.AWSCodeCommit.Role, providerConfig.AWSCodeCommit.Region, providerConfig.AWSCodeCommit.AllBranches)
if awsErr != nil {
return nil, fmt.Errorf("error initializing AWS codecommit service: %v", awsErr)
return nil, fmt.Errorf("error initializing AWS codecommit service: %w", awsErr)
}
} else {
return nil, fmt.Errorf("no SCM provider implementation configured")
@@ -202,7 +230,7 @@ func (g *SCMProviderGenerator) GenerateParams(appSetGenerator *argoprojiov1alpha
// Find all the available repos.
repos, err := scm_provider.ListRepos(ctx, provider, providerConfig.Filters, providerConfig.CloneProtocol)
if err != nil {
return nil, fmt.Errorf("error listing repos: %v", err)
return nil, fmt.Errorf("error listing repos: %w", err)
}
paramsArray := make([]map[string]interface{}, 0, len(repos))
var shortSHALength int
@@ -240,34 +268,11 @@ func (g *SCMProviderGenerator) GenerateParams(appSetGenerator *argoprojiov1alpha
return paramsArray, nil
}
func (g *SCMProviderGenerator) getSecretRef(ctx context.Context, ref *argoprojiov1alpha1.SecretRef, namespace string) (string, error) {
if ref == nil {
return "", nil
}
secret := &corev1.Secret{}
err := g.client.Get(
ctx,
client.ObjectKey{
Name: ref.SecretName,
Namespace: namespace,
},
secret)
if err != nil {
return "", fmt.Errorf("error fetching secret %s/%s: %v", namespace, ref.SecretName, err)
}
tokenBytes, ok := secret.Data[ref.Key]
if !ok {
return "", fmt.Errorf("key %q in secret %s/%s not found", ref.Key, namespace, ref.SecretName)
}
return string(tokenBytes), nil
}
func (g *SCMProviderGenerator) githubProvider(ctx context.Context, github *argoprojiov1alpha1.SCMProviderGeneratorGithub, applicationSetInfo *argoprojiov1alpha1.ApplicationSet) (scm_provider.SCMProviderService, error) {
if github.AppSecretName != "" {
auth, err := g.GitHubApps.GetAuthSecret(ctx, github.AppSecretName)
if err != nil {
return nil, fmt.Errorf("error fetching Github app secret: %v", err)
return nil, fmt.Errorf("error fetching Github app secret: %w", err)
}
return scm_provider.NewGithubAppProviderFor(
@@ -278,9 +283,9 @@ func (g *SCMProviderGenerator) githubProvider(ctx context.Context, github *argop
)
}
token, err := g.getSecretRef(ctx, github.TokenRef, applicationSetInfo.Namespace)
token, err := utils.GetSecretRef(ctx, g.client, github.TokenRef, applicationSetInfo.Namespace)
if err != nil {
return nil, fmt.Errorf("error fetching Github token: %v", err)
return nil, fmt.Errorf("error fetching Github token: %w", err)
}
return scm_provider.NewGithubProvider(ctx, github.Organization, token, github.API, github.AllBranches)
}

View File

@@ -1,84 +1,16 @@
package generators
import (
"context"
"testing"
"github.com/stretchr/testify/assert"
corev1 "k8s.io/api/core/v1"
"github.com/stretchr/testify/require"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/controller-runtime/pkg/client/fake"
"github.com/argoproj/argo-cd/v2/applicationset/services/scm_provider"
argoprojiov1alpha1 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
)
func TestSCMProviderGetSecretRef(t *testing.T) {
secret := &corev1.Secret{
ObjectMeta: metav1.ObjectMeta{Name: "test-secret", Namespace: "test"},
Data: map[string][]byte{
"my-token": []byte("secret"),
},
}
gen := &SCMProviderGenerator{client: fake.NewClientBuilder().WithObjects(secret).Build()}
ctx := context.Background()
cases := []struct {
name, namespace, token string
ref *argoprojiov1alpha1.SecretRef
hasError bool
}{
{
name: "valid ref",
ref: &argoprojiov1alpha1.SecretRef{SecretName: "test-secret", Key: "my-token"},
namespace: "test",
token: "secret",
hasError: false,
},
{
name: "nil ref",
ref: nil,
namespace: "test",
token: "",
hasError: false,
},
{
name: "wrong name",
ref: &argoprojiov1alpha1.SecretRef{SecretName: "other", Key: "my-token"},
namespace: "test",
token: "",
hasError: true,
},
{
name: "wrong key",
ref: &argoprojiov1alpha1.SecretRef{SecretName: "test-secret", Key: "other-token"},
namespace: "test",
token: "",
hasError: true,
},
{
name: "wrong namespace",
ref: &argoprojiov1alpha1.SecretRef{SecretName: "test-secret", Key: "my-token"},
namespace: "other",
token: "",
hasError: true,
},
}
for _, c := range cases {
t.Run(c.name, func(t *testing.T) {
token, err := gen.getSecretRef(ctx, c.ref, c.namespace)
if c.hasError {
assert.NotNil(t, err)
} else {
assert.Nil(t, err)
}
assert.Equal(t, c.token, token)
})
}
}
func TestSCMProviderGenerateParams(t *testing.T) {
cases := []struct {
name string
@@ -174,7 +106,7 @@ func TestSCMProviderGenerateParams(t *testing.T) {
mockProvider := &scm_provider.MockProvider{
Repos: testCaseCopy.repos,
}
scmGenerator := &SCMProviderGenerator{overrideProvider: mockProvider, enableSCMProviders: true}
scmGenerator := &SCMProviderGenerator{overrideProvider: mockProvider, SCMConfig: SCMConfig{enableSCMProviders: true}}
applicationSetInfo := argoprojiov1alpha1.ApplicationSet{
ObjectMeta: metav1.ObjectMeta{
Name: "set",
@@ -188,15 +120,14 @@ func TestSCMProviderGenerateParams(t *testing.T) {
},
}
got, err := scmGenerator.GenerateParams(&applicationSetInfo.Spec.Generators[0], &applicationSetInfo)
got, err := scmGenerator.GenerateParams(&applicationSetInfo.Spec.Generators[0], &applicationSetInfo, nil)
if testCaseCopy.expectedError != nil {
assert.EqualError(t, err, testCaseCopy.expectedError.Error())
} else {
assert.NoError(t, err)
require.NoError(t, err)
assert.Equal(t, testCaseCopy.expected, got)
}
})
}
}
@@ -205,7 +136,6 @@ func TestAllowedSCMProvider(t *testing.T) {
cases := []struct {
name string
providerConfig *argoprojiov1alpha1.SCMProviderGenerator
expectedError error
}{
{
name: "Error Github",
@@ -214,7 +144,6 @@ func TestAllowedSCMProvider(t *testing.T) {
API: "https://myservice.mynamespace.svc.cluster.local",
},
},
expectedError: &ErrDisallowedSCMProvider{},
},
{
name: "Error Gitlab",
@@ -223,7 +152,6 @@ func TestAllowedSCMProvider(t *testing.T) {
API: "https://myservice.mynamespace.svc.cluster.local",
},
},
expectedError: &ErrDisallowedSCMProvider{},
},
{
name: "Error Gitea",
@@ -232,7 +160,6 @@ func TestAllowedSCMProvider(t *testing.T) {
API: "https://myservice.mynamespace.svc.cluster.local",
},
},
expectedError: &ErrDisallowedSCMProvider{},
},
{
name: "Error Bitbucket",
@@ -241,7 +168,6 @@ func TestAllowedSCMProvider(t *testing.T) {
API: "https://myservice.mynamespace.svc.cluster.local",
},
},
expectedError: &ErrDisallowedSCMProvider{},
},
{
name: "Error AzureDevops",
@@ -250,7 +176,6 @@ func TestAllowedSCMProvider(t *testing.T) {
API: "https://myservice.mynamespace.svc.cluster.local",
},
},
expectedError: &ErrDisallowedSCMProvider{},
},
}
@@ -261,14 +186,16 @@ func TestAllowedSCMProvider(t *testing.T) {
t.Parallel()
scmGenerator := &SCMProviderGenerator{
allowedSCMProviders: []string{
"github.myorg.com",
"gitlab.myorg.com",
"gitea.myorg.com",
"bitbucket.myorg.com",
"azuredevops.myorg.com",
SCMConfig: SCMConfig{
allowedSCMProviders: []string{
"github.myorg.com",
"gitlab.myorg.com",
"gitea.myorg.com",
"bitbucket.myorg.com",
"azuredevops.myorg.com",
},
enableSCMProviders: true,
},
enableSCMProviders: true,
}
applicationSetInfo := argoprojiov1alpha1.ApplicationSet{
@@ -282,16 +209,17 @@ func TestAllowedSCMProvider(t *testing.T) {
},
}
_, err := scmGenerator.GenerateParams(&applicationSetInfo.Spec.Generators[0], &applicationSetInfo)
_, err := scmGenerator.GenerateParams(&applicationSetInfo.Spec.Generators[0], &applicationSetInfo, nil)
assert.Error(t, err, "Must return an error")
assert.ErrorAs(t, err, testCaseCopy.expectedError)
require.Error(t, err, "Must return an error")
var expectedError ErrDisallowedSCMProvider
assert.ErrorAs(t, err, &expectedError)
})
}
}
func TestSCMProviderDisabled_SCMGenerator(t *testing.T) {
generator := &SCMProviderGenerator{enableSCMProviders: false}
generator := &SCMProviderGenerator{SCMConfig: SCMConfig{enableSCMProviders: false}}
applicationSetInfo := argoprojiov1alpha1.ApplicationSet{
ObjectMeta: metav1.ObjectMeta{
@@ -308,6 +236,6 @@ func TestSCMProviderDisabled_SCMGenerator(t *testing.T) {
},
}
_, err := generator.GenerateParams(&applicationSetInfo.Spec.Generators[0], &applicationSetInfo)
_, err := generator.GenerateParams(&applicationSetInfo.Spec.Generators[0], &applicationSetInfo, nil)
assert.ErrorIs(t, err, ErrSCMProvidersDisabled)
}

View File

@@ -0,0 +1,49 @@
package generators
import (
"context"
"k8s.io/client-go/dynamic"
"k8s.io/client-go/kubernetes"
"sigs.k8s.io/controller-runtime/pkg/client"
"github.com/argoproj/argo-cd/v2/applicationset/services"
)
func GetGenerators(ctx context.Context, c client.Client, k8sClient kubernetes.Interface, namespace string, argoCDService services.Repos, dynamicClient dynamic.Interface, scmConfig SCMConfig) map[string]Generator {
terminalGenerators := map[string]Generator{
"List": NewListGenerator(),
"Clusters": NewClusterGenerator(c, ctx, k8sClient, namespace),
"Git": NewGitGenerator(argoCDService),
"SCMProvider": NewSCMProviderGenerator(c, scmConfig),
"ClusterDecisionResource": NewDuckTypeGenerator(ctx, dynamicClient, k8sClient, namespace),
"PullRequest": NewPullRequestGenerator(c, scmConfig),
"Plugin": NewPluginGenerator(c, ctx, k8sClient, namespace),
}
nestedGenerators := map[string]Generator{
"List": terminalGenerators["List"],
"Clusters": terminalGenerators["Clusters"],
"Git": terminalGenerators["Git"],
"SCMProvider": terminalGenerators["SCMProvider"],
"ClusterDecisionResource": terminalGenerators["ClusterDecisionResource"],
"PullRequest": terminalGenerators["PullRequest"],
"Plugin": terminalGenerators["Plugin"],
"Matrix": NewMatrixGenerator(terminalGenerators),
"Merge": NewMergeGenerator(terminalGenerators),
}
topLevelGenerators := map[string]Generator{
"List": terminalGenerators["List"],
"Clusters": terminalGenerators["Clusters"],
"Git": terminalGenerators["Git"],
"SCMProvider": terminalGenerators["SCMProvider"],
"ClusterDecisionResource": terminalGenerators["ClusterDecisionResource"],
"PullRequest": terminalGenerators["PullRequest"],
"Plugin": terminalGenerators["Plugin"],
"Matrix": NewMatrixGenerator(nestedGenerators),
"Merge": NewMergeGenerator(nestedGenerators),
}
return topLevelGenerators
}

View File

@@ -12,7 +12,6 @@ func appendTemplatedValues(values map[string]string, params map[string]interface
for key, value := range values {
result, err := replaceTemplatedString(value, params, useGoTemplate, goTemplateOptions)
if err != nil {
return fmt.Errorf("failed to replace templated string: %w", err)
}

View File

@@ -4,6 +4,7 @@ import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestValueInterpolation(t *testing.T) {
@@ -53,10 +54,9 @@ func TestValueInterpolation(t *testing.T) {
}
for _, testCase := range testCases {
t.Run(testCase.name, func(t *testing.T) {
err := appendTemplatedValues(testCase.values, testCase.params, false, nil)
assert.NoError(t, err)
require.NoError(t, err)
assert.EqualValues(t, testCase.expected, testCase.params)
})
}
@@ -115,10 +115,9 @@ func TestValueInterpolationWithGoTemplating(t *testing.T) {
}
for _, testCase := range testCases {
t.Run(testCase.name, func(t *testing.T) {
err := appendTemplatedValues(testCase.values, testCase.params, true, nil)
assert.NoError(t, err)
require.NoError(t, err)
assert.EqualValues(t, testCase.expected, testCase.params)
})
}

View File

@@ -5,7 +5,7 @@ import (
"net/http"
"github.com/bradleyfalzon/ghinstallation/v2"
"github.com/google/go-github/v35/github"
"github.com/google/go-github/v63/github"
"github.com/argoproj/argo-cd/v2/applicationset/services/github_app_auth"
)
@@ -26,7 +26,7 @@ func Client(g github_app_auth.Authentication, url string) (*github.Client, error
} else {
rt.BaseURL = url
httpClient := http.Client{Transport: rt}
client, err = github.NewEnterpriseClient(url, url, &httpClient)
client, err = github.NewClient(&httpClient).WithEnterpriseURLs(url, url)
if err != nil {
return nil, fmt.Errorf("failed to create github enterprise client: %w", err)
}

View File

@@ -66,7 +66,6 @@ func newClient(baseURL string, options ...ClientOptionFunc) (*Client, error) {
}
func (c *Client) NewRequest(method, path string, body interface{}, options []ClientOptionFunc) (*http.Request, error) {
// Make sure the given URL end with a slash
if !strings.HasSuffix(c.baseURL, "/") {
c.baseURL += "/"
@@ -135,14 +134,13 @@ func (c *Client) Do(ctx context.Context, req *http.Request, v interface{}) (*htt
// CheckResponse checks the API response for errors, and returns them if present.
func CheckResponse(resp *http.Response) error {
if c := resp.StatusCode; 200 <= c && c <= 299 {
return nil
}
data, err := io.ReadAll(resp.Body)
if err != nil {
return fmt.Errorf("API error with status code %d: %v", resp.StatusCode, err)
return fmt.Errorf("API error with status code %d: %w", resp.StatusCode, err)
}
var raw map[string]interface{}

View File

@@ -17,14 +17,13 @@ func TestClient(t *testing.T) {
w.WriteHeader(http.StatusOK)
_, err := w.Write([]byte("Hello, World!"))
if err != nil {
assert.NoError(t, fmt.Errorf("Error Write %v", err))
assert.NoError(t, fmt.Errorf("Error Write %w", err))
}
}))
defer server.Close()
var clientOptionFns []ClientOptionFunc
_, err := NewClient(server.URL, clientOptionFns...)
if err != nil {
t.Fatalf("Failed to create client: %v", err)
}
@@ -62,7 +61,7 @@ func TestClientDo(t *testing.T) {
"key3": 123
}]`))
if err != nil {
assert.NoError(t, fmt.Errorf("Error Write %v", err))
assert.NoError(t, fmt.Errorf("Error Write %w", err))
}
})),
clientOptionFns: nil,
@@ -105,7 +104,7 @@ func TestClientDo(t *testing.T) {
"key3": 123
}]`))
if err != nil {
assert.NoError(t, fmt.Errorf("Error Write %v", err))
assert.NoError(t, fmt.Errorf("Error Write %w", err))
}
})),
clientOptionFns: nil,
@@ -119,13 +118,11 @@ func TestClientDo(t *testing.T) {
defer cc.fakeServer.Close()
client, err := NewClient(cc.fakeServer.URL, cc.clientOptionFns...)
if err != nil {
t.Fatalf("NewClient returned unexpected error: %v", err)
}
req, err := client.NewRequest("POST", "", cc.params, nil)
if err != nil {
t.Fatalf("NewRequest returned unexpected error: %v", err)
}
@@ -137,8 +134,8 @@ func TestClientDo(t *testing.T) {
if cc.expectedError != nil {
assert.EqualError(t, err, cc.expectedError.Error())
} else {
assert.Equal(t, resp.StatusCode, cc.expectedCode)
assert.Equal(t, data, cc.expected)
assert.Equal(t, cc.expectedCode, resp.StatusCode)
assert.Equal(t, cc.expected, data)
assert.NoError(t, err)
}
})

View File

@@ -1,4 +1,4 @@
// Code generated by mockery v2.25.1. DO NOT EDIT.
// Code generated by mockery v2.43.2. DO NOT EDIT.
package mocks
@@ -13,25 +13,29 @@ type Repos struct {
mock.Mock
}
// GetDirectories provides a mock function with given fields: ctx, repoURL, revision, noRevisionCache
func (_m *Repos) GetDirectories(ctx context.Context, repoURL string, revision string, noRevisionCache bool) ([]string, error) {
ret := _m.Called(ctx, repoURL, revision, noRevisionCache)
// GetDirectories provides a mock function with given fields: ctx, repoURL, revision, noRevisionCache, verifyCommit
func (_m *Repos) GetDirectories(ctx context.Context, repoURL string, revision string, noRevisionCache bool, verifyCommit bool) ([]string, error) {
ret := _m.Called(ctx, repoURL, revision, noRevisionCache, verifyCommit)
if len(ret) == 0 {
panic("no return value specified for GetDirectories")
}
var r0 []string
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, string, bool) ([]string, error)); ok {
return rf(ctx, repoURL, revision, noRevisionCache)
if rf, ok := ret.Get(0).(func(context.Context, string, string, bool, bool) ([]string, error)); ok {
return rf(ctx, repoURL, revision, noRevisionCache, verifyCommit)
}
if rf, ok := ret.Get(0).(func(context.Context, string, string, bool) []string); ok {
r0 = rf(ctx, repoURL, revision, noRevisionCache)
if rf, ok := ret.Get(0).(func(context.Context, string, string, bool, bool) []string); ok {
r0 = rf(ctx, repoURL, revision, noRevisionCache, verifyCommit)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]string)
}
}
if rf, ok := ret.Get(1).(func(context.Context, string, string, bool) error); ok {
r1 = rf(ctx, repoURL, revision, noRevisionCache)
if rf, ok := ret.Get(1).(func(context.Context, string, string, bool, bool) error); ok {
r1 = rf(ctx, repoURL, revision, noRevisionCache, verifyCommit)
} else {
r1 = ret.Error(1)
}
@@ -39,25 +43,29 @@ func (_m *Repos) GetDirectories(ctx context.Context, repoURL string, revision st
return r0, r1
}
// GetFiles provides a mock function with given fields: ctx, repoURL, revision, pattern, noRevisionCache
func (_m *Repos) GetFiles(ctx context.Context, repoURL string, revision string, pattern string, noRevisionCache bool) (map[string][]byte, error) {
ret := _m.Called(ctx, repoURL, revision, pattern, noRevisionCache)
// GetFiles provides a mock function with given fields: ctx, repoURL, revision, pattern, noRevisionCache, verifyCommit
func (_m *Repos) GetFiles(ctx context.Context, repoURL string, revision string, pattern string, noRevisionCache bool, verifyCommit bool) (map[string][]byte, error) {
ret := _m.Called(ctx, repoURL, revision, pattern, noRevisionCache, verifyCommit)
if len(ret) == 0 {
panic("no return value specified for GetFiles")
}
var r0 map[string][]byte
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, string, string, bool) (map[string][]byte, error)); ok {
return rf(ctx, repoURL, revision, pattern, noRevisionCache)
if rf, ok := ret.Get(0).(func(context.Context, string, string, string, bool, bool) (map[string][]byte, error)); ok {
return rf(ctx, repoURL, revision, pattern, noRevisionCache, verifyCommit)
}
if rf, ok := ret.Get(0).(func(context.Context, string, string, string, bool) map[string][]byte); ok {
r0 = rf(ctx, repoURL, revision, pattern, noRevisionCache)
if rf, ok := ret.Get(0).(func(context.Context, string, string, string, bool, bool) map[string][]byte); ok {
r0 = rf(ctx, repoURL, revision, pattern, noRevisionCache, verifyCommit)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(map[string][]byte)
}
}
if rf, ok := ret.Get(1).(func(context.Context, string, string, string, bool) error); ok {
r1 = rf(ctx, repoURL, revision, pattern, noRevisionCache)
if rf, ok := ret.Get(1).(func(context.Context, string, string, string, bool, bool) error); ok {
r1 = rf(ctx, repoURL, revision, pattern, noRevisionCache, verifyCommit)
} else {
r1 = ret.Error(1)
}
@@ -65,13 +73,12 @@ func (_m *Repos) GetFiles(ctx context.Context, repoURL string, revision string,
return r0, r1
}
type mockConstructorTestingTNewRepos interface {
// NewRepos creates a new instance of Repos. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewRepos(t interface {
mock.TestingT
Cleanup(func())
}
// NewRepos creates a new instance of Repos. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewRepos(t mockConstructorTestingTNewRepos) *Repos {
}) *Repos {
mock := &Repos{}
mock.Mock.Test(t)

View File

@@ -1,57 +0,0 @@
// Code generated by mockery v2.21.1. DO NOT EDIT.
package mocks
import (
context "context"
mock "github.com/stretchr/testify/mock"
v1alpha1 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
)
// RepositoryDB is an autogenerated mock type for the RepositoryDB type
type RepositoryDB struct {
mock.Mock
}
// GetRepository provides a mock function with given fields: ctx, url
func (_m *RepositoryDB) GetRepository(ctx context.Context, url string) (*v1alpha1.Repository, error) {
ret := _m.Called(ctx, url)
var r0 *v1alpha1.Repository
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string) (*v1alpha1.Repository, error)); ok {
return rf(ctx, url)
}
if rf, ok := ret.Get(0).(func(context.Context, string) *v1alpha1.Repository); ok {
r0 = rf(ctx, url)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*v1alpha1.Repository)
}
}
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
r1 = rf(ctx, url)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
type mockConstructorTestingTNewRepositoryDB interface {
mock.TestingT
Cleanup(func())
}
// NewRepositoryDB creates a new instance of RepositoryDB. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewRepositoryDB(t mockConstructorTestingTNewRepositoryDB) *RepositoryDB {
mock := &RepositoryDB{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}

View File

@@ -45,7 +45,7 @@ func NewPluginService(ctx context.Context, appSetName string, baseURL string, to
client, err := internalhttp.NewClient(baseURL, clientOptionFns...)
if err != nil {
return nil, fmt.Errorf("error creating plugin client: %v", err)
return nil, fmt.Errorf("error creating plugin client: %w", err)
}
return &Service{
@@ -56,17 +56,15 @@ func NewPluginService(ctx context.Context, appSetName string, baseURL string, to
func (p *Service) List(ctx context.Context, parameters v1alpha1.PluginParameters) (*ServiceResponse, error) {
req, err := p.client.NewRequest(http.MethodPost, "api/v1/getparams.execute", ServiceRequest{ApplicationSetName: p.appSetName, Input: v1alpha1.PluginInput{Parameters: parameters}}, nil)
if err != nil {
return nil, fmt.Errorf("NewRequest returned unexpected error: %v", err)
return nil, fmt.Errorf("NewRequest returned unexpected error: %w", err)
}
var data ServiceResponse
_, err = p.client.Do(ctx, req, &data)
if err != nil {
return nil, fmt.Errorf("error get api '%s': %v", p.appSetName, err)
return nil, fmt.Errorf("error get api '%s': %w", p.appSetName, err)
}
return &data, err

View File

@@ -23,22 +23,19 @@ func TestPlugin(t *testing.T) {
return
}
_, err := w.Write([]byte(expectedJSON))
if err != nil {
assert.NoError(t, fmt.Errorf("Error Write %v", err))
assert.NoError(t, fmt.Errorf("Error Write %w", err))
}
})
ts := httptest.NewServer(handler)
defer ts.Close()
client, err := NewPluginService(context.Background(), "plugin-test", ts.URL, token, 0)
if err != nil {
t.Errorf("unexpected error: %v", err)
}
data, err := client.List(context.Background(), nil)
if err != nil {
t.Errorf("unexpected error: %v", err)
}

View File

@@ -36,8 +36,10 @@ type AzureDevOpsService struct {
labels []string
}
var _ PullRequestService = (*AzureDevOpsService)(nil)
var _ AzureDevOpsClientFactory = &devopsFactoryImpl{}
var (
_ PullRequestService = (*AzureDevOpsService)(nil)
_ AzureDevOpsClientFactory = &devopsFactoryImpl{}
)
func NewAzureDevOpsService(ctx context.Context, token, url, organization, project, repo string, labels []string) (PullRequestService, error) {
organizationUrl := buildURL(url, organization)
@@ -93,9 +95,11 @@ func (a *AzureDevOpsService) List(ctx context.Context) ([]*PullRequest, error) {
if *pr.Repository.Name == a.repo {
pullRequests = append(pullRequests, &PullRequest{
Number: *pr.PullRequestId,
Title: *pr.Title,
Branch: strings.Replace(*pr.SourceRefName, "refs/heads/", "", 1),
HeadSHA: *pr.LastMergeSourceCommit.CommitId,
Labels: azureDevOpsLabels,
Author: strings.Split(*pr.CreatedBy.UniqueName, "@")[0], // Get the part before the @ in the email-address
})
}
}

View File

@@ -4,10 +4,13 @@ import (
"context"
"testing"
"github.com/microsoft/azure-devops-go-api/azuredevops/webapi"
"github.com/microsoft/azure-devops-go-api/azuredevops/core"
git "github.com/microsoft/azure-devops-go-api/azuredevops/git"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"
azureMock "github.com/argoproj/argo-cd/v2/applicationset/services/scm_provider/azure_devops/git/mocks"
)
@@ -28,6 +31,10 @@ func createLabelsPtr(x []core.WebApiTagDefinition) *[]core.WebApiTagDefinition {
return &x
}
func createUniqueNamePtr(x string) *string {
return &x
}
type AzureClientFactoryMock struct {
mock *mock.Mock
}
@@ -55,12 +62,15 @@ func TestListPullRequest(t *testing.T) {
teamProject := "myorg_project"
repoName := "myorg_project_repo"
pr_id := 123
pr_title := "feat(123)"
pr_head_sha := "cd4973d9d14a08ffe6b641a89a68891d6aac8056"
ctx := context.Background()
uniqueName := "testName"
pullRequestMock := []git.GitPullRequest{
{
PullRequestId: createIntPtr(pr_id),
Title: createStringPtr(pr_title),
SourceRefName: createStringPtr("refs/heads/feature-branch"),
LastMergeSourceCommit: &git.GitCommitRef{
CommitId: createStringPtr(pr_head_sha),
@@ -69,6 +79,9 @@ func TestListPullRequest(t *testing.T) {
Repository: &git.GitRepository{
Name: createStringPtr(repoName),
},
CreatedBy: &webapi.IdentityRef{
UniqueName: createUniqueNamePtr(uniqueName + "@example.com"),
},
},
}
@@ -90,11 +103,13 @@ func TestListPullRequest(t *testing.T) {
}
list, err := provider.List(ctx)
assert.NoError(t, err)
assert.Equal(t, 1, len(list))
require.NoError(t, err)
assert.Len(t, list, 1)
assert.Equal(t, "feature-branch", list[0].Branch)
assert.Equal(t, pr_head_sha, list[0].HeadSHA)
assert.Equal(t, "feat(123)", list[0].Title)
assert.Equal(t, pr_id, list[0].Number)
assert.Equal(t, uniqueName, list[0].Author)
}
func TestConvertLabes(t *testing.T) {
@@ -215,7 +230,7 @@ func TestBuildURL(t *testing.T) {
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
result := buildURL(tc.url, tc.organization)
assert.Equal(t, result, tc.expected)
assert.Equal(t, tc.expected, result)
})
}
}

View File

@@ -17,7 +17,9 @@ type BitbucketCloudService struct {
type BitbucketCloudPullRequest struct {
ID int `json:"id"`
Title string `json:"title"`
Source BitbucketCloudPullRequestSource `json:"source"`
Author string `json:"author"`
}
type BitbucketCloudPullRequestSource struct {
@@ -60,7 +62,7 @@ func parseUrl(uri string) (*url.URL, error) {
func NewBitbucketCloudServiceBasicAuth(baseUrl, username, password, owner, repositorySlug string) (PullRequestService, error) {
url, err := parseUrl(baseUrl)
if err != nil {
return nil, fmt.Errorf("error parsing base url of %s for %s/%s: %v", baseUrl, owner, repositorySlug, err)
return nil, fmt.Errorf("error parsing base url of %s for %s/%s: %w", baseUrl, owner, repositorySlug, err)
}
bitbucketClient := bitbucket.NewBasicAuth(username, password)
@@ -76,7 +78,7 @@ func NewBitbucketCloudServiceBasicAuth(baseUrl, username, password, owner, repos
func NewBitbucketCloudServiceBearerToken(baseUrl, bearerToken, owner, repositorySlug string) (PullRequestService, error) {
url, err := parseUrl(baseUrl)
if err != nil {
return nil, fmt.Errorf("error parsing base url of %s for %s/%s: %v", baseUrl, owner, repositorySlug, err)
return nil, fmt.Errorf("error parsing base url of %s for %s/%s: %w", baseUrl, owner, repositorySlug, err)
}
bitbucketClient := bitbucket.NewOAuthbearerToken(bearerToken)
@@ -102,7 +104,7 @@ func (b *BitbucketCloudService) List(_ context.Context) ([]*PullRequest, error)
response, err := b.client.Repositories.PullRequests.Gets(opts)
if err != nil {
return nil, fmt.Errorf("error listing pull requests for %s/%s: %v", b.owner, b.repositorySlug, err)
return nil, fmt.Errorf("error listing pull requests for %s/%s: %w", b.owner, b.repositorySlug, err)
}
resp, ok := response.(map[string]interface{})
@@ -117,20 +119,22 @@ func (b *BitbucketCloudService) List(_ context.Context) ([]*PullRequest, error)
jsonStr, err := json.Marshal(repoArray)
if err != nil {
return nil, fmt.Errorf("error marshalling response body to json: %v", err)
return nil, fmt.Errorf("error marshalling response body to json: %w", err)
}
var pulls []BitbucketCloudPullRequest
if err := json.Unmarshal(jsonStr, &pulls); err != nil {
return nil, fmt.Errorf("error unmarshalling json to type '[]BitbucketCloudPullRequest': %v", err)
return nil, fmt.Errorf("error unmarshalling json to type '[]BitbucketCloudPullRequest': %w", err)
}
pullRequests := []*PullRequest{}
for _, pull := range pulls {
pullRequests = append(pullRequests, &PullRequest{
Number: pull.ID,
Title: pull.Title,
Branch: pull.Source.Branch.Name,
HeadSHA: pull.Source.Commit.Hash,
Author: pull.Author,
})
}

View File

@@ -9,6 +9,7 @@ import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
)
@@ -26,6 +27,7 @@ func defaultHandlerCloud(t *testing.T) func(http.ResponseWriter, *http.Request)
"values": [
{
"id": 101,
"title": "feat(foo-bar)",
"source": {
"branch": {
"name": "feature/foo-bar"
@@ -34,7 +36,8 @@ func defaultHandlerCloud(t *testing.T) func(http.ResponseWriter, *http.Request)
"type": "commit",
"hash": "1a8dd249c04a"
}
}
},
"author": "testName"
}
]
}`)
@@ -51,26 +54,26 @@ func TestParseUrlEmptyUrl(t *testing.T) {
url, err := parseUrl("")
bitbucketUrl, _ := url.Parse("https://api.bitbucket.org/2.0")
assert.NoError(t, err)
require.NoError(t, err)
assert.Equal(t, bitbucketUrl, url)
}
func TestInvalidBaseUrlBasicAuthCloud(t *testing.T) {
_, err := NewBitbucketCloudServiceBasicAuth("http:// example.org", "user", "password", "OWNER", "REPO")
assert.Error(t, err)
require.Error(t, err)
}
func TestInvalidBaseUrlBearerTokenCloud(t *testing.T) {
_, err := NewBitbucketCloudServiceBearerToken("http:// example.org", "TOKEN", "OWNER", "REPO")
assert.Error(t, err)
require.Error(t, err)
}
func TestInvalidBaseUrlNoAuthCloud(t *testing.T) {
_, err := NewBitbucketCloudServiceNoAuth("http:// example.org", "OWNER", "REPO")
assert.Error(t, err)
require.Error(t, err)
}
func TestListPullRequestBearerTokenCloud(t *testing.T) {
@@ -80,13 +83,15 @@ func TestListPullRequestBearerTokenCloud(t *testing.T) {
}))
defer ts.Close()
svc, err := NewBitbucketCloudServiceBearerToken(ts.URL, "TOKEN", "OWNER", "REPO")
assert.NoError(t, err)
require.NoError(t, err)
pullRequests, err := ListPullRequests(context.Background(), svc, []v1alpha1.PullRequestGeneratorFilter{})
assert.NoError(t, err)
assert.Equal(t, 1, len(pullRequests))
require.NoError(t, err)
assert.Len(t, pullRequests, 1)
assert.Equal(t, 101, pullRequests[0].Number)
assert.Equal(t, "feat(foo-bar)", pullRequests[0].Title)
assert.Equal(t, "feature/foo-bar", pullRequests[0].Branch)
assert.Equal(t, "1a8dd249c04a", pullRequests[0].HeadSHA)
assert.Equal(t, "testName", pullRequests[0].Author)
}
func TestListPullRequestNoAuthCloud(t *testing.T) {
@@ -96,13 +101,15 @@ func TestListPullRequestNoAuthCloud(t *testing.T) {
}))
defer ts.Close()
svc, err := NewBitbucketCloudServiceNoAuth(ts.URL, "OWNER", "REPO")
assert.NoError(t, err)
require.NoError(t, err)
pullRequests, err := ListPullRequests(context.Background(), svc, []v1alpha1.PullRequestGeneratorFilter{})
assert.NoError(t, err)
assert.Equal(t, 1, len(pullRequests))
require.NoError(t, err)
assert.Len(t, pullRequests, 1)
assert.Equal(t, 101, pullRequests[0].Number)
assert.Equal(t, "feat(foo-bar)", pullRequests[0].Title)
assert.Equal(t, "feature/foo-bar", pullRequests[0].Branch)
assert.Equal(t, "1a8dd249c04a", pullRequests[0].HeadSHA)
assert.Equal(t, "testName", pullRequests[0].Author)
}
func TestListPullRequestBasicAuthCloud(t *testing.T) {
@@ -112,13 +119,15 @@ func TestListPullRequestBasicAuthCloud(t *testing.T) {
}))
defer ts.Close()
svc, err := NewBitbucketCloudServiceBasicAuth(ts.URL, "user", "password", "OWNER", "REPO")
assert.NoError(t, err)
require.NoError(t, err)
pullRequests, err := ListPullRequests(context.Background(), svc, []v1alpha1.PullRequestGeneratorFilter{})
assert.NoError(t, err)
assert.Equal(t, 1, len(pullRequests))
require.NoError(t, err)
assert.Len(t, pullRequests, 1)
assert.Equal(t, 101, pullRequests[0].Number)
assert.Equal(t, "feat(foo-bar)", pullRequests[0].Title)
assert.Equal(t, "feature/foo-bar", pullRequests[0].Branch)
assert.Equal(t, "1a8dd249c04a", pullRequests[0].HeadSHA)
assert.Equal(t, "testName", pullRequests[0].Author)
}
func TestListPullRequestPaginationCloud(t *testing.T) {
@@ -135,6 +144,7 @@ func TestListPullRequestPaginationCloud(t *testing.T) {
"values": [
{
"id": 101,
"title": "feat(101)",
"source": {
"branch": {
"name": "feature-101"
@@ -143,10 +153,12 @@ func TestListPullRequestPaginationCloud(t *testing.T) {
"type": "commit",
"hash": "1a8dd249c04a"
}
}
},
"author": "testName"
},
{
"id": 102,
"title": "feat(102)",
"source": {
"branch": {
"name": "feature-102"
@@ -155,7 +167,8 @@ func TestListPullRequestPaginationCloud(t *testing.T) {
"type": "commit",
"hash": "4cf807e67a6d"
}
}
},
"author": "testName"
}
]
}`, r.Host))
@@ -168,6 +181,7 @@ func TestListPullRequestPaginationCloud(t *testing.T) {
"values": [
{
"id": 103,
"title": "feat(103)",
"source": {
"branch": {
"name": "feature-103"
@@ -176,7 +190,8 @@ func TestListPullRequestPaginationCloud(t *testing.T) {
"type": "commit",
"hash": "6344d9623e3b"
}
}
},
"author": "testName"
}
]
}`, r.Host))
@@ -189,24 +204,30 @@ func TestListPullRequestPaginationCloud(t *testing.T) {
}))
defer ts.Close()
svc, err := NewBitbucketCloudServiceNoAuth(ts.URL, "OWNER", "REPO")
assert.NoError(t, err)
require.NoError(t, err)
pullRequests, err := ListPullRequests(context.Background(), svc, []v1alpha1.PullRequestGeneratorFilter{})
assert.NoError(t, err)
assert.Equal(t, 3, len(pullRequests))
require.NoError(t, err)
assert.Len(t, pullRequests, 3)
assert.Equal(t, PullRequest{
Number: 101,
Title: "feat(101)",
Branch: "feature-101",
HeadSHA: "1a8dd249c04a",
Author: "testName",
}, *pullRequests[0])
assert.Equal(t, PullRequest{
Number: 102,
Title: "feat(102)",
Branch: "feature-102",
HeadSHA: "4cf807e67a6d",
Author: "testName",
}, *pullRequests[1])
assert.Equal(t, PullRequest{
Number: 103,
Title: "feat(103)",
Branch: "feature-103",
HeadSHA: "6344d9623e3b",
Author: "testName",
}, *pullRequests[2])
}
@@ -217,7 +238,7 @@ func TestListResponseErrorCloud(t *testing.T) {
defer ts.Close()
svc, _ := NewBitbucketCloudServiceNoAuth(ts.URL, "OWNER", "REPO")
_, err := ListPullRequests(context.Background(), svc, []v1alpha1.PullRequestGeneratorFilter{})
assert.Error(t, err)
require.Error(t, err)
}
func TestListResponseMalformedCloud(t *testing.T) {
@@ -241,7 +262,7 @@ func TestListResponseMalformedCloud(t *testing.T) {
defer ts.Close()
svc, _ := NewBitbucketCloudServiceNoAuth(ts.URL, "OWNER", "REPO")
_, err := ListPullRequests(context.Background(), svc, []v1alpha1.PullRequestGeneratorFilter{})
assert.Error(t, err)
require.Error(t, err)
}
func TestListResponseMalformedValuesCloud(t *testing.T) {
@@ -265,7 +286,7 @@ func TestListResponseMalformedValuesCloud(t *testing.T) {
defer ts.Close()
svc, _ := NewBitbucketCloudServiceNoAuth(ts.URL, "OWNER", "REPO")
_, err := ListPullRequests(context.Background(), svc, []v1alpha1.PullRequestGeneratorFilter{})
assert.Error(t, err)
require.Error(t, err)
}
func TestListResponseEmptyCloud(t *testing.T) {
@@ -288,9 +309,9 @@ func TestListResponseEmptyCloud(t *testing.T) {
}))
defer ts.Close()
svc, err := NewBitbucketCloudServiceNoAuth(ts.URL, "OWNER", "REPO")
assert.NoError(t, err)
require.NoError(t, err)
pullRequests, err := ListPullRequests(context.Background(), svc, []v1alpha1.PullRequestGeneratorFilter{})
assert.NoError(t, err)
require.NoError(t, err)
assert.Empty(t, pullRequests)
}
@@ -308,6 +329,7 @@ func TestListPullRequestBranchMatchCloud(t *testing.T) {
"values": [
{
"id": 101,
"title": "feat(101)",
"source": {
"branch": {
"name": "feature-101"
@@ -316,10 +338,12 @@ func TestListPullRequestBranchMatchCloud(t *testing.T) {
"type": "commit",
"hash": "1a8dd249c04a"
}
}
},
"author": "testName"
},
{
"id": 200,
"title": "feat(200)",
"source": {
"branch": {
"name": "feature-200"
@@ -328,7 +352,8 @@ func TestListPullRequestBranchMatchCloud(t *testing.T) {
"type": "commit",
"hash": "4cf807e67a6d"
}
}
},
"author": "testName"
}
]
}`, r.Host))
@@ -341,6 +366,7 @@ func TestListPullRequestBranchMatchCloud(t *testing.T) {
"values": [
{
"id": 102,
"title": "feat(102)",
"source": {
"branch": {
"name": "feature-102"
@@ -349,7 +375,8 @@ func TestListPullRequestBranchMatchCloud(t *testing.T) {
"type": "commit",
"hash": "6344d9623e3b"
}
}
},
"author": "testName"
}
]
}`, r.Host))
@@ -363,48 +390,54 @@ func TestListPullRequestBranchMatchCloud(t *testing.T) {
defer ts.Close()
regexp := `feature-1[\d]{2}`
svc, err := NewBitbucketCloudServiceNoAuth(ts.URL, "OWNER", "REPO")
assert.NoError(t, err)
require.NoError(t, err)
pullRequests, err := ListPullRequests(context.Background(), svc, []v1alpha1.PullRequestGeneratorFilter{
{
BranchMatch: &regexp,
},
})
assert.NoError(t, err)
assert.Equal(t, 2, len(pullRequests))
require.NoError(t, err)
assert.Len(t, pullRequests, 2)
assert.Equal(t, PullRequest{
Number: 101,
Title: "feat(101)",
Branch: "feature-101",
HeadSHA: "1a8dd249c04a",
Author: "testName",
}, *pullRequests[0])
assert.Equal(t, PullRequest{
Number: 102,
Title: "feat(102)",
Branch: "feature-102",
HeadSHA: "6344d9623e3b",
Author: "testName",
}, *pullRequests[1])
regexp = `.*2$`
svc, err = NewBitbucketCloudServiceNoAuth(ts.URL, "OWNER", "REPO")
assert.NoError(t, err)
require.NoError(t, err)
pullRequests, err = ListPullRequests(context.Background(), svc, []v1alpha1.PullRequestGeneratorFilter{
{
BranchMatch: &regexp,
},
})
assert.NoError(t, err)
assert.Equal(t, 1, len(pullRequests))
require.NoError(t, err)
assert.Len(t, pullRequests, 1)
assert.Equal(t, PullRequest{
Number: 102,
Title: "feat(102)",
Branch: "feature-102",
HeadSHA: "6344d9623e3b",
Author: "testName",
}, *pullRequests[0])
regexp = `[\d{2}`
svc, err = NewBitbucketCloudServiceNoAuth(ts.URL, "OWNER", "REPO")
assert.NoError(t, err)
require.NoError(t, err)
_, err = ListPullRequests(context.Background(), svc, []v1alpha1.PullRequestGeneratorFilter{
{
BranchMatch: &regexp,
},
})
assert.Error(t, err)
require.Error(t, err)
}

View File

@@ -3,10 +3,12 @@ package pull_request
import (
"context"
"fmt"
"net/http"
"github.com/argoproj/argo-cd/v2/applicationset/utils"
bitbucketv1 "github.com/gfleury/go-bitbucket-v1"
log "github.com/sirupsen/logrus"
"github.com/argoproj/argo-cd/v2/applicationset/utils"
)
type BitbucketService struct {
@@ -19,7 +21,7 @@ type BitbucketService struct {
var _ PullRequestService = (*BitbucketService)(nil)
func NewBitbucketServiceBasicAuth(ctx context.Context, username, password, url, projectKey, repositorySlug string) (PullRequestService, error) {
func NewBitbucketServiceBasicAuth(ctx context.Context, username, password, url, projectKey, repositorySlug string, scmRootCAPath string, insecure bool, caCerts []byte) (PullRequestService, error) {
bitbucketConfig := bitbucketv1.NewConfiguration(url)
// Avoid the XSRF check
bitbucketConfig.AddDefaultHeader("x-atlassian-token", "no-check")
@@ -29,15 +31,29 @@ func NewBitbucketServiceBasicAuth(ctx context.Context, username, password, url,
UserName: username,
Password: password,
})
return newBitbucketService(ctx, bitbucketConfig, projectKey, repositorySlug)
return newBitbucketService(ctx, bitbucketConfig, projectKey, repositorySlug, scmRootCAPath, insecure, caCerts)
}
func NewBitbucketServiceNoAuth(ctx context.Context, url, projectKey, repositorySlug string) (PullRequestService, error) {
return newBitbucketService(ctx, bitbucketv1.NewConfiguration(url), projectKey, repositorySlug)
func NewBitbucketServiceBearerToken(ctx context.Context, bearerToken, url, projectKey, repositorySlug string, scmRootCAPath string, insecure bool, caCerts []byte) (PullRequestService, error) {
bitbucketConfig := bitbucketv1.NewConfiguration(url)
// Avoid the XSRF check
bitbucketConfig.AddDefaultHeader("x-atlassian-token", "no-check")
bitbucketConfig.AddDefaultHeader("x-requested-with", "XMLHttpRequest")
ctx = context.WithValue(ctx, bitbucketv1.ContextAccessToken, bearerToken)
return newBitbucketService(ctx, bitbucketConfig, projectKey, repositorySlug, scmRootCAPath, insecure, caCerts)
}
func newBitbucketService(ctx context.Context, bitbucketConfig *bitbucketv1.Configuration, projectKey, repositorySlug string) (PullRequestService, error) {
func NewBitbucketServiceNoAuth(ctx context.Context, url, projectKey, repositorySlug string, scmRootCAPath string, insecure bool, caCerts []byte) (PullRequestService, error) {
return newBitbucketService(ctx, bitbucketv1.NewConfiguration(url), projectKey, repositorySlug, scmRootCAPath, insecure, caCerts)
}
func newBitbucketService(ctx context.Context, bitbucketConfig *bitbucketv1.Configuration, projectKey, repositorySlug string, scmRootCAPath string, insecure bool, caCerts []byte) (PullRequestService, error) {
bitbucketConfig.BasePath = utils.NormalizeBitbucketBasePath(bitbucketConfig.BasePath)
tlsConfig := utils.GetTlsConfig(scmRootCAPath, insecure, caCerts)
bitbucketConfig.HTTPClient = &http.Client{Transport: &http.Transport{
TLSClientConfig: tlsConfig,
}}
bitbucketClient := bitbucketv1.NewAPIClient(ctx, bitbucketConfig)
return &BitbucketService{
@@ -56,21 +72,23 @@ func (b *BitbucketService) List(_ context.Context) ([]*PullRequest, error) {
for {
response, err := b.client.DefaultApi.GetPullRequestsPage(b.projectKey, b.repositorySlug, paged)
if err != nil {
return nil, fmt.Errorf("error listing pull requests for %s/%s: %v", b.projectKey, b.repositorySlug, err)
return nil, fmt.Errorf("error listing pull requests for %s/%s: %w", b.projectKey, b.repositorySlug, err)
}
pulls, err := bitbucketv1.GetPullRequestsResponse(response)
if err != nil {
log.Errorf("error parsing pull request response '%v'", response.Values)
return nil, fmt.Errorf("error parsing pull request response for %s/%s: %v", b.projectKey, b.repositorySlug, err)
return nil, fmt.Errorf("error parsing pull request response for %s/%s: %w", b.projectKey, b.repositorySlug, err)
}
for _, pull := range pulls {
pullRequests = append(pullRequests, &PullRequest{
Number: pull.ID,
Title: pull.Title,
Branch: pull.FromRef.DisplayID, // ID: refs/heads/main DisplayID: main
TargetBranch: pull.ToRef.DisplayID,
HeadSHA: pull.FromRef.LatestCommit, // This is not defined in the official docs, but works in practice
Labels: []string{}, // Not supported by library
Author: pull.Author.User.Name,
})
}

View File

@@ -2,13 +2,17 @@ package pull_request
import (
"context"
"crypto/x509"
"encoding/pem"
"io"
"net/http"
"net/http/httptest"
"testing"
"github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
)
func defaultHandler(t *testing.T) func(http.ResponseWriter, *http.Request) {
@@ -24,6 +28,7 @@ func defaultHandler(t *testing.T) func(http.ResponseWriter, *http.Request) {
"values": [
{
"id": 101,
"title": "feat(ABC) : 123",
"toRef": {
"latestCommit": "5b766e3564a3453808f3cd3dd3f2e5fad8ef0e7a",
"displayId": "master",
@@ -33,6 +38,11 @@ func defaultHandler(t *testing.T) func(http.ResponseWriter, *http.Request) {
"id": "refs/heads/feature-ABC-123",
"displayId": "feature-ABC-123",
"latestCommit": "cb3cf2e4d1517c83e720d2585b9402dbef71f992"
},
"author": {
"user": {
"name": "testName"
}
}
}
],
@@ -53,15 +63,17 @@ func TestListPullRequestNoAuth(t *testing.T) {
defaultHandler(t)(w, r)
}))
defer ts.Close()
svc, err := NewBitbucketServiceNoAuth(context.Background(), ts.URL, "PROJECT", "REPO")
assert.NoError(t, err)
svc, err := NewBitbucketServiceNoAuth(context.Background(), ts.URL, "PROJECT", "REPO", "", false, nil)
require.NoError(t, err)
pullRequests, err := ListPullRequests(context.Background(), svc, []v1alpha1.PullRequestGeneratorFilter{})
assert.NoError(t, err)
assert.Equal(t, 1, len(pullRequests))
require.NoError(t, err)
assert.Len(t, pullRequests, 1)
assert.Equal(t, 101, pullRequests[0].Number)
assert.Equal(t, "feat(ABC) : 123", pullRequests[0].Title)
assert.Equal(t, "feature-ABC-123", pullRequests[0].Branch)
assert.Equal(t, "master", pullRequests[0].TargetBranch)
assert.Equal(t, "cb3cf2e4d1517c83e720d2585b9402dbef71f992", pullRequests[0].HeadSHA)
assert.Equal(t, "testName", pullRequests[0].Author)
}
func TestListPullRequestPagination(t *testing.T) {
@@ -77,6 +89,7 @@ func TestListPullRequestPagination(t *testing.T) {
"values": [
{
"id": 101,
"title": "feat(101)",
"toRef": {
"latestCommit": "5b766e3564a3453808f3cd3dd3f2e5fad8ef0e7a",
"displayId": "master",
@@ -86,10 +99,16 @@ func TestListPullRequestPagination(t *testing.T) {
"id": "refs/heads/feature-101",
"displayId": "feature-101",
"latestCommit": "ab3cf2e4d1517c83e720d2585b9402dbef71f992"
},
"author": {
"user": {
"name": "testName"
}
}
},
{
"id": 102,
"title": "feat(102)",
"toRef": {
"latestCommit": "5b766e3564a3453808f3cd3dd3f2e5fad8ef0e7a",
"displayId": "branch",
@@ -99,6 +118,11 @@ func TestListPullRequestPagination(t *testing.T) {
"id": "refs/heads/feature-102",
"displayId": "feature-102",
"latestCommit": "bb3cf2e4d1517c83e720d2585b9402dbef71f992"
},
"author": {
"user": {
"name": "testName"
}
}
}
],
@@ -112,6 +136,7 @@ func TestListPullRequestPagination(t *testing.T) {
"values": [
{
"id": 200,
"title": "feat(200)",
"toRef": {
"latestCommit": "5b766e3564a3453808f3cd3dd3f2e5fad8ef0e7a",
"displayId": "master",
@@ -121,6 +146,11 @@ func TestListPullRequestPagination(t *testing.T) {
"id": "refs/heads/feature-200",
"displayId": "feature-200",
"latestCommit": "cb3cf2e4d1517c83e720d2585b9402dbef71f992"
},
"author": {
"user": {
"name": "testName"
}
}
}
],
@@ -134,31 +164,37 @@ func TestListPullRequestPagination(t *testing.T) {
}
}))
defer ts.Close()
svc, err := NewBitbucketServiceNoAuth(context.Background(), ts.URL, "PROJECT", "REPO")
assert.NoError(t, err)
svc, err := NewBitbucketServiceNoAuth(context.Background(), ts.URL, "PROJECT", "REPO", "", false, nil)
require.NoError(t, err)
pullRequests, err := ListPullRequests(context.Background(), svc, []v1alpha1.PullRequestGeneratorFilter{})
assert.NoError(t, err)
assert.Equal(t, 3, len(pullRequests))
require.NoError(t, err)
assert.Len(t, pullRequests, 3)
assert.Equal(t, PullRequest{
Number: 101,
Title: "feat(101)",
Branch: "feature-101",
TargetBranch: "master",
HeadSHA: "ab3cf2e4d1517c83e720d2585b9402dbef71f992",
Labels: []string{},
Author: "testName",
}, *pullRequests[0])
assert.Equal(t, PullRequest{
Number: 102,
Title: "feat(102)",
Branch: "feature-102",
TargetBranch: "branch",
HeadSHA: "bb3cf2e4d1517c83e720d2585b9402dbef71f992",
Labels: []string{},
Author: "testName",
}, *pullRequests[1])
assert.Equal(t, PullRequest{
Number: 200,
Title: "feat(200)",
Branch: "feature-200",
TargetBranch: "master",
HeadSHA: "cb3cf2e4d1517c83e720d2585b9402dbef71f992",
Labels: []string{},
Author: "testName",
}, *pullRequests[2])
}
@@ -170,24 +206,109 @@ func TestListPullRequestBasicAuth(t *testing.T) {
defaultHandler(t)(w, r)
}))
defer ts.Close()
svc, err := NewBitbucketServiceBasicAuth(context.Background(), "user", "password", ts.URL, "PROJECT", "REPO")
assert.NoError(t, err)
svc, err := NewBitbucketServiceBasicAuth(context.Background(), "user", "password", ts.URL, "PROJECT", "REPO", "", false, nil)
require.NoError(t, err)
pullRequests, err := ListPullRequests(context.Background(), svc, []v1alpha1.PullRequestGeneratorFilter{})
assert.NoError(t, err)
assert.Equal(t, 1, len(pullRequests))
require.NoError(t, err)
assert.Len(t, pullRequests, 1)
assert.Equal(t, 101, pullRequests[0].Number)
assert.Equal(t, "feature-ABC-123", pullRequests[0].Branch)
assert.Equal(t, "cb3cf2e4d1517c83e720d2585b9402dbef71f992", pullRequests[0].HeadSHA)
}
func TestListPullRequestBearerAuth(t *testing.T) {
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
assert.Equal(t, "Bearer tolkien", r.Header.Get("Authorization"))
assert.Equal(t, "no-check", r.Header.Get("X-Atlassian-Token"))
defaultHandler(t)(w, r)
}))
defer ts.Close()
svc, err := NewBitbucketServiceBearerToken(context.Background(), "tolkien", ts.URL, "PROJECT", "REPO", "", false, nil)
require.NoError(t, err)
pullRequests, err := ListPullRequests(context.Background(), svc, []v1alpha1.PullRequestGeneratorFilter{})
require.NoError(t, err)
assert.Len(t, pullRequests, 1)
assert.Equal(t, 101, pullRequests[0].Number)
assert.Equal(t, "feat(ABC) : 123", pullRequests[0].Title)
assert.Equal(t, "feature-ABC-123", pullRequests[0].Branch)
assert.Equal(t, "cb3cf2e4d1517c83e720d2585b9402dbef71f992", pullRequests[0].HeadSHA)
}
func TestListPullRequestTLS(t *testing.T) {
tests := []struct {
name string
tlsInsecure bool
passCerts bool
requireErr bool
}{
{
name: "TLS Insecure: true, No Certs",
tlsInsecure: true,
passCerts: false,
requireErr: false,
},
{
name: "TLS Insecure: true, With Certs",
tlsInsecure: true,
passCerts: true,
requireErr: false,
},
{
name: "TLS Insecure: false, With Certs",
tlsInsecure: false,
passCerts: true,
requireErr: false,
},
{
name: "TLS Insecure: false, No Certs",
tlsInsecure: false,
passCerts: false,
requireErr: true,
},
}
for _, test := range tests {
test := test
t.Run(test.name, func(t *testing.T) {
ts := httptest.NewTLSServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
defaultHandler(t)(w, r)
}))
defer ts.Close()
var certs []byte
if test.passCerts == true {
for _, cert := range ts.TLS.Certificates {
for _, c := range cert.Certificate {
parsedCert, err := x509.ParseCertificate(c)
require.NoError(t, err, "Failed to parse certificate")
certs = append(certs, pem.EncodeToMemory(&pem.Block{
Type: "CERTIFICATE",
Bytes: parsedCert.Raw,
})...)
}
}
}
svc, err := NewBitbucketServiceBasicAuth(context.Background(), "user", "password", ts.URL, "PROJECT", "REPO", "", test.tlsInsecure, certs)
require.NoError(t, err)
_, err = ListPullRequests(context.Background(), svc, []v1alpha1.PullRequestGeneratorFilter{})
if test.requireErr {
require.Error(t, err)
} else {
require.NoError(t, err)
}
})
}
}
func TestListResponseError(t *testing.T) {
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusInternalServerError)
}))
defer ts.Close()
svc, _ := NewBitbucketServiceNoAuth(context.Background(), ts.URL, "PROJECT", "REPO")
svc, _ := NewBitbucketServiceNoAuth(context.Background(), ts.URL, "PROJECT", "REPO", "", false, nil)
_, err := ListPullRequests(context.Background(), svc, []v1alpha1.PullRequestGeneratorFilter{})
assert.Error(t, err)
require.Error(t, err)
}
func TestListResponseMalformed(t *testing.T) {
@@ -210,9 +331,9 @@ func TestListResponseMalformed(t *testing.T) {
}
}))
defer ts.Close()
svc, _ := NewBitbucketServiceNoAuth(context.Background(), ts.URL, "PROJECT", "REPO")
svc, _ := NewBitbucketServiceNoAuth(context.Background(), ts.URL, "PROJECT", "REPO", "", false, nil)
_, err := ListPullRequests(context.Background(), svc, []v1alpha1.PullRequestGeneratorFilter{})
assert.Error(t, err)
require.Error(t, err)
}
func TestListResponseEmpty(t *testing.T) {
@@ -235,10 +356,10 @@ func TestListResponseEmpty(t *testing.T) {
}
}))
defer ts.Close()
svc, err := NewBitbucketServiceNoAuth(context.Background(), ts.URL, "PROJECT", "REPO")
assert.NoError(t, err)
svc, err := NewBitbucketServiceNoAuth(context.Background(), ts.URL, "PROJECT", "REPO", "", false, nil)
require.NoError(t, err)
pullRequests, err := ListPullRequests(context.Background(), svc, []v1alpha1.PullRequestGeneratorFilter{})
assert.NoError(t, err)
require.NoError(t, err)
assert.Empty(t, pullRequests)
}
@@ -255,6 +376,7 @@ func TestListPullRequestBranchMatch(t *testing.T) {
"values": [
{
"id": 101,
"title": "feat(101)",
"toRef": {
"latestCommit": "5b766e3564a3453808f3cd3dd3f2e5fad8ef0e7a",
"displayId": "master",
@@ -264,10 +386,16 @@ func TestListPullRequestBranchMatch(t *testing.T) {
"id": "refs/heads/feature-101",
"displayId": "feature-101",
"latestCommit": "ab3cf2e4d1517c83e720d2585b9402dbef71f992"
},
"author": {
"user": {
"name": "testName"
}
}
},
{
"id": 102,
"title": "feat(102)",
"toRef": {
"latestCommit": "5b766e3564a3453808f3cd3dd3f2e5fad8ef0e7a",
"displayId": "branch",
@@ -277,6 +405,11 @@ func TestListPullRequestBranchMatch(t *testing.T) {
"id": "refs/heads/feature-102",
"displayId": "feature-102",
"latestCommit": "bb3cf2e4d1517c83e720d2585b9402dbef71f992"
},
"author": {
"user": {
"name": "testName"
}
}
}
],
@@ -290,6 +423,7 @@ func TestListPullRequestBranchMatch(t *testing.T) {
"values": [
{
"id": 200,
"title": "feat(200)",
"toRef": {
"latestCommit": "5b766e3564a3453808f3cd3dd3f2e5fad8ef0e7a",
"displayId": "master",
@@ -299,6 +433,11 @@ func TestListPullRequestBranchMatch(t *testing.T) {
"id": "refs/heads/feature-200",
"displayId": "feature-200",
"latestCommit": "cb3cf2e4d1517c83e720d2585b9402dbef71f992"
},
"author": {
"user": {
"name": "testName"
}
}
}
],
@@ -313,55 +452,61 @@ func TestListPullRequestBranchMatch(t *testing.T) {
}))
defer ts.Close()
regexp := `feature-1[\d]{2}`
svc, err := NewBitbucketServiceNoAuth(context.Background(), ts.URL, "PROJECT", "REPO")
assert.NoError(t, err)
svc, err := NewBitbucketServiceNoAuth(context.Background(), ts.URL, "PROJECT", "REPO", "", false, nil)
require.NoError(t, err)
pullRequests, err := ListPullRequests(context.Background(), svc, []v1alpha1.PullRequestGeneratorFilter{
{
BranchMatch: &regexp,
},
})
assert.NoError(t, err)
assert.Equal(t, 2, len(pullRequests))
require.NoError(t, err)
assert.Len(t, pullRequests, 2)
assert.Equal(t, PullRequest{
Number: 101,
Title: "feat(101)",
Branch: "feature-101",
TargetBranch: "master",
HeadSHA: "ab3cf2e4d1517c83e720d2585b9402dbef71f992",
Labels: []string{},
Author: "testName",
}, *pullRequests[0])
assert.Equal(t, PullRequest{
Number: 102,
Title: "feat(102)",
Branch: "feature-102",
TargetBranch: "branch",
HeadSHA: "bb3cf2e4d1517c83e720d2585b9402dbef71f992",
Labels: []string{},
Author: "testName",
}, *pullRequests[1])
regexp = `.*2$`
svc, err = NewBitbucketServiceNoAuth(context.Background(), ts.URL, "PROJECT", "REPO")
assert.NoError(t, err)
svc, err = NewBitbucketServiceNoAuth(context.Background(), ts.URL, "PROJECT", "REPO", "", false, nil)
require.NoError(t, err)
pullRequests, err = ListPullRequests(context.Background(), svc, []v1alpha1.PullRequestGeneratorFilter{
{
BranchMatch: &regexp,
},
})
assert.NoError(t, err)
assert.Equal(t, 1, len(pullRequests))
require.NoError(t, err)
assert.Len(t, pullRequests, 1)
assert.Equal(t, PullRequest{
Number: 102,
Title: "feat(102)",
Branch: "feature-102",
TargetBranch: "branch",
HeadSHA: "bb3cf2e4d1517c83e720d2585b9402dbef71f992",
Labels: []string{},
Author: "testName",
}, *pullRequests[0])
regexp = `[\d{2}`
svc, err = NewBitbucketServiceNoAuth(context.Background(), ts.URL, "PROJECT", "REPO")
assert.NoError(t, err)
svc, err = NewBitbucketServiceNoAuth(context.Background(), ts.URL, "PROJECT", "REPO", "", false, nil)
require.NoError(t, err)
_, err = ListPullRequests(context.Background(), svc, []v1alpha1.PullRequestGeneratorFilter{
{
BranchMatch: &regexp,
},
})
assert.Error(t, err)
require.Error(t, err)
}

View File

@@ -57,10 +57,12 @@ func (g *GiteaService) List(ctx context.Context) ([]*PullRequest, error) {
for _, pr := range prs {
list = append(list, &PullRequest{
Number: int(pr.Index),
Title: pr.Title,
Branch: pr.Head.Ref,
TargetBranch: pr.Base.Ref,
HeadSHA: pr.Head.Sha,
Labels: getGiteaPRLabelNames(pr.Labels),
Author: pr.Poster.UserName,
})
}
return list, nil

View File

@@ -10,6 +10,7 @@ import (
"code.gitea.io/sdk/gitea"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func giteaMockHandler(t *testing.T) func(http.ResponseWriter, *http.Request) {
@@ -250,14 +251,16 @@ func TestGiteaList(t *testing.T) {
giteaMockHandler(t)(w, r)
}))
host, err := NewGiteaService(context.Background(), "", ts.URL, "test-argocd", "pr-test", false)
assert.Nil(t, err)
require.NoError(t, err)
prs, err := host.List(context.Background())
assert.Nil(t, err)
assert.Equal(t, len(prs), 1)
assert.Equal(t, prs[0].Number, 1)
assert.Equal(t, prs[0].Branch, "test")
assert.Equal(t, prs[0].TargetBranch, "main")
assert.Equal(t, prs[0].HeadSHA, "7bbaf62d92ddfafd9cc8b340c619abaec32bc09f")
require.NoError(t, err)
assert.Len(t, prs, 1)
assert.Equal(t, 1, prs[0].Number)
assert.Equal(t, "add an empty file", prs[0].Title)
assert.Equal(t, "test", prs[0].Branch)
assert.Equal(t, "main", prs[0].TargetBranch)
assert.Equal(t, "7bbaf62d92ddfafd9cc8b340c619abaec32bc09f", prs[0].HeadSHA)
assert.Equal(t, "graytshirt", prs[0].Author)
}
func TestGetGiteaPRLabelNames(t *testing.T) {

View File

@@ -5,7 +5,7 @@ import (
"fmt"
"os"
"github.com/google/go-github/v35/github"
"github.com/google/go-github/v63/github"
"golang.org/x/oauth2"
)
@@ -35,7 +35,7 @@ func NewGithubService(ctx context.Context, token, url, owner, repo string, label
client = github.NewClient(httpClient)
} else {
var err error
client, err = github.NewEnterpriseClient(url, url, httpClient)
client, err = github.NewClient(httpClient).WithEnterpriseURLs(url, url)
if err != nil {
return nil, err
}
@@ -66,10 +66,12 @@ func (g *GithubService) List(ctx context.Context) ([]*PullRequest, error) {
}
pullRequests = append(pullRequests, &PullRequest{
Number: *pull.Number,
Title: *pull.Title,
Branch: *pull.Head.Ref,
TargetBranch: *pull.Base.Ref,
HeadSHA: *pull.Head.SHA,
Labels: getGithubPRLabelNames(pull.Labels),
Author: *pull.User.Login,
})
}
if resp.NextPage == 0 {

View File

@@ -3,7 +3,7 @@ package pull_request
import (
"testing"
"github.com/google/go-github/v35/github"
"github.com/google/go-github/v63/github"
"github.com/stretchr/testify/assert"
)

View File

@@ -6,9 +6,10 @@ import (
"net/http"
"os"
"github.com/argoproj/argo-cd/v2/applicationset/utils"
"github.com/hashicorp/go-retryablehttp"
gitlab "github.com/xanzy/go-gitlab"
"github.com/argoproj/argo-cd/v2/applicationset/utils"
)
type GitLabService struct {
@@ -20,7 +21,7 @@ type GitLabService struct {
var _ PullRequestService = (*GitLabService)(nil)
func NewGitLabService(ctx context.Context, token, url, project string, labels []string, pullRequestState string, scmRootCAPath string, insecure bool) (PullRequestService, error) {
func NewGitLabService(ctx context.Context, token, url, project string, labels []string, pullRequestState string, scmRootCAPath string, insecure bool, caCerts []byte) (PullRequestService, error) {
var clientOptionFns []gitlab.ClientOptionFunc
// Set a custom Gitlab base URL if one is provided
@@ -33,7 +34,7 @@ func NewGitLabService(ctx context.Context, token, url, project string, labels []
}
tr := http.DefaultTransport.(*http.Transport).Clone()
tr.TLSClientConfig = utils.GetTlsConfig(scmRootCAPath, insecure)
tr.TLSClientConfig = utils.GetTlsConfig(scmRootCAPath, insecure, caCerts)
retryClient := retryablehttp.NewClient()
retryClient.HTTPClient.Transport = tr
@@ -42,7 +43,7 @@ func NewGitLabService(ctx context.Context, token, url, project string, labels []
client, err := gitlab.NewClient(token, clientOptionFns...)
if err != nil {
return nil, fmt.Errorf("error creating Gitlab client: %v", err)
return nil, fmt.Errorf("error creating Gitlab client: %w", err)
}
return &GitLabService{
@@ -54,13 +55,12 @@ func NewGitLabService(ctx context.Context, token, url, project string, labels []
}
func (g *GitLabService) List(ctx context.Context) ([]*PullRequest, error) {
// Filter the merge requests on labels, if they are specified.
var labels *gitlab.Labels
var labels *gitlab.LabelOptions
if len(g.labels) > 0 {
labels = (*gitlab.Labels)(&g.labels)
var labelsList gitlab.LabelOptions = g.labels
labels = &labelsList
}
opts := &gitlab.ListProjectMergeRequestsOptions{
ListOptions: gitlab.ListOptions{
PerPage: 100,
@@ -76,15 +76,17 @@ func (g *GitLabService) List(ctx context.Context) ([]*PullRequest, error) {
for {
mrs, resp, err := g.client.MergeRequests.ListProjectMergeRequests(g.project, opts)
if err != nil {
return nil, fmt.Errorf("error listing merge requests for project '%s': %v", g.project, err)
return nil, fmt.Errorf("error listing merge requests for project '%s': %w", g.project, err)
}
for _, mr := range mrs {
pullRequests = append(pullRequests, &PullRequest{
Number: mr.IID,
Title: mr.Title,
Branch: mr.SourceBranch,
TargetBranch: mr.TargetBranch,
HeadSHA: mr.SHA,
Labels: mr.Labels,
Author: mr.Author.Username,
})
}
if resp.NextPage == 0 {

View File

@@ -2,6 +2,8 @@ package pull_request
import (
"context"
"crypto/x509"
"encoding/pem"
"io"
"net/http"
"net/http/httptest"
@@ -9,6 +11,7 @@ import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func writeMRListResponse(t *testing.T, w io.Writer) {
@@ -34,11 +37,11 @@ func TestGitLabServiceCustomBaseURL(t *testing.T) {
writeMRListResponse(t, w)
})
svc, err := NewGitLabService(context.Background(), "", server.URL, "278964", nil, "", "", false)
assert.NoError(t, err)
svc, err := NewGitLabService(context.Background(), "", server.URL, "278964", nil, "", "", false, nil)
require.NoError(t, err)
_, err = svc.List(context.Background())
assert.NoError(t, err)
require.NoError(t, err)
}
func TestGitLabServiceToken(t *testing.T) {
@@ -53,11 +56,11 @@ func TestGitLabServiceToken(t *testing.T) {
writeMRListResponse(t, w)
})
svc, err := NewGitLabService(context.Background(), "token-123", server.URL, "278964", nil, "", "", false)
assert.NoError(t, err)
svc, err := NewGitLabService(context.Background(), "token-123", server.URL, "278964", nil, "", "", false, nil)
require.NoError(t, err)
_, err = svc.List(context.Background())
assert.NoError(t, err)
require.NoError(t, err)
}
func TestList(t *testing.T) {
@@ -72,16 +75,18 @@ func TestList(t *testing.T) {
writeMRListResponse(t, w)
})
svc, err := NewGitLabService(context.Background(), "", server.URL, "278964", []string{}, "", "", false)
assert.NoError(t, err)
svc, err := NewGitLabService(context.Background(), "", server.URL, "278964", []string{}, "", "", false, nil)
require.NoError(t, err)
prs, err := svc.List(context.Background())
assert.NoError(t, err)
require.NoError(t, err)
assert.Len(t, prs, 1)
assert.Equal(t, prs[0].Number, 15442)
assert.Equal(t, prs[0].Branch, "use-structured-logging-for-db-load-balancer")
assert.Equal(t, prs[0].TargetBranch, "master")
assert.Equal(t, prs[0].HeadSHA, "2fc4e8b972ff3208ec63b6143e34ad67ff343ad7")
assert.Equal(t, 15442, prs[0].Number)
assert.Equal(t, "Draft: Use structured logging for DB load balancer", prs[0].Title)
assert.Equal(t, "use-structured-logging-for-db-load-balancer", prs[0].Branch)
assert.Equal(t, "master", prs[0].TargetBranch)
assert.Equal(t, "2fc4e8b972ff3208ec63b6143e34ad67ff343ad7", prs[0].HeadSHA)
assert.Equal(t, "hfyngvason", prs[0].Author)
}
func TestListWithLabels(t *testing.T) {
@@ -96,11 +101,11 @@ func TestListWithLabels(t *testing.T) {
writeMRListResponse(t, w)
})
svc, err := NewGitLabService(context.Background(), "", server.URL, "278964", []string{"feature", "ready"}, "", "", false)
assert.NoError(t, err)
svc, err := NewGitLabService(context.Background(), "", server.URL, "278964", []string{"feature", "ready"}, "", "", false, nil)
require.NoError(t, err)
_, err = svc.List(context.Background())
assert.NoError(t, err)
require.NoError(t, err)
}
func TestListWithState(t *testing.T) {
@@ -115,9 +120,77 @@ func TestListWithState(t *testing.T) {
writeMRListResponse(t, w)
})
svc, err := NewGitLabService(context.Background(), "", server.URL, "278964", []string{}, "opened", "", false)
assert.NoError(t, err)
svc, err := NewGitLabService(context.Background(), "", server.URL, "278964", []string{}, "opened", "", false, nil)
require.NoError(t, err)
_, err = svc.List(context.Background())
assert.NoError(t, err)
require.NoError(t, err)
}
func TestListWithStateTLS(t *testing.T) {
tests := []struct {
name string
tlsInsecure bool
passCerts bool
requireErr bool
}{
{
name: "TLS Insecure: true, No Certs",
tlsInsecure: true,
passCerts: false,
requireErr: false,
},
{
name: "TLS Insecure: true, With Certs",
tlsInsecure: true,
passCerts: true,
requireErr: false,
},
{
name: "TLS Insecure: false, With Certs",
tlsInsecure: false,
passCerts: true,
requireErr: false,
},
{
name: "TLS Insecure: false, No Certs",
tlsInsecure: false,
passCerts: false,
requireErr: true,
},
}
for _, test := range tests {
test := test
t.Run(test.name, func(t *testing.T) {
ts := httptest.NewTLSServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
writeMRListResponse(t, w)
}))
defer ts.Close()
var certs []byte
if test.passCerts == true {
for _, cert := range ts.TLS.Certificates {
for _, c := range cert.Certificate {
parsedCert, err := x509.ParseCertificate(c)
require.NoError(t, err, "Failed to parse certificate")
certs = append(certs, pem.EncodeToMemory(&pem.Block{
Type: "CERTIFICATE",
Bytes: parsedCert.Raw,
})...)
}
}
}
svc, err := NewGitLabService(context.Background(), "", ts.URL, "278964", []string{}, "opened", "", test.tlsInsecure, certs)
require.NoError(t, err)
_, err = svc.List(context.Background())
if test.requireErr {
require.Error(t, err)
} else {
require.NoError(t, err)
}
})
}
}

View File

@@ -8,6 +8,8 @@ import (
type PullRequest struct {
// Number is a number that will be the ID of the pull request.
Number int
// Title of the pull request.
Title string
// Branch is the name of the branch from which the pull request originated.
Branch string
// TargetBranch is the name of the target branch of the pull request.
@@ -16,6 +18,8 @@ type PullRequest struct {
HeadSHA string
// Labels of the pull request.
Labels []string
// Author is the author of the pull request.
Author string
}
type PullRequestService interface {

View File

@@ -16,13 +16,13 @@ func compileFilters(filters []argoprojiov1alpha1.PullRequestGeneratorFilter) ([]
if filter.BranchMatch != nil {
outFilter.BranchMatch, err = regexp.Compile(*filter.BranchMatch)
if err != nil {
return nil, fmt.Errorf("error compiling BranchMatch regexp %q: %v", *filter.BranchMatch, err)
return nil, fmt.Errorf("error compiling BranchMatch regexp %q: %w", *filter.BranchMatch, err)
}
}
if filter.TargetBranchMatch != nil {
outFilter.TargetBranchMatch, err = regexp.Compile(*filter.TargetBranchMatch)
if err != nil {
return nil, fmt.Errorf("error compiling TargetBranchMatch regexp %q: %v", *filter.TargetBranchMatch, err)
return nil, fmt.Errorf("error compiling TargetBranchMatch regexp %q: %w", *filter.TargetBranchMatch, err)
}
}
outFilters = append(outFilters, outFilter)

View File

@@ -4,22 +4,27 @@ import (
"context"
"testing"
argoprojiov1alpha1 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
argoprojiov1alpha1 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
)
func strp(s string) *string {
return &s
}
func TestFilterBranchMatchBadRegexp(t *testing.T) {
provider, _ := NewFakeService(
context.Background(),
[]*PullRequest{
{
Number: 1,
Title: "PR branch1",
Branch: "branch1",
TargetBranch: "master",
HeadSHA: "089d92cbf9ff857a39e6feccd32798ca700fb958",
Author: "name1",
},
},
nil,
@@ -30,7 +35,7 @@ func TestFilterBranchMatchBadRegexp(t *testing.T) {
},
}
_, err := ListPullRequests(context.Background(), provider, filters)
assert.Error(t, err)
require.Error(t, err)
}
func TestFilterBranchMatch(t *testing.T) {
@@ -39,27 +44,35 @@ func TestFilterBranchMatch(t *testing.T) {
[]*PullRequest{
{
Number: 1,
Title: "PR one",
Branch: "one",
TargetBranch: "master",
HeadSHA: "189d92cbf9ff857a39e6feccd32798ca700fb958",
Author: "name1",
},
{
Number: 2,
Title: "PR two",
Branch: "two",
TargetBranch: "master",
HeadSHA: "289d92cbf9ff857a39e6feccd32798ca700fb958",
Author: "name2",
},
{
Number: 3,
Title: "PR three",
Branch: "three",
TargetBranch: "master",
HeadSHA: "389d92cbf9ff857a39e6feccd32798ca700fb958",
Author: "name3",
},
{
Number: 4,
Title: "PR four",
Branch: "four",
TargetBranch: "master",
HeadSHA: "489d92cbf9ff857a39e6feccd32798ca700fb958",
Author: "name4",
},
},
nil,
@@ -70,7 +83,7 @@ func TestFilterBranchMatch(t *testing.T) {
},
}
pullRequests, err := ListPullRequests(context.Background(), provider, filters)
assert.NoError(t, err)
require.NoError(t, err)
assert.Len(t, pullRequests, 1)
assert.Equal(t, "two", pullRequests[0].Branch)
}
@@ -81,27 +94,35 @@ func TestFilterTargetBranchMatch(t *testing.T) {
[]*PullRequest{
{
Number: 1,
Title: "PR one",
Branch: "one",
TargetBranch: "master",
HeadSHA: "189d92cbf9ff857a39e6feccd32798ca700fb958",
Author: "name1",
},
{
Number: 2,
Title: "PR two",
Branch: "two",
TargetBranch: "branch1",
HeadSHA: "289d92cbf9ff857a39e6feccd32798ca700fb958",
Author: "name2",
},
{
Number: 3,
Title: "PR three",
Branch: "three",
TargetBranch: "branch2",
HeadSHA: "389d92cbf9ff857a39e6feccd32798ca700fb958",
Author: "name3",
},
{
Number: 4,
Title: "PR four",
Branch: "four",
TargetBranch: "branch3",
HeadSHA: "489d92cbf9ff857a39e6feccd32798ca700fb958",
Author: "name4",
},
},
nil,
@@ -112,7 +133,7 @@ func TestFilterTargetBranchMatch(t *testing.T) {
},
}
pullRequests, err := ListPullRequests(context.Background(), provider, filters)
assert.NoError(t, err)
require.NoError(t, err)
assert.Len(t, pullRequests, 1)
assert.Equal(t, "two", pullRequests[0].Branch)
}
@@ -123,27 +144,35 @@ func TestMultiFilterOr(t *testing.T) {
[]*PullRequest{
{
Number: 1,
Title: "PR one",
Branch: "one",
TargetBranch: "master",
HeadSHA: "189d92cbf9ff857a39e6feccd32798ca700fb958",
Author: "name1",
},
{
Number: 2,
Title: "PR two",
Branch: "two",
TargetBranch: "master",
HeadSHA: "289d92cbf9ff857a39e6feccd32798ca700fb958",
Author: "name2",
},
{
Number: 3,
Title: "PR three",
Branch: "three",
TargetBranch: "master",
HeadSHA: "389d92cbf9ff857a39e6feccd32798ca700fb958",
Author: "name3",
},
{
Number: 4,
Title: "PR four",
Branch: "four",
TargetBranch: "master",
HeadSHA: "489d92cbf9ff857a39e6feccd32798ca700fb958",
Author: "name4",
},
},
nil,
@@ -157,7 +186,7 @@ func TestMultiFilterOr(t *testing.T) {
},
}
pullRequests, err := ListPullRequests(context.Background(), provider, filters)
assert.NoError(t, err)
require.NoError(t, err)
assert.Len(t, pullRequests, 3)
assert.Equal(t, "two", pullRequests[0].Branch)
assert.Equal(t, "three", pullRequests[1].Branch)
@@ -170,27 +199,35 @@ func TestMultiFilterOrWithTargetBranchFilter(t *testing.T) {
[]*PullRequest{
{
Number: 1,
Title: "PR one",
Branch: "one",
TargetBranch: "master",
HeadSHA: "189d92cbf9ff857a39e6feccd32798ca700fb958",
Author: "name1",
},
{
Number: 2,
Title: "PR two",
Branch: "two",
TargetBranch: "branch1",
HeadSHA: "289d92cbf9ff857a39e6feccd32798ca700fb958",
Author: "name2",
},
{
Number: 3,
Title: "PR three",
Branch: "three",
TargetBranch: "branch2",
HeadSHA: "389d92cbf9ff857a39e6feccd32798ca700fb958",
Author: "name3",
},
{
Number: 4,
Title: "PR four",
Branch: "four",
TargetBranch: "branch3",
HeadSHA: "489d92cbf9ff857a39e6feccd32798ca700fb958",
Author: "name4",
},
},
nil,
@@ -206,7 +243,7 @@ func TestMultiFilterOrWithTargetBranchFilter(t *testing.T) {
},
}
pullRequests, err := ListPullRequests(context.Background(), provider, filters)
assert.NoError(t, err)
require.NoError(t, err)
assert.Len(t, pullRequests, 2)
assert.Equal(t, "two", pullRequests[0].Branch)
assert.Equal(t, "four", pullRequests[1].Branch)
@@ -218,22 +255,26 @@ func TestNoFilters(t *testing.T) {
[]*PullRequest{
{
Number: 1,
Title: "PR one",
Branch: "one",
TargetBranch: "master",
HeadSHA: "189d92cbf9ff857a39e6feccd32798ca700fb958",
Author: "name1",
},
{
Number: 2,
Title: "PR two",
Branch: "two",
TargetBranch: "master",
HeadSHA: "289d92cbf9ff857a39e6feccd32798ca700fb958",
Author: "name2",
},
},
nil,
)
filters := []argoprojiov1alpha1.PullRequestGeneratorFilter{}
repos, err := ListPullRequests(context.Background(), provider, filters)
assert.NoError(t, err)
require.NoError(t, err)
assert.Len(t, repos, 2)
assert.Equal(t, "one", repos[0].Branch)
assert.Equal(t, "two", repos[1].Branch)

View File

@@ -6,49 +6,37 @@ import (
"github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
"github.com/argoproj/argo-cd/v2/reposerver/apiclient"
"github.com/argoproj/argo-cd/v2/util/db"
"github.com/argoproj/argo-cd/v2/util/git"
"github.com/argoproj/argo-cd/v2/util/io"
)
//go:generate go run github.com/vektra/mockery/v2@v2.25.1 --name=RepositoryDB
// RepositoryDB Is a lean facade for ArgoDB,
// Using a lean interface makes it easier to test the functionality of the git generator
type RepositoryDB interface {
GetRepository(ctx context.Context, url string) (*v1alpha1.Repository, error)
}
type argoCDService struct {
repositoriesDB RepositoryDB
getRepository func(ctx context.Context, url, project string) (*v1alpha1.Repository, error)
storecreds git.CredsStore
submoduleEnabled bool
repoServerClientSet apiclient.Clientset
newFileGlobbingEnabled bool
}
//go:generate go run github.com/vektra/mockery/v2@v2.25.1 --name=Repos
type Repos interface {
// GetFiles returns content of files (not directories) within the target repo
GetFiles(ctx context.Context, repoURL string, revision string, pattern string, noRevisionCache bool) (map[string][]byte, error)
GetFiles(ctx context.Context, repoURL string, revision string, pattern string, noRevisionCache, verifyCommit bool) (map[string][]byte, error)
// GetDirectories returns a list of directories (not files) within the target repo
GetDirectories(ctx context.Context, repoURL string, revision string, noRevisionCache bool) ([]string, error)
GetDirectories(ctx context.Context, repoURL string, revision string, noRevisionCache, verifyCommit bool) ([]string, error)
}
func NewArgoCDService(db db.ArgoDB, submoduleEnabled bool, repoClientset apiclient.Clientset, newFileGlobbingEnabled bool) (Repos, error) {
func NewArgoCDService(getRepository func(ctx context.Context, url, project string) (*v1alpha1.Repository, error), submoduleEnabled bool, repoClientset apiclient.Clientset, newFileGlobbingEnabled bool) (Repos, error) {
return &argoCDService{
repositoriesDB: db.(RepositoryDB),
getRepository: getRepository,
submoduleEnabled: submoduleEnabled,
repoServerClientSet: repoClientset,
newFileGlobbingEnabled: newFileGlobbingEnabled,
}, nil
}
func (a *argoCDService) GetFiles(ctx context.Context, repoURL string, revision string, pattern string, noRevisionCache bool) (map[string][]byte, error) {
repo, err := a.repositoriesDB.GetRepository(ctx, repoURL)
func (a *argoCDService) GetFiles(ctx context.Context, repoURL string, revision string, pattern string, noRevisionCache, verifyCommit bool) (map[string][]byte, error) {
repo, err := a.getRepository(ctx, repoURL, "")
if err != nil {
return nil, fmt.Errorf("error in GetRepository: %w", err)
}
@@ -60,6 +48,7 @@ func (a *argoCDService) GetFiles(ctx context.Context, repoURL string, revision s
Path: pattern,
NewGitFileGlobbingEnabled: a.newFileGlobbingEnabled,
NoRevisionCache: noRevisionCache,
VerifyCommit: verifyCommit,
}
closer, client, err := a.repoServerClientSet.NewRepoServerClient()
if err != nil {
@@ -74,8 +63,8 @@ func (a *argoCDService) GetFiles(ctx context.Context, repoURL string, revision s
return fileResponse.GetMap(), nil
}
func (a *argoCDService) GetDirectories(ctx context.Context, repoURL string, revision string, noRevisionCache bool) ([]string, error) {
repo, err := a.repositoriesDB.GetRepository(ctx, repoURL)
func (a *argoCDService) GetDirectories(ctx context.Context, repoURL string, revision string, noRevisionCache, verifyCommit bool) ([]string, error) {
repo, err := a.getRepository(ctx, repoURL, "")
if err != nil {
return nil, fmt.Errorf("error in GetRepository: %w", err)
}
@@ -85,6 +74,7 @@ func (a *argoCDService) GetDirectories(ctx context.Context, repoURL string, revi
SubmoduleEnabled: a.submoduleEnabled,
Revision: revision,
NoRevisionCache: noRevisionCache,
VerifyCommit: verifyCommit,
}
closer, client, err := a.repoServerClientSet.NewRepoServerClient()
@@ -98,5 +88,4 @@ func (a *argoCDService) GetDirectories(ctx context.Context, repoURL string, revi
return nil, fmt.Errorf("error retrieving Git Directories: %w", err)
}
return dirResponse.GetPaths(), nil
}

View File

@@ -5,23 +5,22 @@ import (
"fmt"
"testing"
"github.com/argoproj/argo-cd/v2/applicationset/services/mocks"
"github.com/argoproj/argo-cd/v2/reposerver/apiclient"
repo_mocks "github.com/argoproj/argo-cd/v2/reposerver/apiclient/mocks"
db_mocks "github.com/argoproj/argo-cd/v2/util/db/mocks"
"github.com/argoproj/argo-cd/v2/util/git"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"
"github.com/argoproj/argo-cd/v2/reposerver/apiclient"
repo_mocks "github.com/argoproj/argo-cd/v2/reposerver/apiclient/mocks"
"github.com/argoproj/argo-cd/v2/util/git"
"github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
)
func TestGetDirectories(t *testing.T) {
type fields struct {
repositoriesDBFuncs []func(*mocks.RepositoryDB)
storecreds git.CredsStore
submoduleEnabled bool
getRepository func(ctx context.Context, url, project string) (*v1alpha1.Repository, error)
repoServerClientFuncs []func(*repo_mocks.RepoServerServiceClient)
}
type args struct {
@@ -29,6 +28,7 @@ func TestGetDirectories(t *testing.T) {
repoURL string
revision string
noRevisionCache bool
verifyCommit bool
}
tests := []struct {
name string
@@ -38,17 +38,13 @@ func TestGetDirectories(t *testing.T) {
wantErr assert.ErrorAssertionFunc
}{
{name: "ErrorGettingRepos", fields: fields{
repositoriesDBFuncs: []func(*mocks.RepositoryDB){
func(db *mocks.RepositoryDB) {
db.On("GetRepository", mock.Anything, mock.Anything).Return(nil, fmt.Errorf("unable to get repos"))
},
getRepository: func(ctx context.Context, url, project string) (*v1alpha1.Repository, error) {
return nil, fmt.Errorf("unable to get repos")
},
}, args: args{}, want: nil, wantErr: assert.Error},
{name: "ErrorGettingDirs", fields: fields{
repositoriesDBFuncs: []func(*mocks.RepositoryDB){
func(db *mocks.RepositoryDB) {
db.On("GetRepository", mock.Anything, mock.Anything).Return(&v1alpha1.Repository{}, nil)
},
getRepository: func(ctx context.Context, url, project string) (*v1alpha1.Repository, error) {
return &v1alpha1.Repository{}, nil
},
repoServerClientFuncs: []func(*repo_mocks.RepoServerServiceClient){
func(client *repo_mocks.RepoServerServiceClient) {
@@ -57,10 +53,8 @@ func TestGetDirectories(t *testing.T) {
},
}, args: args{}, want: nil, wantErr: assert.Error},
{name: "HappyCase", fields: fields{
repositoriesDBFuncs: []func(*mocks.RepositoryDB){
func(db *mocks.RepositoryDB) {
db.On("GetRepository", mock.Anything, mock.Anything).Return(&v1alpha1.Repository{}, nil)
},
getRepository: func(ctx context.Context, url, project string) (*v1alpha1.Repository, error) {
return &v1alpha1.Repository{}, nil
},
repoServerClientFuncs: []func(*repo_mocks.RepoServerServiceClient){
func(client *repo_mocks.RepoServerServiceClient) {
@@ -70,26 +64,32 @@ func TestGetDirectories(t *testing.T) {
},
},
}, args: args{}, want: []string{"foo", "foo/bar", "bar/foo"}, wantErr: assert.NoError},
{name: "ErrorVerifyingCommit", fields: fields{
getRepository: func(ctx context.Context, url, project string) (*v1alpha1.Repository, error) {
return &v1alpha1.Repository{}, nil
},
repoServerClientFuncs: []func(*repo_mocks.RepoServerServiceClient){
func(client *repo_mocks.RepoServerServiceClient) {
client.On("GetGitDirectories", mock.Anything, mock.Anything).Return(nil, fmt.Errorf("revision HEAD is not signed"))
},
},
}, args: args{}, want: nil, wantErr: assert.Error},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
mockDb := &mocks.RepositoryDB{}
mockRepoClient := &repo_mocks.RepoServerServiceClient{}
// decorate the mocks
for i := range tt.fields.repositoriesDBFuncs {
tt.fields.repositoriesDBFuncs[i](mockDb)
}
for i := range tt.fields.repoServerClientFuncs {
tt.fields.repoServerClientFuncs[i](mockRepoClient)
}
a := &argoCDService{
repositoriesDB: mockDb,
getRepository: tt.fields.getRepository,
storecreds: tt.fields.storecreds,
submoduleEnabled: tt.fields.submoduleEnabled,
repoServerClientSet: &repo_mocks.Clientset{RepoServerServiceClient: mockRepoClient},
}
got, err := a.GetDirectories(tt.args.ctx, tt.args.repoURL, tt.args.revision, tt.args.noRevisionCache)
got, err := a.GetDirectories(tt.args.ctx, tt.args.repoURL, tt.args.revision, tt.args.noRevisionCache, tt.args.verifyCommit)
if !tt.wantErr(t, err, fmt.Sprintf("GetDirectories(%v, %v, %v, %v)", tt.args.ctx, tt.args.repoURL, tt.args.revision, tt.args.noRevisionCache)) {
return
}
@@ -100,10 +100,10 @@ func TestGetDirectories(t *testing.T) {
func TestGetFiles(t *testing.T) {
type fields struct {
repositoriesDBFuncs []func(*mocks.RepositoryDB)
storecreds git.CredsStore
submoduleEnabled bool
repoServerClientFuncs []func(*repo_mocks.RepoServerServiceClient)
getRepository func(ctx context.Context, url, project string) (*v1alpha1.Repository, error)
}
type args struct {
ctx context.Context
@@ -111,6 +111,7 @@ func TestGetFiles(t *testing.T) {
revision string
pattern string
noRevisionCache bool
verifyCommit bool
}
tests := []struct {
name string
@@ -120,17 +121,13 @@ func TestGetFiles(t *testing.T) {
wantErr assert.ErrorAssertionFunc
}{
{name: "ErrorGettingRepos", fields: fields{
repositoriesDBFuncs: []func(*mocks.RepositoryDB){
func(db *mocks.RepositoryDB) {
db.On("GetRepository", mock.Anything, mock.Anything).Return(nil, fmt.Errorf("unable to get repos"))
},
getRepository: func(ctx context.Context, url, project string) (*v1alpha1.Repository, error) {
return nil, fmt.Errorf("unable to get repos")
},
}, args: args{}, want: nil, wantErr: assert.Error},
{name: "ErrorGettingFiles", fields: fields{
repositoriesDBFuncs: []func(*mocks.RepositoryDB){
func(db *mocks.RepositoryDB) {
db.On("GetRepository", mock.Anything, mock.Anything).Return(&v1alpha1.Repository{}, nil)
},
getRepository: func(ctx context.Context, url, project string) (*v1alpha1.Repository, error) {
return &v1alpha1.Repository{}, nil
},
repoServerClientFuncs: []func(*repo_mocks.RepoServerServiceClient){
func(client *repo_mocks.RepoServerServiceClient) {
@@ -139,10 +136,8 @@ func TestGetFiles(t *testing.T) {
},
}, args: args{}, want: nil, wantErr: assert.Error},
{name: "HappyCase", fields: fields{
repositoriesDBFuncs: []func(*mocks.RepositoryDB){
func(db *mocks.RepositoryDB) {
db.On("GetRepository", mock.Anything, mock.Anything).Return(&v1alpha1.Repository{}, nil)
},
getRepository: func(ctx context.Context, url, project string) (*v1alpha1.Repository, error) {
return &v1alpha1.Repository{}, nil
},
repoServerClientFuncs: []func(*repo_mocks.RepoServerServiceClient){
func(client *repo_mocks.RepoServerServiceClient) {
@@ -158,26 +153,32 @@ func TestGetFiles(t *testing.T) {
"foo.json": []byte("hello: world!"),
"bar.yaml": []byte("yay: appsets"),
}, wantErr: assert.NoError},
{name: "ErrorVerifyingCommit", fields: fields{
getRepository: func(ctx context.Context, url, project string) (*v1alpha1.Repository, error) {
return &v1alpha1.Repository{}, nil
},
repoServerClientFuncs: []func(*repo_mocks.RepoServerServiceClient){
func(client *repo_mocks.RepoServerServiceClient) {
client.On("GetGitFiles", mock.Anything, mock.Anything).Return(nil, fmt.Errorf("revision HEAD is not signed"))
},
},
}, args: args{}, want: nil, wantErr: assert.Error},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
mockDb := &mocks.RepositoryDB{}
mockRepoClient := &repo_mocks.RepoServerServiceClient{}
// decorate the mocks
for i := range tt.fields.repositoriesDBFuncs {
tt.fields.repositoriesDBFuncs[i](mockDb)
}
for i := range tt.fields.repoServerClientFuncs {
tt.fields.repoServerClientFuncs[i](mockRepoClient)
}
a := &argoCDService{
repositoriesDB: mockDb,
getRepository: tt.fields.getRepository,
storecreds: tt.fields.storecreds,
submoduleEnabled: tt.fields.submoduleEnabled,
repoServerClientSet: &repo_mocks.Clientset{RepoServerServiceClient: mockRepoClient},
}
got, err := a.GetFiles(tt.args.ctx, tt.args.repoURL, tt.args.revision, tt.args.pattern, tt.args.noRevisionCache)
got, err := a.GetFiles(tt.args.ctx, tt.args.repoURL, tt.args.revision, tt.args.pattern, tt.args.noRevisionCache, tt.args.verifyCommit)
if !tt.wantErr(t, err, fmt.Sprintf("GetFiles(%v, %v, %v, %v, %v)", tt.args.ctx, tt.args.repoURL, tt.args.revision, tt.args.pattern, tt.args.noRevisionCache)) {
return
}
@@ -187,7 +188,9 @@ func TestGetFiles(t *testing.T) {
}
func TestNewArgoCDService(t *testing.T) {
service, err := NewArgoCDService(&db_mocks.ArgoDB{}, false, &repo_mocks.Clientset{}, false)
assert.NoError(t, err, err)
service, err := NewArgoCDService(func(ctx context.Context, url, project string) (*v1alpha1.Repository, error) {
return &v1alpha1.Repository{}, nil
}, false, &repo_mocks.Clientset{}, false)
require.NoError(t, err)
assert.NotNil(t, service)
}

View File

@@ -2,13 +2,14 @@ package scm_provider
import (
"context"
"errors"
"fmt"
"github.com/aws/aws-sdk-go/aws/request"
pathpkg "path"
"path/filepath"
"strings"
application "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/arn"
"github.com/aws/aws-sdk-go/aws/awserr"
@@ -19,6 +20,8 @@ import (
log "github.com/sirupsen/logrus"
"golang.org/x/exp/maps"
"k8s.io/utils/strings/slices"
application "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
)
const (
@@ -325,7 +328,8 @@ func getCodeCommitFIPSEndpoint(repoUrl string) (string, error) {
}
func hasAwsError(err error, codes ...string) bool {
if awsErr, ok := err.(awserr.Error); ok {
var awsErr awserr.Error
if errors.As(err, &awsErr) {
return slices.Contains(codes, awsErr.Code())
}
return false
@@ -354,7 +358,7 @@ func createAWSDiscoveryClients(_ context.Context, role string, region string) (*
Credentials: assumeRoleCreds,
})
if err != nil {
return nil, nil, fmt.Errorf("error creating new AWS discovery session: %s", err)
return nil, nil, fmt.Errorf("error creating new AWS discovery session: %w", err)
}
} else {
log.Debugf("role is not provided for AWS CodeCommit discovery, using pod role")

View File

@@ -1,4 +1,4 @@
// Code generated by mockery v2.26.1. DO NOT EDIT.
// Code generated by mockery v2.43.2. DO NOT EDIT.
package mocks
@@ -17,14 +17,6 @@ type AWSCodeCommitClient struct {
mock.Mock
}
type AWSCodeCommitClient_Expecter struct {
mock *mock.Mock
}
func (_m *AWSCodeCommitClient) EXPECT() *AWSCodeCommitClient_Expecter {
return &AWSCodeCommitClient_Expecter{mock: &_m.Mock}
}
// GetFolderWithContext provides a mock function with given fields: _a0, _a1, _a2
func (_m *AWSCodeCommitClient) GetFolderWithContext(_a0 context.Context, _a1 *codecommit.GetFolderInput, _a2 ...request.Option) (*codecommit.GetFolderOutput, error) {
_va := make([]interface{}, len(_a2))
@@ -36,6 +28,10 @@ func (_m *AWSCodeCommitClient) GetFolderWithContext(_a0 context.Context, _a1 *co
_ca = append(_ca, _va...)
ret := _m.Called(_ca...)
if len(ret) == 0 {
panic("no return value specified for GetFolderWithContext")
}
var r0 *codecommit.GetFolderOutput
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *codecommit.GetFolderInput, ...request.Option) (*codecommit.GetFolderOutput, error)); ok {
@@ -58,43 +54,6 @@ func (_m *AWSCodeCommitClient) GetFolderWithContext(_a0 context.Context, _a1 *co
return r0, r1
}
// AWSCodeCommitClient_GetFolderWithContext_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetFolderWithContext'
type AWSCodeCommitClient_GetFolderWithContext_Call struct {
*mock.Call
}
// GetFolderWithContext is a helper method to define mock.On call
// - _a0 context.Context
// - _a1 *codecommit.GetFolderInput
// - _a2 ...request.Option
func (_e *AWSCodeCommitClient_Expecter) GetFolderWithContext(_a0 interface{}, _a1 interface{}, _a2 ...interface{}) *AWSCodeCommitClient_GetFolderWithContext_Call {
return &AWSCodeCommitClient_GetFolderWithContext_Call{Call: _e.mock.On("GetFolderWithContext",
append([]interface{}{_a0, _a1}, _a2...)...)}
}
func (_c *AWSCodeCommitClient_GetFolderWithContext_Call) Run(run func(_a0 context.Context, _a1 *codecommit.GetFolderInput, _a2 ...request.Option)) *AWSCodeCommitClient_GetFolderWithContext_Call {
_c.Call.Run(func(args mock.Arguments) {
variadicArgs := make([]request.Option, len(args)-2)
for i, a := range args[2:] {
if a != nil {
variadicArgs[i] = a.(request.Option)
}
}
run(args[0].(context.Context), args[1].(*codecommit.GetFolderInput), variadicArgs...)
})
return _c
}
func (_c *AWSCodeCommitClient_GetFolderWithContext_Call) Return(_a0 *codecommit.GetFolderOutput, _a1 error) *AWSCodeCommitClient_GetFolderWithContext_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *AWSCodeCommitClient_GetFolderWithContext_Call) RunAndReturn(run func(context.Context, *codecommit.GetFolderInput, ...request.Option) (*codecommit.GetFolderOutput, error)) *AWSCodeCommitClient_GetFolderWithContext_Call {
_c.Call.Return(run)
return _c
}
// GetRepositoryWithContext provides a mock function with given fields: _a0, _a1, _a2
func (_m *AWSCodeCommitClient) GetRepositoryWithContext(_a0 context.Context, _a1 *codecommit.GetRepositoryInput, _a2 ...request.Option) (*codecommit.GetRepositoryOutput, error) {
_va := make([]interface{}, len(_a2))
@@ -106,6 +65,10 @@ func (_m *AWSCodeCommitClient) GetRepositoryWithContext(_a0 context.Context, _a1
_ca = append(_ca, _va...)
ret := _m.Called(_ca...)
if len(ret) == 0 {
panic("no return value specified for GetRepositoryWithContext")
}
var r0 *codecommit.GetRepositoryOutput
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *codecommit.GetRepositoryInput, ...request.Option) (*codecommit.GetRepositoryOutput, error)); ok {
@@ -128,43 +91,6 @@ func (_m *AWSCodeCommitClient) GetRepositoryWithContext(_a0 context.Context, _a1
return r0, r1
}
// AWSCodeCommitClient_GetRepositoryWithContext_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRepositoryWithContext'
type AWSCodeCommitClient_GetRepositoryWithContext_Call struct {
*mock.Call
}
// GetRepositoryWithContext is a helper method to define mock.On call
// - _a0 context.Context
// - _a1 *codecommit.GetRepositoryInput
// - _a2 ...request.Option
func (_e *AWSCodeCommitClient_Expecter) GetRepositoryWithContext(_a0 interface{}, _a1 interface{}, _a2 ...interface{}) *AWSCodeCommitClient_GetRepositoryWithContext_Call {
return &AWSCodeCommitClient_GetRepositoryWithContext_Call{Call: _e.mock.On("GetRepositoryWithContext",
append([]interface{}{_a0, _a1}, _a2...)...)}
}
func (_c *AWSCodeCommitClient_GetRepositoryWithContext_Call) Run(run func(_a0 context.Context, _a1 *codecommit.GetRepositoryInput, _a2 ...request.Option)) *AWSCodeCommitClient_GetRepositoryWithContext_Call {
_c.Call.Run(func(args mock.Arguments) {
variadicArgs := make([]request.Option, len(args)-2)
for i, a := range args[2:] {
if a != nil {
variadicArgs[i] = a.(request.Option)
}
}
run(args[0].(context.Context), args[1].(*codecommit.GetRepositoryInput), variadicArgs...)
})
return _c
}
func (_c *AWSCodeCommitClient_GetRepositoryWithContext_Call) Return(_a0 *codecommit.GetRepositoryOutput, _a1 error) *AWSCodeCommitClient_GetRepositoryWithContext_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *AWSCodeCommitClient_GetRepositoryWithContext_Call) RunAndReturn(run func(context.Context, *codecommit.GetRepositoryInput, ...request.Option) (*codecommit.GetRepositoryOutput, error)) *AWSCodeCommitClient_GetRepositoryWithContext_Call {
_c.Call.Return(run)
return _c
}
// ListBranchesWithContext provides a mock function with given fields: _a0, _a1, _a2
func (_m *AWSCodeCommitClient) ListBranchesWithContext(_a0 context.Context, _a1 *codecommit.ListBranchesInput, _a2 ...request.Option) (*codecommit.ListBranchesOutput, error) {
_va := make([]interface{}, len(_a2))
@@ -176,6 +102,10 @@ func (_m *AWSCodeCommitClient) ListBranchesWithContext(_a0 context.Context, _a1
_ca = append(_ca, _va...)
ret := _m.Called(_ca...)
if len(ret) == 0 {
panic("no return value specified for ListBranchesWithContext")
}
var r0 *codecommit.ListBranchesOutput
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *codecommit.ListBranchesInput, ...request.Option) (*codecommit.ListBranchesOutput, error)); ok {
@@ -198,43 +128,6 @@ func (_m *AWSCodeCommitClient) ListBranchesWithContext(_a0 context.Context, _a1
return r0, r1
}
// AWSCodeCommitClient_ListBranchesWithContext_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListBranchesWithContext'
type AWSCodeCommitClient_ListBranchesWithContext_Call struct {
*mock.Call
}
// ListBranchesWithContext is a helper method to define mock.On call
// - _a0 context.Context
// - _a1 *codecommit.ListBranchesInput
// - _a2 ...request.Option
func (_e *AWSCodeCommitClient_Expecter) ListBranchesWithContext(_a0 interface{}, _a1 interface{}, _a2 ...interface{}) *AWSCodeCommitClient_ListBranchesWithContext_Call {
return &AWSCodeCommitClient_ListBranchesWithContext_Call{Call: _e.mock.On("ListBranchesWithContext",
append([]interface{}{_a0, _a1}, _a2...)...)}
}
func (_c *AWSCodeCommitClient_ListBranchesWithContext_Call) Run(run func(_a0 context.Context, _a1 *codecommit.ListBranchesInput, _a2 ...request.Option)) *AWSCodeCommitClient_ListBranchesWithContext_Call {
_c.Call.Run(func(args mock.Arguments) {
variadicArgs := make([]request.Option, len(args)-2)
for i, a := range args[2:] {
if a != nil {
variadicArgs[i] = a.(request.Option)
}
}
run(args[0].(context.Context), args[1].(*codecommit.ListBranchesInput), variadicArgs...)
})
return _c
}
func (_c *AWSCodeCommitClient_ListBranchesWithContext_Call) Return(_a0 *codecommit.ListBranchesOutput, _a1 error) *AWSCodeCommitClient_ListBranchesWithContext_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *AWSCodeCommitClient_ListBranchesWithContext_Call) RunAndReturn(run func(context.Context, *codecommit.ListBranchesInput, ...request.Option) (*codecommit.ListBranchesOutput, error)) *AWSCodeCommitClient_ListBranchesWithContext_Call {
_c.Call.Return(run)
return _c
}
// ListRepositoriesWithContext provides a mock function with given fields: _a0, _a1, _a2
func (_m *AWSCodeCommitClient) ListRepositoriesWithContext(_a0 context.Context, _a1 *codecommit.ListRepositoriesInput, _a2 ...request.Option) (*codecommit.ListRepositoriesOutput, error) {
_va := make([]interface{}, len(_a2))
@@ -246,6 +139,10 @@ func (_m *AWSCodeCommitClient) ListRepositoriesWithContext(_a0 context.Context,
_ca = append(_ca, _va...)
ret := _m.Called(_ca...)
if len(ret) == 0 {
panic("no return value specified for ListRepositoriesWithContext")
}
var r0 *codecommit.ListRepositoriesOutput
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *codecommit.ListRepositoriesInput, ...request.Option) (*codecommit.ListRepositoriesOutput, error)); ok {
@@ -268,50 +165,12 @@ func (_m *AWSCodeCommitClient) ListRepositoriesWithContext(_a0 context.Context,
return r0, r1
}
// AWSCodeCommitClient_ListRepositoriesWithContext_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListRepositoriesWithContext'
type AWSCodeCommitClient_ListRepositoriesWithContext_Call struct {
*mock.Call
}
// ListRepositoriesWithContext is a helper method to define mock.On call
// - _a0 context.Context
// - _a1 *codecommit.ListRepositoriesInput
// - _a2 ...request.Option
func (_e *AWSCodeCommitClient_Expecter) ListRepositoriesWithContext(_a0 interface{}, _a1 interface{}, _a2 ...interface{}) *AWSCodeCommitClient_ListRepositoriesWithContext_Call {
return &AWSCodeCommitClient_ListRepositoriesWithContext_Call{Call: _e.mock.On("ListRepositoriesWithContext",
append([]interface{}{_a0, _a1}, _a2...)...)}
}
func (_c *AWSCodeCommitClient_ListRepositoriesWithContext_Call) Run(run func(_a0 context.Context, _a1 *codecommit.ListRepositoriesInput, _a2 ...request.Option)) *AWSCodeCommitClient_ListRepositoriesWithContext_Call {
_c.Call.Run(func(args mock.Arguments) {
variadicArgs := make([]request.Option, len(args)-2)
for i, a := range args[2:] {
if a != nil {
variadicArgs[i] = a.(request.Option)
}
}
run(args[0].(context.Context), args[1].(*codecommit.ListRepositoriesInput), variadicArgs...)
})
return _c
}
func (_c *AWSCodeCommitClient_ListRepositoriesWithContext_Call) Return(_a0 *codecommit.ListRepositoriesOutput, _a1 error) *AWSCodeCommitClient_ListRepositoriesWithContext_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *AWSCodeCommitClient_ListRepositoriesWithContext_Call) RunAndReturn(run func(context.Context, *codecommit.ListRepositoriesInput, ...request.Option) (*codecommit.ListRepositoriesOutput, error)) *AWSCodeCommitClient_ListRepositoriesWithContext_Call {
_c.Call.Return(run)
return _c
}
type mockConstructorTestingTNewAWSCodeCommitClient interface {
// NewAWSCodeCommitClient creates a new instance of AWSCodeCommitClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewAWSCodeCommitClient(t interface {
mock.TestingT
Cleanup(func())
}
// NewAWSCodeCommitClient creates a new instance of AWSCodeCommitClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewAWSCodeCommitClient(t mockConstructorTestingTNewAWSCodeCommitClient) *AWSCodeCommitClient {
}) *AWSCodeCommitClient {
mock := &AWSCodeCommitClient{}
mock.Mock.Test(t)

View File

@@ -1,4 +1,4 @@
// Code generated by mockery v2.26.1. DO NOT EDIT.
// Code generated by mockery v2.43.2. DO NOT EDIT.
package mocks
@@ -16,14 +16,6 @@ type AWSTaggingClient struct {
mock.Mock
}
type AWSTaggingClient_Expecter struct {
mock *mock.Mock
}
func (_m *AWSTaggingClient) EXPECT() *AWSTaggingClient_Expecter {
return &AWSTaggingClient_Expecter{mock: &_m.Mock}
}
// GetResourcesWithContext provides a mock function with given fields: _a0, _a1, _a2
func (_m *AWSTaggingClient) GetResourcesWithContext(_a0 context.Context, _a1 *resourcegroupstaggingapi.GetResourcesInput, _a2 ...request.Option) (*resourcegroupstaggingapi.GetResourcesOutput, error) {
_va := make([]interface{}, len(_a2))
@@ -35,6 +27,10 @@ func (_m *AWSTaggingClient) GetResourcesWithContext(_a0 context.Context, _a1 *re
_ca = append(_ca, _va...)
ret := _m.Called(_ca...)
if len(ret) == 0 {
panic("no return value specified for GetResourcesWithContext")
}
var r0 *resourcegroupstaggingapi.GetResourcesOutput
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *resourcegroupstaggingapi.GetResourcesInput, ...request.Option) (*resourcegroupstaggingapi.GetResourcesOutput, error)); ok {
@@ -57,50 +53,12 @@ func (_m *AWSTaggingClient) GetResourcesWithContext(_a0 context.Context, _a1 *re
return r0, r1
}
// AWSTaggingClient_GetResourcesWithContext_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetResourcesWithContext'
type AWSTaggingClient_GetResourcesWithContext_Call struct {
*mock.Call
}
// GetResourcesWithContext is a helper method to define mock.On call
// - _a0 context.Context
// - _a1 *resourcegroupstaggingapi.GetResourcesInput
// - _a2 ...request.Option
func (_e *AWSTaggingClient_Expecter) GetResourcesWithContext(_a0 interface{}, _a1 interface{}, _a2 ...interface{}) *AWSTaggingClient_GetResourcesWithContext_Call {
return &AWSTaggingClient_GetResourcesWithContext_Call{Call: _e.mock.On("GetResourcesWithContext",
append([]interface{}{_a0, _a1}, _a2...)...)}
}
func (_c *AWSTaggingClient_GetResourcesWithContext_Call) Run(run func(_a0 context.Context, _a1 *resourcegroupstaggingapi.GetResourcesInput, _a2 ...request.Option)) *AWSTaggingClient_GetResourcesWithContext_Call {
_c.Call.Run(func(args mock.Arguments) {
variadicArgs := make([]request.Option, len(args)-2)
for i, a := range args[2:] {
if a != nil {
variadicArgs[i] = a.(request.Option)
}
}
run(args[0].(context.Context), args[1].(*resourcegroupstaggingapi.GetResourcesInput), variadicArgs...)
})
return _c
}
func (_c *AWSTaggingClient_GetResourcesWithContext_Call) Return(_a0 *resourcegroupstaggingapi.GetResourcesOutput, _a1 error) *AWSTaggingClient_GetResourcesWithContext_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *AWSTaggingClient_GetResourcesWithContext_Call) RunAndReturn(run func(context.Context, *resourcegroupstaggingapi.GetResourcesInput, ...request.Option) (*resourcegroupstaggingapi.GetResourcesOutput, error)) *AWSTaggingClient_GetResourcesWithContext_Call {
_c.Call.Return(run)
return _c
}
type mockConstructorTestingTNewAWSTaggingClient interface {
// NewAWSTaggingClient creates a new instance of AWSTaggingClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewAWSTaggingClient(t interface {
mock.TestingT
Cleanup(func())
}
// NewAWSTaggingClient creates a new instance of AWSTaggingClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewAWSTaggingClient(t mockConstructorTestingTNewAWSTaggingClient) *AWSTaggingClient {
}) *AWSTaggingClient {
mock := &AWSTaggingClient{}
mock.Mock.Test(t)

View File

@@ -6,14 +6,15 @@ import (
"sort"
"testing"
"github.com/argoproj/argo-cd/v2/applicationset/services/scm_provider/aws_codecommit/mocks"
"github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/codecommit"
"github.com/aws/aws-sdk-go/service/resourcegroupstaggingapi"
"github.com/google/go-cmp/cmp"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"github.com/argoproj/argo-cd/v2/applicationset/services/scm_provider/aws_codecommit/mocks"
"github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
)
type awsCodeCommitTestRepository struct {
@@ -177,8 +178,8 @@ func TestAWSCodeCommitListRepos(t *testing.T) {
if repo.getRepositoryNilMetadata {
repoMetadata = nil
}
codeCommitClient.EXPECT().
GetRepositoryWithContext(ctx, &codecommit.GetRepositoryInput{RepositoryName: aws.String(repo.name)}).
codeCommitClient.
On("GetRepositoryWithContext", ctx, &codecommit.GetRepositoryInput{RepositoryName: aws.String(repo.name)}).
Return(&codecommit.GetRepositoryOutput{RepositoryMetadata: repoMetadata}, repo.getRepositoryError)
codecommitRepoNameIdPairs = append(codecommitRepoNameIdPairs, &codecommit.RepositoryNameIdPair{
RepositoryId: aws.String(repo.id),
@@ -193,14 +194,14 @@ func TestAWSCodeCommitListRepos(t *testing.T) {
}
if testCase.expectListAtCodeCommit {
codeCommitClient.EXPECT().
ListRepositoriesWithContext(ctx, &codecommit.ListRepositoriesInput{}).
codeCommitClient.
On("ListRepositoriesWithContext", ctx, &codecommit.ListRepositoriesInput{}).
Return(&codecommit.ListRepositoriesOutput{
Repositories: codecommitRepoNameIdPairs,
}, testCase.listRepositoryError)
} else {
taggingClient.EXPECT().
GetResourcesWithContext(ctx, mock.MatchedBy(equalIgnoringTagFilterOrder(&resourcegroupstaggingapi.GetResourcesInput{
taggingClient.
On("GetResourcesWithContext", ctx, mock.MatchedBy(equalIgnoringTagFilterOrder(&resourcegroupstaggingapi.GetResourcesInput{
TagFilters: testCase.expectTagFilters,
ResourceTypeFilters: aws.StringSlice([]string{resourceTypeCodeCommitRepository}),
}))).
@@ -350,8 +351,8 @@ func TestAWSCodeCommitRepoHasPath(t *testing.T) {
taggingClient := mocks.NewAWSTaggingClient(t)
ctx := context.Background()
if testCase.expectedGetFolderPath != "" {
codeCommitClient.EXPECT().
GetFolderWithContext(ctx, &codecommit.GetFolderInput{
codeCommitClient.
On("GetFolderWithContext", ctx, &codecommit.GetFolderInput{
CommitSpecifier: aws.String(branch),
FolderPath: aws.String(testCase.expectedGetFolderPath),
RepositoryName: aws.String(repoName),
@@ -423,14 +424,14 @@ func TestAWSCodeCommitGetBranches(t *testing.T) {
taggingClient := mocks.NewAWSTaggingClient(t)
ctx := context.Background()
if testCase.allBranches {
codeCommitClient.EXPECT().
ListBranchesWithContext(ctx, &codecommit.ListBranchesInput{
codeCommitClient.
On("ListBranchesWithContext", ctx, &codecommit.ListBranchesInput{
RepositoryName: aws.String(name),
}).
Return(&codecommit.ListBranchesOutput{Branches: aws.StringSlice(testCase.branches)}, testCase.apiError)
} else {
codeCommitClient.EXPECT().
GetRepositoryWithContext(ctx, &codecommit.GetRepositoryInput{RepositoryName: aws.String(name)}).
codeCommitClient.
On("GetRepositoryWithContext", ctx, &codecommit.GetRepositoryInput{RepositoryName: aws.String(name)}).
Return(&codecommit.GetRepositoryOutput{RepositoryMetadata: &codecommit.RepositoryMetadata{
AccountId: aws.String(organization),
DefaultBranch: aws.String(defaultBranch),

View File

@@ -2,6 +2,7 @@ package scm_provider
import (
"context"
"errors"
"fmt"
netUrl "net/url"
"strings"
@@ -51,8 +52,10 @@ type AzureDevOpsProvider struct {
allBranches bool
}
var _ SCMProviderService = &AzureDevOpsProvider{}
var _ AzureDevOpsClientFactory = &devopsFactoryImpl{}
var (
_ SCMProviderService = &AzureDevOpsProvider{}
_ AzureDevOpsClientFactory = &devopsFactoryImpl{}
)
func NewAzureDevOpsProvider(ctx context.Context, accessToken string, org string, url string, project string, allBranches bool) (*AzureDevOpsProvider, error) {
if accessToken == "" {
@@ -60,7 +63,6 @@ func NewAzureDevOpsProvider(ctx context.Context, accessToken string, org string,
}
devOpsURL, err := getValidDevOpsURL(url, org)
if err != nil {
return nil, err
}
@@ -77,7 +79,6 @@ func (g *AzureDevOpsProvider) ListRepos(ctx context.Context, cloneProtocol strin
}
getRepoArgs := azureGit.GetRepositoriesArgs{Project: &g.teamProject}
azureRepos, err := gitClient.GetRepositories(ctx, getRepoArgs)
if err != nil {
return nil, err
}
@@ -106,7 +107,7 @@ func (g *AzureDevOpsProvider) RepoHasPath(ctx context.Context, repo *Repository,
}
var repoId string
if uuid, isUuid := repo.RepositoryId.(uuid.UUID); isUuid { //most likely an UUID, but do type-safe check anyway. Do %v fallback if not expected type.
if uuid, isUuid := repo.RepositoryId.(uuid.UUID); isUuid { // most likely an UUID, but do type-safe check anyway. Do %v fallback if not expected type.
repoId = uuid.String()
} else {
repoId = fmt.Sprintf("%v", repo.RepositoryId)
@@ -115,9 +116,9 @@ func (g *AzureDevOpsProvider) RepoHasPath(ctx context.Context, repo *Repository,
branchName := repo.Branch
getItemArgs := azureGit.GetItemArgs{RepositoryId: &repoId, Project: &g.teamProject, Path: &path, VersionDescriptor: &azureGit.GitVersionDescriptor{Version: &branchName}}
_, err = gitClient.GetItem(ctx, getItemArgs)
if err != nil {
if wrappedError, isWrappedError := err.(azuredevops.WrappedError); isWrappedError && wrappedError.TypeKey != nil {
var wrappedError azuredevops.WrappedError
if errors.As(err, &wrappedError) && wrappedError.TypeKey != nil {
if *wrappedError.TypeKey == AzureDevOpsErrorsTypeKeyValues.GitItemNotFound {
return false, nil
}
@@ -138,11 +139,12 @@ func (g *AzureDevOpsProvider) GetBranches(ctx context.Context, repo *Repository)
repos := []*Repository{}
if !g.allBranches {
defaultBranchName := strings.Replace(repo.Branch, "refs/heads/", "", 1) //Azure DevOps returns default branch info like 'refs/heads/main', but does not support branch lookup of this format.
defaultBranchName := strings.Replace(repo.Branch, "refs/heads/", "", 1) // Azure DevOps returns default branch info like 'refs/heads/main', but does not support branch lookup of this format.
getBranchArgs := azureGit.GetBranchArgs{RepositoryId: &repo.Repository, Project: &g.teamProject, Name: &defaultBranchName}
branchResult, err := gitClient.GetBranch(ctx, getBranchArgs)
if err != nil {
if wrappedError, isWrappedError := err.(azuredevops.WrappedError); isWrappedError && wrappedError.TypeKey != nil {
var wrappedError azuredevops.WrappedError
if errors.As(err, &wrappedError) && wrappedError.TypeKey != nil {
if *wrappedError.TypeKey == AzureDevOpsErrorsTypeKeyValues.GitRepositoryNotFound {
return repos, nil
}
@@ -170,7 +172,8 @@ func (g *AzureDevOpsProvider) GetBranches(ctx context.Context, repo *Repository)
getBranchesRequest := azureGit.GetBranchesArgs{RepositoryId: &repo.Repository, Project: &g.teamProject}
branches, err := gitClient.GetBranches(ctx, getBranchesRequest)
if err != nil {
if wrappedError, isWrappedError := err.(azuredevops.WrappedError); isWrappedError && wrappedError.TypeKey != nil {
var wrappedError azuredevops.WrappedError
if errors.As(err, &wrappedError) && wrappedError.TypeKey != nil {
if *wrappedError.TypeKey == AzureDevOpsErrorsTypeKeyValues.GitRepositoryNotFound {
return repos, nil
}
@@ -209,7 +212,6 @@ func getValidDevOpsURL(url string, org string) (string, error) {
devOpsURL := fmt.Sprintf("%s%s%s", url, separator, org)
urlCheck, err := netUrl.ParseRequestURI(devOpsURL)
if err != nil {
return "", fmt.Errorf("got an invalid URL for the Azure SCM generator: %w", err)
}

File diff suppressed because it is too large Load Diff

View File

@@ -8,15 +8,17 @@ import (
"github.com/google/uuid"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"k8s.io/utils/pointer"
"github.com/stretchr/testify/require"
"k8s.io/utils/ptr"
azureMock "github.com/argoproj/argo-cd/v2/applicationset/services/scm_provider/azure_devops/git/mocks"
"github.com/microsoft/azure-devops-go-api/azuredevops"
azureGit "github.com/microsoft/azure-devops-go-api/azuredevops/git"
azureMock "github.com/argoproj/argo-cd/v2/applicationset/services/scm_provider/azure_devops/git/mocks"
)
func s(input string) *string {
return pointer.String(input)
return ptr.To(input)
}
func TestAzureDevopsRepoHasPath(t *testing.T) {
@@ -89,26 +91,24 @@ func TestAzureDevopsRepoHasPath(t *testing.T) {
hasPath, err := provider.RepoHasPath(ctx, repo, path)
if testCase.clientError != nil {
assert.ErrorContains(t, err, testCase.clientError.Error())
require.ErrorContains(t, err, testCase.clientError.Error())
gitClientMock.AssertNotCalled(t, "GetItem", ctx, azureGit.GetItemArgs{Project: &teamProject, Path: &path, VersionDescriptor: &azureGit.GitVersionDescriptor{Version: &branchName}, RepositoryId: repoId})
return
}
if testCase.returnError {
assert.ErrorContains(t, err, testCase.errorMessage)
require.ErrorContains(t, err, testCase.errorMessage)
}
assert.Equal(t, testCase.pathFound, hasPath)
gitClientMock.AssertCalled(t, "GetItem", ctx, azureGit.GetItemArgs{Project: &teamProject, Path: &path, VersionDescriptor: &azureGit.GitVersionDescriptor{Version: &branchName}, RepositoryId: repoId})
})
}
}
func TestGetDefaultBranchOnDisabledRepo(t *testing.T) {
organization := "myorg"
teamProject := "myorg_project"
repoName := "myorg_project_repo"
@@ -155,9 +155,9 @@ func TestGetDefaultBranchOnDisabledRepo(t *testing.T) {
branches, err := provider.GetBranches(ctx, repo)
if testCase.shouldReturnError {
assert.Error(t, err)
require.Error(t, err)
} else {
assert.NoError(t, err)
require.NoError(t, err)
}
assert.Empty(t, branches)
@@ -168,7 +168,6 @@ func TestGetDefaultBranchOnDisabledRepo(t *testing.T) {
}
func TestGetAllBranchesOnDisabledRepo(t *testing.T) {
organization := "myorg"
teamProject := "myorg_project"
repoName := "myorg_project_repo"
@@ -215,9 +214,9 @@ func TestGetAllBranchesOnDisabledRepo(t *testing.T) {
branches, err := provider.GetBranches(ctx, repo)
if testCase.shouldReturnError {
assert.Error(t, err)
require.Error(t, err)
} else {
assert.NoError(t, err)
require.NoError(t, err)
}
assert.Empty(t, branches)
@@ -228,9 +227,7 @@ func TestGetAllBranchesOnDisabledRepo(t *testing.T) {
}
func TestAzureDevOpsGetDefaultBranchStripsRefsName(t *testing.T) {
t.Run("Get branches only default branch removes characters before querying azure devops", func(t *testing.T) {
organization := "myorg"
teamProject := "myorg_project"
repoName := "myorg_project_repo"
@@ -253,7 +250,7 @@ func TestAzureDevOpsGetDefaultBranchStripsRefsName(t *testing.T) {
provider := AzureDevOpsProvider{organization: organization, teamProject: teamProject, clientFactory: clientFactoryMock, allBranches: false}
branches, err := provider.GetBranches(ctx, repo)
assert.NoError(t, err)
require.NoError(t, err)
assert.Len(t, branches, 1)
assert.Equal(t, strippedBranchName, branches[0].Branch)
@@ -310,7 +307,7 @@ func TestAzureDevOpsGetBranchesDefultBranchOnly(t *testing.T) {
branches, err := provider.GetBranches(ctx, repo)
if testCase.clientError != nil {
assert.ErrorContains(t, err, testCase.clientError.Error())
require.ErrorContains(t, err, testCase.clientError.Error())
gitClientMock.AssertNotCalled(t, "GetBranch", ctx, azureGit.GetBranchArgs{RepositoryId: &repoName, Project: &teamProject, Name: &defaultBranch})
return
@@ -318,7 +315,7 @@ func TestAzureDevOpsGetBranchesDefultBranchOnly(t *testing.T) {
if testCase.getBranchesApiError != nil {
assert.Empty(t, branches)
assert.ErrorContains(t, err, testCase.getBranchesApiError.Error())
require.ErrorContains(t, err, testCase.getBranchesApiError.Error())
} else {
if testCase.expectedBranch != nil {
assert.NotEmpty(t, branches)
@@ -394,21 +391,20 @@ func TestAzureDevopsGetBranches(t *testing.T) {
branches, err := provider.GetBranches(ctx, repo)
if testCase.expectedProcessingErrorMsg != "" {
assert.ErrorContains(t, err, testCase.expectedProcessingErrorMsg)
require.ErrorContains(t, err, testCase.expectedProcessingErrorMsg)
assert.Nil(t, branches)
return
}
if testCase.clientError != nil {
assert.ErrorContains(t, err, testCase.clientError.Error())
require.ErrorContains(t, err, testCase.clientError.Error())
gitClientMock.AssertNotCalled(t, "GetBranches", ctx, azureGit.GetBranchesArgs{RepositoryId: &repoName, Project: &teamProject})
return
}
if testCase.getBranchesApiError != nil {
assert.Empty(t, branches)
assert.ErrorContains(t, err, testCase.getBranchesApiError.Error())
require.ErrorContains(t, err, testCase.getBranchesApiError.Error())
} else {
if len(*testCase.expectedBranches) > 0 {
assert.NotEmpty(t, branches)
@@ -472,14 +468,14 @@ func TestGetAzureDevopsRepositories(t *testing.T) {
{Name: s("missing_default_branch"), RemoteUrl: s("https://remoteurl.u"), Id: repoId},
{DefaultBranch: s("missing_name"), RemoteUrl: s("https://remoteurl.u"), Id: repoId},
{Name: s("missing_remote_url"), DefaultBranch: s("main"), Id: repoId},
{Name: s("missing_id"), DefaultBranch: s("main"), RemoteUrl: s("https://remoteurl.u")}},
{Name: s("missing_id"), DefaultBranch: s("main"), RemoteUrl: s("https://remoteurl.u")},
},
expectedNumberOfRepos: 1,
},
}
for _, testCase := range testCases {
t.Run(testCase.name, func(t *testing.T) {
gitClientMock := azureMock.Client{}
gitClientMock.On("GetRepositories", ctx, azureGit.GetRepositoriesArgs{Project: s(teamProject)}).Return(&testCase.repositories, testCase.getRepositoriesError)
@@ -491,7 +487,7 @@ func TestGetAzureDevopsRepositories(t *testing.T) {
repositories, err := provider.ListRepos(ctx, "https")
if testCase.getRepositoriesError != nil {
assert.Error(t, err, "Expected an error from test case %v", testCase.name)
require.Error(t, err, "Expected an error from test case %v", testCase.name)
}
if testCase.expectedNumberOfRepos == 0 {

View File

@@ -52,7 +52,6 @@ func (c *ExtendedClient) GetContents(repo *Repository, path string) (bool, error
var _ SCMProviderService = &BitBucketCloudProvider{}
func NewBitBucketCloudProvider(ctx context.Context, owner string, user string, password string, allBranches bool) (*BitBucketCloudProvider, error) {
client := &ExtendedClient{
bitbucket.NewBasicAuth(user, password),
user,
@@ -66,13 +65,13 @@ func (g *BitBucketCloudProvider) GetBranches(ctx context.Context, repo *Reposito
repos := []*Repository{}
branches, err := g.listBranches(repo)
if err != nil {
return nil, fmt.Errorf("error listing branches for %s/%s: %v", repo.Organization, repo.Repository, err)
return nil, fmt.Errorf("error listing branches for %s/%s: %w", repo.Organization, repo.Repository, err)
}
for _, branch := range branches {
hash, ok := branch.Target["hash"].(string)
if !ok {
return nil, fmt.Errorf("error getting SHA for branch for %s/%s/%s: %v", g.owner, repo.Repository, branch.Name, err)
return nil, fmt.Errorf("error getting SHA for branch for %s/%s/%s: %w", g.owner, repo.Repository, branch.Name, err)
}
repos = append(repos, &Repository{
Organization: repo.Organization,
@@ -98,12 +97,12 @@ func (g *BitBucketCloudProvider) ListRepos(ctx context.Context, cloneProtocol st
repos := []*Repository{}
accountReposResp, err := g.client.Repositories.ListForAccount(opt)
if err != nil {
return nil, fmt.Errorf("error listing repositories for %s: %v", g.owner, err)
return nil, fmt.Errorf("error listing repositories for %s: %w", g.owner, err)
}
for _, bitBucketRepo := range accountReposResp.Items {
cloneUrl, err := findCloneURL(cloneProtocol, &bitBucketRepo)
if err != nil {
return nil, fmt.Errorf("error fetching clone url for repo %s: %v", bitBucketRepo.Slug, err)
return nil, fmt.Errorf("error fetching clone url for repo %s: %w", bitBucketRepo.Slug, err)
}
repos = append(repos, &Repository{
Organization: g.owner,
@@ -151,11 +150,9 @@ func (g *BitBucketCloudProvider) listBranches(repo *Repository) ([]bitbucket.Rep
return nil, err
}
return branches.Branches, nil
}
func findCloneURL(cloneProtocol string, repo *bitbucket.Repository) (*string, error) {
cloneLinks, ok := repo.Links["clone"].([]interface{})
if !ok {
return nil, fmt.Errorf("unknown type returned from repo links")

View File

@@ -8,6 +8,7 @@ import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
)
@@ -18,7 +19,7 @@ func TestBitbucketHasRepo(t *testing.T) {
res.WriteHeader(http.StatusNotFound)
_, err := res.Write([]byte(""))
if err != nil {
assert.NoError(t, fmt.Errorf("Error in mock response %v", err))
require.NoError(t, fmt.Errorf("Error in mock response %w", err))
}
}
if req.URL.Path == "/repositories/test-owner/testmike/src/dc1edb6c7d650d8ba67719ddf7b662ad8f8fb798/.gitignore" {
@@ -55,7 +56,7 @@ func TestBitbucketHasRepo(t *testing.T) {
"size": 624
}`))
if err != nil {
assert.NoError(t, fmt.Errorf("Error in mock response %v", err))
require.NoError(t, fmt.Errorf("Error in mock response %w", err))
}
}
}))
@@ -95,7 +96,7 @@ func TestBitbucketHasRepo(t *testing.T) {
}
hasPath, err := provider.RepoHasPath(context.Background(), repo, c.path)
if err != nil {
assert.Error(t, fmt.Errorf("Error in test %v", err))
require.Error(t, fmt.Errorf("Error in test %w", err))
}
if c.status != http.StatusOK {
assert.False(t, hasPath)
@@ -208,7 +209,7 @@ func TestBitbucketListRepos(t *testing.T) {
"size": 1
}`))
if err != nil {
assert.NoError(t, fmt.Errorf("Error in mock response %v", err))
require.NoError(t, fmt.Errorf("Error in mock response %w", err))
}
}
if req.URL.Path == "/repositories/test-owner/testmike/refs/branches/main" {
@@ -303,7 +304,7 @@ func TestBitbucketListRepos(t *testing.T) {
}
}`))
if err != nil {
assert.NoError(t, fmt.Errorf("Error in mock response %v", err))
require.NoError(t, fmt.Errorf("Error in mock response %w", err))
}
}
if req.URL.Path == "/repositories/test-owner" {
@@ -442,7 +443,7 @@ func TestBitbucketListRepos(t *testing.T) {
"size": 1
}`))
if err != nil {
assert.NoError(t, fmt.Errorf("Error in mock response %v", err))
require.NoError(t, fmt.Errorf("Error in mock response %w", err))
}
}
}))
@@ -489,9 +490,9 @@ func TestBitbucketListRepos(t *testing.T) {
provider, _ := NewBitBucketCloudProvider(context.Background(), c.owner, "user", "password", c.allBranches)
rawRepos, err := ListRepos(context.Background(), provider, c.filters, c.proto)
if c.hasError {
assert.Error(t, err)
require.Error(t, err)
} else {
assert.NoError(t, err)
require.NoError(t, err)
repos := []*Repository{}
branches := []string{}
for _, r := range rawRepos {

View File

@@ -2,12 +2,15 @@ package scm_provider
import (
"context"
"errors"
"fmt"
"io"
"net/http"
"github.com/argoproj/argo-cd/v2/applicationset/utils"
bitbucketv1 "github.com/gfleury/go-bitbucket-v1"
log "github.com/sirupsen/logrus"
"github.com/argoproj/argo-cd/v2/applicationset/utils"
)
type BitbucketServerProvider struct {
@@ -18,7 +21,7 @@ type BitbucketServerProvider struct {
var _ SCMProviderService = &BitbucketServerProvider{}
func NewBitbucketServerProviderBasicAuth(ctx context.Context, username, password, url, projectKey string, allBranches bool) (*BitbucketServerProvider, error) {
func NewBitbucketServerProviderBasicAuth(ctx context.Context, username, password, url, projectKey string, allBranches bool, scmRootCAPath string, insecure bool, caCerts []byte) (*BitbucketServerProvider, error) {
bitbucketConfig := bitbucketv1.NewConfiguration(url)
// Avoid the XSRF check
bitbucketConfig.AddDefaultHeader("x-atlassian-token", "no-check")
@@ -28,15 +31,29 @@ func NewBitbucketServerProviderBasicAuth(ctx context.Context, username, password
UserName: username,
Password: password,
})
return newBitbucketServerProvider(ctx, bitbucketConfig, projectKey, allBranches)
return newBitbucketServerProvider(ctx, bitbucketConfig, projectKey, allBranches, scmRootCAPath, insecure, caCerts)
}
func NewBitbucketServerProviderNoAuth(ctx context.Context, url, projectKey string, allBranches bool) (*BitbucketServerProvider, error) {
return newBitbucketServerProvider(ctx, bitbucketv1.NewConfiguration(url), projectKey, allBranches)
func NewBitbucketServerProviderBearerToken(ctx context.Context, bearerToken, url, projectKey string, allBranches bool, scmRootCAPath string, insecure bool, caCerts []byte) (*BitbucketServerProvider, error) {
bitbucketConfig := bitbucketv1.NewConfiguration(url)
// Avoid the XSRF check
bitbucketConfig.AddDefaultHeader("x-atlassian-token", "no-check")
bitbucketConfig.AddDefaultHeader("x-requested-with", "XMLHttpRequest")
ctx = context.WithValue(ctx, bitbucketv1.ContextAccessToken, bearerToken)
return newBitbucketServerProvider(ctx, bitbucketConfig, projectKey, allBranches, scmRootCAPath, insecure, caCerts)
}
func newBitbucketServerProvider(ctx context.Context, bitbucketConfig *bitbucketv1.Configuration, projectKey string, allBranches bool) (*BitbucketServerProvider, error) {
func NewBitbucketServerProviderNoAuth(ctx context.Context, url, projectKey string, allBranches bool, scmRootCAPath string, insecure bool, caCerts []byte) (*BitbucketServerProvider, error) {
return newBitbucketServerProvider(ctx, bitbucketv1.NewConfiguration(url), projectKey, allBranches, scmRootCAPath, insecure, caCerts)
}
func newBitbucketServerProvider(ctx context.Context, bitbucketConfig *bitbucketv1.Configuration, projectKey string, allBranches bool, scmRootCAPath string, insecure bool, caCerts []byte) (*BitbucketServerProvider, error) {
bitbucketConfig.BasePath = utils.NormalizeBitbucketBasePath(bitbucketConfig.BasePath)
tlsConfig := utils.GetTlsConfig(scmRootCAPath, insecure, caCerts)
bitbucketConfig.HTTPClient = &http.Client{Transport: &http.Transport{
TLSClientConfig: tlsConfig,
}}
bitbucketClient := bitbucketv1.NewAPIClient(ctx, bitbucketConfig)
return &BitbucketServerProvider{
@@ -54,12 +71,12 @@ func (b *BitbucketServerProvider) ListRepos(_ context.Context, cloneProtocol str
for {
response, err := b.client.DefaultApi.GetRepositoriesWithOptions(b.projectKey, paged)
if err != nil {
return nil, fmt.Errorf("error listing repositories for %s: %v", b.projectKey, err)
return nil, fmt.Errorf("error listing repositories for %s: %w", b.projectKey, err)
}
repositories, err := bitbucketv1.GetRepositoriesResponse(response)
if err != nil {
log.Errorf("error parsing repositories response '%v'", response.Values)
return nil, fmt.Errorf("error parsing repositories response %s: %v", b.projectKey, err)
return nil, fmt.Errorf("error parsing repositories response %s: %w", b.projectKey, err)
}
for _, bitbucketRepo := range repositories {
var url string
@@ -126,7 +143,7 @@ func (b *BitbucketServerProvider) GetBranches(_ context.Context, repo *Repositor
repos := []*Repository{}
branches, err := b.listBranches(repo)
if err != nil {
return nil, fmt.Errorf("error listing branches for %s/%s: %v", repo.Organization, repo.Repository, err)
return nil, fmt.Errorf("error listing branches for %s/%s: %w", repo.Organization, repo.Repository, err)
}
for _, branch := range branches {
@@ -163,12 +180,12 @@ func (b *BitbucketServerProvider) listBranches(repo *Repository) ([]bitbucketv1.
for {
response, err := b.client.DefaultApi.GetBranches(repo.Organization, repo.Repository, paged)
if err != nil {
return nil, fmt.Errorf("error listing branches for %s/%s: %v", repo.Organization, repo.Repository, err)
return nil, fmt.Errorf("error listing branches for %s/%s: %w", repo.Organization, repo.Repository, err)
}
bitbucketBranches, err := bitbucketv1.GetBranchesResponse(response)
if err != nil {
log.Errorf("error parsing branches response '%v'", response.Values)
return nil, fmt.Errorf("error parsing branches response for %s/%s: %v", repo.Organization, repo.Repository, err)
return nil, fmt.Errorf("error parsing branches response for %s/%s: %w", repo.Organization, repo.Repository, err)
}
branches = append(branches, bitbucketBranches...)
@@ -186,7 +203,7 @@ func (b *BitbucketServerProvider) getDefaultBranch(org string, repo string) (*bi
response, err := b.client.DefaultApi.GetDefaultBranch(org, repo)
// The API will return 404 if a default branch is set but doesn't exist. In case the repo is empty and default branch is unset,
// we will get an EOF and a nil response.
if (response != nil && response.StatusCode == 404) || (response == nil && err == io.EOF) {
if (response != nil && response.StatusCode == 404) || (response == nil && err != nil && errors.Is(err, io.EOF)) {
return nil, nil
}
if err != nil {

View File

@@ -2,12 +2,15 @@ package scm_provider
import (
"context"
"crypto/x509"
"encoding/pem"
"io"
"net/http"
"net/http/httptest"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func defaultHandler(t *testing.T) func(http.ResponseWriter, *http.Request) {
@@ -79,8 +82,8 @@ func defaultHandler(t *testing.T) func(http.ResponseWriter, *http.Request) {
}
func verifyDefaultRepo(t *testing.T, err error, repos []*Repository) {
assert.NoError(t, err)
assert.Equal(t, 1, len(repos))
require.NoError(t, err)
assert.Len(t, repos, 1)
assert.Equal(t, Repository{
Organization: "PROJECT",
Repository: "REPO",
@@ -98,8 +101,8 @@ func TestListReposNoAuth(t *testing.T) {
defaultHandler(t)(w, r)
}))
defer ts.Close()
provider, err := NewBitbucketServerProviderNoAuth(context.Background(), ts.URL, "PROJECT", true)
assert.NoError(t, err)
provider, err := NewBitbucketServerProviderNoAuth(context.Background(), ts.URL, "PROJECT", true, "", false, nil)
require.NoError(t, err)
repos, err := provider.ListRepos(context.Background(), "ssh")
verifyDefaultRepo(t, err, repos)
}
@@ -190,11 +193,11 @@ func TestListReposPagination(t *testing.T) {
}
}))
defer ts.Close()
provider, err := NewBitbucketServerProviderNoAuth(context.Background(), ts.URL, "PROJECT", true)
assert.NoError(t, err)
provider, err := NewBitbucketServerProviderNoAuth(context.Background(), ts.URL, "PROJECT", true, "", false, nil)
require.NoError(t, err)
repos, err := provider.ListRepos(context.Background(), "ssh")
assert.NoError(t, err)
assert.Equal(t, 2, len(repos))
require.NoError(t, err)
assert.Len(t, repos, 2)
assert.Equal(t, Repository{
Organization: "PROJECT",
Repository: "REPO",
@@ -267,8 +270,8 @@ func TestGetBranchesBranchPagination(t *testing.T) {
defaultHandler(t)(w, r)
}))
defer ts.Close()
provider, err := NewBitbucketServerProviderNoAuth(context.Background(), ts.URL, "PROJECT", true)
assert.NoError(t, err)
provider, err := NewBitbucketServerProviderNoAuth(context.Background(), ts.URL, "PROJECT", true, "", false, nil)
require.NoError(t, err)
repos, err := provider.GetBranches(context.Background(), &Repository{
Organization: "PROJECT",
Repository: "REPO",
@@ -276,8 +279,8 @@ func TestGetBranchesBranchPagination(t *testing.T) {
Labels: []string{},
RepositoryId: 1,
})
assert.NoError(t, err)
assert.Equal(t, 2, len(repos))
require.NoError(t, err)
assert.Len(t, repos, 2)
assert.Equal(t, Repository{
Organization: "PROJECT",
Repository: "REPO",
@@ -320,8 +323,8 @@ func TestGetBranchesDefaultOnly(t *testing.T) {
defaultHandler(t)(w, r)
}))
defer ts.Close()
provider, err := NewBitbucketServerProviderNoAuth(context.Background(), ts.URL, "PROJECT", false)
assert.NoError(t, err)
provider, err := NewBitbucketServerProviderNoAuth(context.Background(), ts.URL, "PROJECT", false, "", false, nil)
require.NoError(t, err)
repos, err := provider.GetBranches(context.Background(), &Repository{
Organization: "PROJECT",
Repository: "REPO",
@@ -329,8 +332,8 @@ func TestGetBranchesDefaultOnly(t *testing.T) {
Labels: []string{},
RepositoryId: 1,
})
assert.NoError(t, err)
assert.Equal(t, 1, len(repos))
require.NoError(t, err)
assert.Len(t, repos, 1)
assert.Equal(t, Repository{
Organization: "PROJECT",
Repository: "REPO",
@@ -352,8 +355,8 @@ func TestGetBranchesMissingDefault(t *testing.T) {
defaultHandler(t)(w, r)
}))
defer ts.Close()
provider, err := NewBitbucketServerProviderNoAuth(context.Background(), ts.URL, "PROJECT", false)
assert.NoError(t, err)
provider, err := NewBitbucketServerProviderNoAuth(context.Background(), ts.URL, "PROJECT", false, "", false, nil)
require.NoError(t, err)
repos, err := provider.GetBranches(context.Background(), &Repository{
Organization: "PROJECT",
Repository: "REPO",
@@ -361,7 +364,7 @@ func TestGetBranchesMissingDefault(t *testing.T) {
Labels: []string{},
RepositoryId: 1,
})
assert.NoError(t, err)
require.NoError(t, err)
assert.Empty(t, repos)
}
@@ -374,8 +377,8 @@ func TestGetBranchesEmptyRepo(t *testing.T) {
}
}))
defer ts.Close()
provider, err := NewBitbucketServerProviderNoAuth(context.Background(), ts.URL, "PROJECT", false)
assert.NoError(t, err)
provider, err := NewBitbucketServerProviderNoAuth(context.Background(), ts.URL, "PROJECT", false, "", false, nil)
require.NoError(t, err)
repos, err := provider.GetBranches(context.Background(), &Repository{
Organization: "PROJECT",
Repository: "REPO",
@@ -384,7 +387,7 @@ func TestGetBranchesEmptyRepo(t *testing.T) {
RepositoryId: 1,
})
assert.Empty(t, repos)
assert.NoError(t, err)
require.NoError(t, err)
}
func TestGetBranchesErrorDefaultBranch(t *testing.T) {
@@ -397,8 +400,8 @@ func TestGetBranchesErrorDefaultBranch(t *testing.T) {
defaultHandler(t)(w, r)
}))
defer ts.Close()
provider, err := NewBitbucketServerProviderNoAuth(context.Background(), ts.URL, "PROJECT", false)
assert.NoError(t, err)
provider, err := NewBitbucketServerProviderNoAuth(context.Background(), ts.URL, "PROJECT", false, "", false, nil)
require.NoError(t, err)
_, err = provider.GetBranches(context.Background(), &Repository{
Organization: "PROJECT",
Repository: "REPO",
@@ -406,7 +409,74 @@ func TestGetBranchesErrorDefaultBranch(t *testing.T) {
Labels: []string{},
RepositoryId: 1,
})
assert.Error(t, err)
require.Error(t, err)
}
func TestListReposTLS(t *testing.T) {
tests := []struct {
name string
tlsInsecure bool
passCerts bool
requireErr bool
}{
{
name: "TLS Insecure: true, No Certs",
tlsInsecure: true,
passCerts: false,
requireErr: false,
},
{
name: "TLS Insecure: true, With Certs",
tlsInsecure: true,
passCerts: true,
requireErr: false,
},
{
name: "TLS Insecure: false, With Certs",
tlsInsecure: false,
passCerts: true,
requireErr: false,
},
{
name: "TLS Insecure: false, No Certs",
tlsInsecure: false,
passCerts: false,
requireErr: true,
},
}
for _, test := range tests {
test := test
t.Run(test.name, func(t *testing.T) {
ts := httptest.NewTLSServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
defaultHandler(t)(w, r)
}))
defer ts.Close()
var certs []byte
if test.passCerts == true {
for _, cert := range ts.TLS.Certificates {
for _, c := range cert.Certificate {
parsedCert, err := x509.ParseCertificate(c)
require.NoError(t, err, "Failed to parse certificate")
certs = append(certs, pem.EncodeToMemory(&pem.Block{
Type: "CERTIFICATE",
Bytes: parsedCert.Raw,
})...)
}
}
}
provider, err := NewBitbucketServerProviderBasicAuth(context.Background(), "user", "password", ts.URL, "PROJECT", true, "", test.tlsInsecure, certs)
require.NoError(t, err)
_, err = provider.ListRepos(context.Background(), "ssh")
if test.requireErr {
require.Error(t, err)
} else {
require.NoError(t, err)
}
})
}
}
func TestListReposBasicAuth(t *testing.T) {
@@ -416,8 +486,21 @@ func TestListReposBasicAuth(t *testing.T) {
defaultHandler(t)(w, r)
}))
defer ts.Close()
provider, err := NewBitbucketServerProviderBasicAuth(context.Background(), "user", "password", ts.URL, "PROJECT", true)
assert.NoError(t, err)
provider, err := NewBitbucketServerProviderBasicAuth(context.Background(), "user", "password", ts.URL, "PROJECT", true, "", false, nil)
require.NoError(t, err)
repos, err := provider.ListRepos(context.Background(), "ssh")
verifyDefaultRepo(t, err, repos)
}
func TestListReposBearerAuth(t *testing.T) {
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
assert.Equal(t, "Bearer tolkien", r.Header.Get("Authorization"))
assert.Equal(t, "no-check", r.Header.Get("X-Atlassian-Token"))
defaultHandler(t)(w, r)
}))
defer ts.Close()
provider, err := NewBitbucketServerProviderBearerToken(context.Background(), "tolkien", ts.URL, "PROJECT", true, "", false, nil)
require.NoError(t, err)
repos, err := provider.ListRepos(context.Background(), "ssh")
verifyDefaultRepo(t, err, repos)
}
@@ -443,11 +526,11 @@ func TestListReposDefaultBranch(t *testing.T) {
defaultHandler(t)(w, r)
}))
defer ts.Close()
provider, err := NewBitbucketServerProviderNoAuth(context.Background(), ts.URL, "PROJECT", false)
assert.NoError(t, err)
provider, err := NewBitbucketServerProviderNoAuth(context.Background(), ts.URL, "PROJECT", false, "", false, nil)
require.NoError(t, err)
repos, err := provider.ListRepos(context.Background(), "ssh")
assert.NoError(t, err)
assert.Equal(t, 1, len(repos))
require.NoError(t, err)
assert.Len(t, repos, 1)
assert.Equal(t, Repository{
Organization: "PROJECT",
Repository: "REPO",
@@ -469,10 +552,10 @@ func TestListReposMissingDefaultBranch(t *testing.T) {
defaultHandler(t)(w, r)
}))
defer ts.Close()
provider, err := NewBitbucketServerProviderNoAuth(context.Background(), ts.URL, "PROJECT", false)
assert.NoError(t, err)
provider, err := NewBitbucketServerProviderNoAuth(context.Background(), ts.URL, "PROJECT", false, "", false, nil)
require.NoError(t, err)
repos, err := provider.ListRepos(context.Background(), "ssh")
assert.NoError(t, err)
require.NoError(t, err)
assert.Empty(t, repos)
}
@@ -486,10 +569,10 @@ func TestListReposErrorDefaultBranch(t *testing.T) {
defaultHandler(t)(w, r)
}))
defer ts.Close()
provider, err := NewBitbucketServerProviderNoAuth(context.Background(), ts.URL, "PROJECT", false)
assert.NoError(t, err)
provider, err := NewBitbucketServerProviderNoAuth(context.Background(), ts.URL, "PROJECT", false, "", false, nil)
require.NoError(t, err)
_, err = provider.ListRepos(context.Background(), "ssh")
assert.Error(t, err)
require.Error(t, err)
}
func TestListReposCloneProtocol(t *testing.T) {
@@ -498,11 +581,11 @@ func TestListReposCloneProtocol(t *testing.T) {
defaultHandler(t)(w, r)
}))
defer ts.Close()
provider, err := NewBitbucketServerProviderNoAuth(context.Background(), ts.URL, "PROJECT", true)
assert.NoError(t, err)
provider, err := NewBitbucketServerProviderNoAuth(context.Background(), ts.URL, "PROJECT", true, "", false, nil)
require.NoError(t, err)
repos, err := provider.ListRepos(context.Background(), "https")
assert.NoError(t, err)
assert.Equal(t, 1, len(repos))
require.NoError(t, err)
assert.Len(t, repos, 1)
assert.Equal(t, Repository{
Organization: "PROJECT",
Repository: "REPO",
@@ -520,10 +603,10 @@ func TestListReposUnknownProtocol(t *testing.T) {
defaultHandler(t)(w, r)
}))
defer ts.Close()
provider, err := NewBitbucketServerProviderNoAuth(context.Background(), ts.URL, "PROJECT", true)
assert.NoError(t, err)
provider, err := NewBitbucketServerProviderNoAuth(context.Background(), ts.URL, "PROJECT", true, "", false, nil)
require.NoError(t, err)
_, errProtocol := provider.ListRepos(context.Background(), "http")
assert.NotNil(t, errProtocol)
require.Error(t, errProtocol)
}
func TestBitbucketServerHasPath(t *testing.T) {
@@ -558,37 +641,37 @@ func TestBitbucketServerHasPath(t *testing.T) {
}
}))
defer ts.Close()
provider, err := NewBitbucketServerProviderNoAuth(context.Background(), ts.URL, "PROJECT", true)
assert.NoError(t, err)
provider, err := NewBitbucketServerProviderNoAuth(context.Background(), ts.URL, "PROJECT", true, "", false, nil)
require.NoError(t, err)
repo := &Repository{
Organization: "PROJECT",
Repository: "REPO",
Branch: "main",
}
ok, err := provider.RepoHasPath(context.Background(), repo, "pkg")
assert.NoError(t, err)
require.NoError(t, err)
assert.True(t, ok)
ok, err = provider.RepoHasPath(context.Background(), repo, "pkg/")
assert.NoError(t, err)
require.NoError(t, err)
assert.True(t, ok)
ok, err = provider.RepoHasPath(context.Background(), repo, "anotherpkg/file.txt")
assert.NoError(t, err)
require.NoError(t, err)
assert.True(t, ok)
ok, err = provider.RepoHasPath(context.Background(), repo, "anotherpkg/missing.txt")
assert.NoError(t, err)
require.NoError(t, err)
assert.False(t, ok)
ok, err = provider.RepoHasPath(context.Background(), repo, "notathing")
assert.NoError(t, err)
require.NoError(t, err)
assert.False(t, ok)
ok, err = provider.RepoHasPath(context.Background(), repo, "return-redirect")
assert.NoError(t, err)
require.NoError(t, err)
assert.True(t, ok)
_, err = provider.RepoHasPath(context.Background(), repo, "unauthorized-response")
assert.Error(t, err)
require.Error(t, err)
}

View File

@@ -258,6 +258,7 @@ func giteaMockHandler(t *testing.T) func(http.ResponseWriter, *http.Request) {
}
}
}
func TestGiteaListRepos(t *testing.T) {
cases := []struct {
name, proto, url string
@@ -305,9 +306,9 @@ func TestGiteaListRepos(t *testing.T) {
provider, _ := NewGiteaProvider(context.Background(), "test-argocd", "", ts.URL, c.allBranches, false)
rawRepos, err := ListRepos(context.Background(), provider, c.filters, c.proto)
if c.hasError {
assert.NotNil(t, err)
require.Error(t, err)
} else {
assert.Nil(t, err)
require.NoError(t, err)
// Just check that this one project shows up. Not a great test but better thing nothing?
repos := []*Repository{}
branches := []string{}
@@ -341,19 +342,19 @@ func TestGiteaHasPath(t *testing.T) {
t.Run("file exists", func(t *testing.T) {
ok, err := host.RepoHasPath(context.Background(), repo, "README.md")
assert.Nil(t, err)
require.NoError(t, err)
assert.True(t, ok)
})
t.Run("directory exists", func(t *testing.T) {
ok, err := host.RepoHasPath(context.Background(), repo, "gitea")
assert.Nil(t, err)
require.NoError(t, err)
assert.True(t, ok)
})
t.Run("does not exists", func(t *testing.T) {
ok, err := host.RepoHasPath(context.Background(), repo, "notathing")
assert.Nil(t, err)
require.NoError(t, err)
assert.False(t, ok)
})
}

View File

@@ -2,12 +2,11 @@ package scm_provider
import (
"context"
"errors"
"fmt"
"net/http"
"os"
"github.com/google/go-github/v35/github"
"github.com/google/go-github/v63/github"
"golang.org/x/oauth2"
)
@@ -36,7 +35,7 @@ func NewGithubProvider(ctx context.Context, organization string, token string, u
client = github.NewClient(httpClient)
} else {
var err error
client, err = github.NewEnterpriseClient(url, url, httpClient)
client, err = github.NewClient(httpClient).WithEnterpriseURLs(url, url)
if err != nil {
return nil, err
}
@@ -120,14 +119,11 @@ func (g *GithubProvider) RepoHasPath(ctx context.Context, repo *Repository, path
func (g *GithubProvider) listBranches(ctx context.Context, repo *Repository) ([]github.Branch, error) {
// If we don't specifically want to query for all branches, just use the default branch and call it a day.
if !g.allBranches {
defaultBranch, _, err := g.client.Repositories.GetBranch(ctx, repo.Organization, repo.Repository, repo.Branch)
defaultBranch, resp, err := g.client.Repositories.GetBranch(ctx, repo.Organization, repo.Repository, repo.Branch, 0)
if err != nil {
var githubErrorResponse *github.ErrorResponse
if errors.As(err, &githubErrorResponse) {
if githubErrorResponse.Response.StatusCode == http.StatusNotFound {
// Default branch doesn't exist, so the repo is empty.
return []github.Branch{}, nil
}
if resp.StatusCode == http.StatusNotFound {
// Default branch doesn't exist, so the repo is empty.
return []github.Branch{}, nil
}
return nil, err
}

View File

@@ -8,6 +8,7 @@ import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
)
@@ -244,9 +245,9 @@ func TestGithubListRepos(t *testing.T) {
provider, _ := NewGithubProvider(context.Background(), "argoproj", "", ts.URL, c.allBranches)
rawRepos, err := ListRepos(context.Background(), provider, c.filters, c.proto)
if c.hasError {
assert.Error(t, err)
require.Error(t, err)
} else {
assert.NoError(t, err)
require.NoError(t, err)
// Just check that this one project shows up. Not a great test but better thing nothing?
repos := []*Repository{}
branches := []string{}
@@ -278,11 +279,11 @@ func TestGithubHasPath(t *testing.T) {
Branch: "master",
}
ok, err := host.RepoHasPath(context.Background(), repo, "pkg/")
assert.Nil(t, err)
require.NoError(t, err)
assert.True(t, ok)
ok, err = host.RepoHasPath(context.Background(), repo, "notathing/")
assert.Nil(t, err)
require.NoError(t, err)
assert.False(t, ok)
}
@@ -299,26 +300,26 @@ func TestGithubGetBranches(t *testing.T) {
}
repos, err := host.GetBranches(context.Background(), repo)
if err != nil {
assert.NoError(t, err)
require.NoError(t, err)
} else {
assert.Equal(t, repos[0].Branch, "master")
assert.Equal(t, "master", repos[0].Branch)
}
//Branch Doesn't exists instead of error will return no error
// Branch Doesn't exists instead of error will return no error
repo2 := &Repository{
Organization: "argoproj",
Repository: "applicationset",
Branch: "main",
}
_, err = host.GetBranches(context.Background(), repo2)
assert.NoError(t, err)
require.NoError(t, err)
// Get all branches
host.allBranches = true
repos, err = host.GetBranches(context.Background(), repo)
if err != nil {
assert.NoError(t, err)
require.NoError(t, err)
} else {
// considering master branch to exist.
assert.Equal(t, len(repos), 1)
assert.Len(t, repos, 1)
}
}

Some files were not shown because too many files have changed in this diff Show More