Compare commits

..

334 Commits

Author SHA1 Message Date
Michael Crenshaw
c7a0dff47e chore: add security section to generated release notes
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2023-02-06 13:46:33 -05:00
github-actions[bot]
22c83d3104 [Bot] docs: Update Snyk reports (#12290)
Signed-off-by: CI <ci@argoproj.com>
Co-authored-by: CI <ci@argoproj.com>
2023-02-06 13:42:04 -05:00
Michael Crenshaw
39c00f97ca docs: add 2.5->2.6 upgrade notes to list (#12283)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2023-02-06 13:19:50 -05:00
Michael Crenshaw
212029d8c2 fix: multi-source app refresh (#11772) (#12217)
* fix multi-source refresh

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

* serialize nil and empty resolvedRevisions the same to avoid cache misses

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

* more consistent naming

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

* document duplication

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

* add todo

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

---------

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2023-02-06 13:02:02 -05:00
Karol Szymanowski
4a06cb2c74 chore: Add Omni to list of users (#12078)
Signed-off-by: Karol Szymanowski <39292284+karol-szymanowski@users.noreply.github.com>
2023-02-06 11:53:41 -05:00
Michael Crenshaw
2494657829 chore: rename 'progressive rollouts' to 'progressive syncs' (#12265)
* chore: rename 'progressive rollouts' to 'progressive syncs'

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

* rename docs file

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

* Update cmd/argocd-applicationset-controller/commands/applicationset_controller.go

Co-authored-by: Panagiotis Georgiadis <pgeorgia@redhat.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: Panagiotis Georgiadis <pgeorgia@redhat.com>
2023-02-06 10:59:43 -05:00
Jake
031ecaf754 fix: don't dump SSG to server logs, change deprecation notice to v2.7 (#12285)
* fix: don't dump SSG to server logs, change deprecation notice to v2.7

Signed-off-by: notfromstatefarm <86763948+notfromstatefarm@users.noreply.github.com>

* Update server/server.go

Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Signed-off-by: Jake <86763948+notfromstatefarm@users.noreply.github.com>

---------

Signed-off-by: notfromstatefarm <86763948+notfromstatefarm@users.noreply.github.com>
Signed-off-by: Jake <86763948+notfromstatefarm@users.noreply.github.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2023-02-03 13:32:24 -05:00
James Callahan
e420666d76 feat: add org.opencontainers.image.source label to docker images (#12270)
Signed-off-by: James Callahan <james@wavesquid.com>
2023-02-03 10:44:47 -05:00
Michael Crenshaw
02eb67a43e chore: upgrade cookiejar to avoid CVE-2022-25901 (#12030)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2023-02-03 10:41:50 -05:00
Keith Chong
52d223d9ef docs: sign up for 1.8 release (#12266) 2023-02-03 10:32:02 -05:00
Josh Soref
b9f9b78b8b docs: Fix heading to not include a v for the second version (#12218)
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-02-03 10:28:59 -05:00
wmgroot
f847670157 fix: AppSet Progressive sync fixes, docs, and logging improvements (#11924) (#12103)
Signed-off-by: wmgroot <wmgroot@gmail.com>
2023-02-03 10:27:16 -05:00
Ishita Sequeira
9b86af18bc fix: disable edit button on App Details Summary and Parameters tabs multi-source apps (#12048)
* disable edit button on App Details Summary and Parameters tabs for applications with multiple sources

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

* disable editing specific fields in Application Summary Tab for Multiple Source apps

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

---------

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>
2023-02-03 10:14:09 -05:00
Ishita Sequeira
da46381907 fix: return nil if reading application set was successful (#12261)
Signed-off-by: ishitasequeira <ishiseq29@gmail.com>
2023-02-03 10:04:52 -05:00
Thomas Decaux
b17007b7cf docs: add destination.name example (#12242)
I had trouble finding the documentation to use the cluster name for destination, instead of the full URL. This is really useful.

Use case: we manage multiple clusters, destination.name is a better way to set destination.

Signed-off-by: Thomas Decaux <ebuildy@gmail.com>
Signed-off-by: ebuildy <ebuildy@gmail.com>
2023-02-02 12:54:42 -05:00
Veronica Herzog
7dcfe1fc38 chore: Add Sauce Labs to USERS.md (#12252)
Signed-off-by: Veronica Herzog <94460138+vherzog-sauce@users.noreply.github.com>
2023-02-02 12:53:38 -05:00
Soumya Ghosh Dastidar
97d75a61fd feat: make discovery field optional in plugins (#12073)
* feat: make discovery field optional in plugins

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>

* docs: updated plugin docs

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>

* docs: updated plugin docs

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>

* feat: updated discovery check for named plugins

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>

* fix: fixed unit tests

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>

* feat: simplified code

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>

* fix: close connection on error

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>

* feat: simplify code

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>

* feat: add named return values

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>

---------

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>
2023-02-02 12:07:58 -05:00
Alex Eftimie
048902a32e fix: issue reported by sonar cloud. use forEach instead of map (#12250)
Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>
2023-02-01 23:36:15 +00:00
Panagiotis Georgiadis
3524128d7f fix: Upgrade gopkg.in/yaml.v2 to v2.4.0 (#12249)
Signed-off-by: Panagiotis Georgiadis <pgeorgia@redhat.com>
2023-02-01 16:04:44 -05:00
jannfis
b600da1318 feat: Allow force of basic auth for HTTP repositories (#11983)
* feat: Allow force of basic auth for HTTP repositories

Signed-off-by: jannfis <jann@mistrust.net>

* Some docs

Signed-off-by: jannfis <jann@mistrust.net>

---------

Signed-off-by: jannfis <jann@mistrust.net>
2023-02-01 13:11:46 -05:00
Artur Rodrigues
e510a77a1d fix: repo-server - prevent locked state after unclean git checkout (#7898) (#11805)
* Pull in new version of argoproj/pkg

Signed-off-by: Artur Rodrigues <artur.rodrigues@lacework.net>

* Allow timeout behavior to be specified in util/exec/exec

Signed-off-by: Artur Rodrigues <artur.rodrigues@lacework.net>

* Git processes receive SIGTERM when timedout

Signed-off-by: Artur Rodrigues <artur.rodrigues@lacework.net>

* Update util/exec/exec_test.go

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

---------

Signed-off-by: Artur Rodrigues <artur.rodrigues@lacework.net>
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2023-02-01 12:59:34 -05:00
dependabot[bot]
06b98c5a25 chore(deps): bump docker/setup-buildx-action from 2.2.1 to 2.4.0 (#12227)
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 2.2.1 to 2.4.0.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](8c0edbc76e...15c905b16b)

---
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>
2023-01-31 16:54:59 -05:00
dependabot[bot]
4242cfc126 chore(deps): bump actions/cache from 3.2.3 to 3.2.4 (#12228)
Bumps [actions/cache](https://github.com/actions/cache) from 3.2.3 to 3.2.4.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](58c146cc91...627f0f41f6)

---
updated-dependencies:
- dependency-name: actions/cache
  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>
2023-01-31 16:53:19 -05:00
Adam Jensen
977b730569 docs: Fix copy that refers to a different CLI flag (#12236)
Signed-off-by: Adam Jensen <adam@acj.sh>
2023-01-31 16:51:41 -05:00
Leonardo Luz Almeida
1373f4fd3f docs: Add authz and authn architectural document (#12005)
* docs: Add authz and authn docs

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

* docs: add authz and authn architectural documentation

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

* add more links and details

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

* Add architecture topic to readthedocs

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

* fix image link

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

* compact image

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

* fix extension

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

* minor fixes

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

---------

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
2023-01-31 16:34:13 -05:00
jannfis
9b7498ce84 fix: Prevent Git from waiting for terminal input (#12028)
Signed-off-by: jannfis <jann@mistrust.net>
2023-01-31 16:31:06 -05:00
Kostis (Codefresh)
c043f4ad0a docs: Clarify directory recursion (#12037)
Signed-off-by: Kostis Kapelonis <kostis@codefresh.io>
2023-01-31 16:29:17 -05:00
James Brady
1000ac15ab docs: Fix list formatting in "Resource Actions" docs page (#12061)
Signed-off-by: James Brady <goodgravy@users.noreply.github.com>
2023-01-31 16:26:15 -05:00
Rohit Rajak
88b6cfcea7 chore: add platform9 to USERS.md (#12126) 2023-01-31 16:01:20 -05:00
Pascal M
3cb111545f chore: Update USERS.md (#12193) 2023-01-31 15:58:06 -05:00
Nobuo Takizawa
1e6a47cd39 chore: Update dex's image tag that is forgotten to be updated (#12234)
Signed-off-by: nobuyo <longzechangsheng@gmail.com>
2023-01-31 15:43:05 -05:00
Vladimir Pouzanov
f9571760a3 docs: Update the security instructions link (#12232)
The original link points at the doc that says 'deprecated'

Signed-off-by: Vladimir Pouzanov <farcaller@gmail.com>
2023-01-31 13:15:32 -05:00
Alex Eftimie
9bd10330ff docs: how to change default view (#12140)
Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>
2023-01-30 13:26:33 -08:00
Andriy Drozd
b1d0009fd9 fix: clarify error wording when syncing (#12156)
Signed-off-by: Andriy Drozd <48000208+drozd-A@users.noreply.github.com>
Co-authored-by: Remington Breeze <remington@breeze.software>
2023-01-30 18:45:41 +00:00
David U
9b994c4af0 Replace width:webkit-fill-avail with left/right 0 (#11991)
Signed-off-by: David Usken <david@timeanddate.com>
2023-01-30 09:52:44 -08:00
github-actions[bot]
a77d149668 [Bot] docs: Update Snyk reports (#12198)
Signed-off-by: CI <ci@argoproj.com>
Co-authored-by: CI <ci@argoproj.com>
2023-01-30 10:35:14 -05:00
Nolan Emirot
062e245192 docs(helm): clarify that helm is only used to inflate chart (#11692)
* docs(helm): helm use to inflate chart

Signed-off-by: emirot <emirot.nolan@gmail.com>

* docs(helm): helm use to inflate chart

Signed-off-by: emirot <emirot.nolan@gmail.com>

* Update helm.md

Signed-off-by: Nolan Emirot <emirot.nolan@gmail.com>

* docs: add helm info

Signed-off-by: emirot <emirot.nolan@gmail.com>

* Update docs/user-guide/helm.md

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

---------

Signed-off-by: emirot <emirot.nolan@gmail.com>
Signed-off-by: Nolan Emirot <emirot.nolan@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>
2023-01-30 15:12:35 +00:00
Nolan Emirot
ac96269bda chore: fix target name in comment (#11696)
* fix: add pod age icon details in tooltip (#10290) (#11170)

* pod-age-icon details added in tooltip

Signed-off-by: schakradari <58915923+schakrad@users.noreply.github.com>

* Tooltip change

Signed-off-by: schakradari <58915923+schakrad@users.noreply.github.com>

Signed-off-by: schakradari <58915923+schakrad@users.noreply.github.com>
Signed-off-by: emirot <emirot.nolan@gmail.com>

* chore: fix flaky e2e test for immutable fields (#11685)

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

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

* fix: target name in comment

Signed-off-by: emirot <emirot.nolan@gmail.com>

* feat: expose deep links in UI (#11680)

Signed-off-by: Remington Breeze <remington@breeze.software>
Signed-off-by: emirot <emirot.nolan@gmail.com>

---------

Signed-off-by: schakradari <58915923+schakrad@users.noreply.github.com>
Signed-off-by: emirot <emirot.nolan@gmail.com>
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Signed-off-by: Remington Breeze <remington@breeze.software>
Co-authored-by: schakrad <58915923+schakrad@users.noreply.github.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Co-authored-by: Remington Breeze <remington@breeze.software>
2023-01-30 15:10:00 +00:00
Remington Breeze
a4c0f3cf1f feat: add labels to pod log navigation buttons (#10890) 2023-01-29 21:44:21 -08:00
Andriy Drozd
193cf76e12 fix: replace copy tooltip with copy line text (#12180)
Signed-off-by: Andriy Drozd <48000208+drozd-A@users.noreply.github.com>
Co-authored-by: Remington Breeze <remington@breeze.software>
2023-01-28 03:13:47 +00:00
Remington Breeze
afb88308fa fix: create app shows dest URL instead of name (#12054)
Signed-off-by: Remington Breeze <remington@breeze.software>
2023-01-27 20:34:06 -05:00
Márcio Pessoa
8b4516519f fix log Filter string toggle button tooltip (#12191) 2023-01-27 17:28:33 -08:00
Michael Crenshaw
adb4471569 feat(security): require the aud claim from OIDC providers by default (#12187)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2023-01-27 21:29:08 +00:00
Ishita Sequeira
59b00bb0c0 fix: disable More button for multiple sources (#11760) (#11971)
* disable More button for multiple sources

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

* address comments

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

* Addressed merge conflicts

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

---------

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>
2023-01-27 15:27:21 -05:00
Eugen Friedland
eaac2c636f fix(health): Handling SparkApplication CRD health status if dynamic allocation is enabled (#7557) (#11522)
Signed-off-by: Yevgeniy Fridland <yevg.mord@gmail.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2023-01-27 15:16:27 -05:00
Michael Crenshaw
a825aad384 fix: add CLI client IDs to default OIDC allowed audiences (#12170) (#12179)
* fix(settings): add CLI client ID in default OAuth2 allowed audiences

Signed-off-by: Yann Soubeyrand <yann.soubeyrand@camptocamp.com>

* fix: add CLI client IDs to default OIDC allowed audiences (#12170)

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>

* test

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

* handle expired token properly

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

---------

Signed-off-by: Yann Soubeyrand <yann.soubeyrand@camptocamp.com>
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Co-authored-by: Yann Soubeyrand <yann.soubeyrand@camptocamp.com>
2023-01-27 14:17:51 -05:00
Alexander Matyushentsev
4610bc831c fix: create separate API to load configured plugins (#12164)
Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
2023-01-26 22:58:31 +00:00
杨刚
61f6530e8a chore: repo command give more hints. (#11849)
Signed-off-by: yanggang <gang.yang@daocloud.io>

Signed-off-by: yanggang <gang.yang@daocloud.io>
2023-01-26 02:54:04 +00:00
Keith Chong
b2a6387ca0 feat: Always Show ReplicaSets as Pod Groups (#12051) (#12065)
Signed-off-by: Keith Chong <kykchong@redhat.com>
Co-authored-by: Remington Breeze <remington@breeze.software>
2023-01-25 18:20:45 +00:00
Alex Eftimie
f7011f646b feat(ui): allow sorting the application list (#11645)
Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>
Co-authored-by: Remington Breeze <remington@breeze.software>
2023-01-25 18:17:49 +00:00
杨刚
3da1eaa261 chore: Reused common.DefaultRepoServerAddr (#11842)
Signed-off-by: yanggang <gang.yang@daocloud.io>

Signed-off-by: yanggang <gang.yang@daocloud.io>
2023-01-25 09:59:05 -05:00
Michael Crenshaw
b38bc0040b Merge pull request from GHSA-q9hr-j4rf-8fjc
* fix: verify audience claim

Co-Authored-By: Vladimir Pouzanov <farcaller@gmail.com>
Signed-off-by: CI <350466+crenshaw-dev@users.noreply.github.com>

* fix lint

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

* fix handling of expired token error

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

* go mod tidy

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

* handle single aud claim marshaled as a string

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

Signed-off-by: CI <350466+crenshaw-dev@users.noreply.github.com>
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Co-authored-by: Vladimir Pouzanov <farcaller@gmail.com>
2023-01-25 09:15:03 -05:00
ChangZhuo Chen (陳昌倬)
95da518e7d Merge pull request from GHSA-6p4m-hw2h-6gmw
Signed-off-by: ChangZhuo Chen (陳昌倬) <czchen@czchen.org>

add test

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

better comment

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

Signed-off-by: CI <350466+crenshaw-dev@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>
2023-01-25 09:14:29 -05:00
杨刚
adc6f564f7 test: Reused const annotationKey string for legacy_test.go (#11837)
Signed-off-by: yanggang <gang.yang@daocloud.io>

Signed-off-by: yanggang <gang.yang@daocloud.io>
2023-01-25 08:03:59 -05:00
杨刚
996262021b refactor: Make fsnotify event more readable. (#11836)
Signed-off-by: yanggang <gang.yang@daocloud.io>

Signed-off-by: yanggang <gang.yang@daocloud.io>
2023-01-25 07:57:44 -05:00
Mike Bryant
6069ded532 fix: Support resource actions for apps in different Namespace (#12115)
Signed-off-by: Mike Bryant <mike.bryant@mettle.co.uk>

Signed-off-by: Mike Bryant <mike.bryant@mettle.co.uk>
2023-01-24 17:31:53 -05:00
Andriy Drozd
221a03973e docs: replace period with parenthesis (#12044)
Signed-off-by: Andriy Drozd <48000208+drozd-A@users.noreply.github.com>

Signed-off-by: Andriy Drozd <48000208+drozd-A@users.noreply.github.com>
2023-01-24 17:14:11 -05:00
Ananda Dwi Ae
c20301f27c chore: add btech user (#12116) 2023-01-24 13:32:31 -05:00
Leonardo Luz Almeida
5a6f969b83 chore: Refactor terminal handler to use auth-middleware (#12052)
* chore: Refactor terminal handler to use auth-middleware

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

* remove context key for now

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

* implement unit-tests

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

* remove claim valid check for now

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

* remove unnecessary test

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

* fix lint

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

* don't too much details in http response

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

* Fix error

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

* Fix lint

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

* trigger build

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

* builder pattern in terminal feature-flag middleware

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

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
2023-01-24 10:46:36 -05:00
Ian Delahorne
bd8777a8f8 fix: Add namespace to sub-application link URLs (#11946)
Signed-off-by: Ian Delahorne <ian@patreon.com>
Co-authored-by: Remington Breeze <remington@breeze.software>
2023-01-23 16:40:11 -08:00
Alex Eftimie
4a50114126 feat(UI): allow applications to declare default view preferences (#12019) (#12080)
Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>
Co-authored-by: Remington Breeze <remington@breeze.software>
2023-01-23 10:10:26 -08:00
github-actions[bot]
9414fb303d [Bot] docs: Update Snyk reports (#12069)
Signed-off-by: CI <ci@argoproj.com>

Signed-off-by: CI <ci@argoproj.com>
Co-authored-by: CI <ci@argoproj.com>
2023-01-23 11:08:01 -05:00
Justin Marquis
61f8876b99 chore: disable docker sbom and attestations (#12059)
Signed-off-by: Justin Marquis <34fathombelow@protonmail.com>

Signed-off-by: Justin Marquis <34fathombelow@protonmail.com>
2023-01-20 09:59:48 -05:00
Jellyfrog
584428edaf fix: populate parentRefs correctly with multiple owners (#3910) (#11715)
* fix: populate parentRefs correctly with multiple owners

It previously simply wrote to key 0, instead of appending all owners

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

* test multiple resource owners

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

Signed-off-by: Jellyfrog <Jellyfrog@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>
2023-01-19 11:57:45 -05:00
Fish-pro
49412a1ea9 chore: Remove dependency on github.com/pkg/errors (#11886)
Signed-off-by: Fish-pro <zechun.chen@daocloud.io>

Signed-off-by: Fish-pro <zechun.chen@daocloud.io>
2023-01-18 17:06:10 -05:00
Nicholas Morey
8895b4a83a docs: clarify value for disabling tools (#11395)
* docs: clarify value for disabling tools

Although it is implied to set the value for the key to `false`, this explicitly states it to add clarity. Along with some wording changes.

Signed-off-by: Nicholas Morey <nicholas@morey.tech>

* docs: add use-case for disabling tools

Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Signed-off-by: Nicholas Morey <nicholas@morey.tech>

Signed-off-by: Nicholas Morey <nicholas@morey.tech>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2023-01-18 16:46:29 -05:00
github-actions[bot]
806ab33d7c [Bot] docs: Update Snyk reports (#12023)
Signed-off-by: CI <ci@argoproj.com>

Signed-off-by: CI <ci@argoproj.com>
Co-authored-by: CI <ci@argoproj.com>
2023-01-18 16:39:05 -05:00
Peter Macdonald
70f9de4403 docs: Fixed typos, and grammar in the High Availability Docs (#12021)
* Fixed typos, and grammar

Signed-off-by: Peter Macdonald <macdonald.peter90@gmail.com>

* Updated Docs based on PR Feedback

Signed-off-by: Peter Macdonald <macdonald.peter90@gmail.com>

Signed-off-by: Peter Macdonald <macdonald.peter90@gmail.com>
2023-01-18 16:03:27 -05:00
rumstead
c9e4bcd351 docs: use environment variable for argo cd user (#12024)
Signed-off-by: rumstead <37445536+rumstead@users.noreply.github.com>

Signed-off-by: rumstead <37445536+rumstead@users.noreply.github.com>
2023-01-18 16:02:34 -05:00
Alex Eftimie
1808539652 fix: values should always be visible, even when they are empty (#11676) (#11681)
Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>

Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.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>
2023-01-18 09:49:24 -05:00
jannfis
96b0eb0f53 chore: Support running dockerized toolchain using sudo (#11955)
Signed-off-by: jannfis <jann@mistrust.net>

Signed-off-by: jannfis <jann@mistrust.net>
2023-01-18 09:06:23 -05:00
Michael Crenshaw
15b284b142 chore: upgrade net/http2 to avoid CVE-2022-41717 (#11616)
* chore: upgrade net/http2 to avoid CVE-2022-41717

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>

* ugprade net

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

* go mod tidy

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

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2023-01-17 18:41:19 -05:00
Aymen Ben Tanfous
891707721f fix: Fixed matrix requeueAfterSeconds for PR (#10914) (#10915)
* Fixed matrix requeueAfterSeconds for PR

Signed-off-by: Aymen Ben Tanfous <aymen.bentanfous@gmail.com>

* A try to make some tests

Signed-off-by: Aymen Ben Tanfous <aymen.bentanfous@cimpress.com>

* Fixed default test returns the default time

Signed-off-by: Aymen Ben Tanfous <aymenbentanfous@gmail.com>

* Fixed default test returns the default time

Signed-off-by: Aymen Ben Tanfous <aymenbentanfous@gmail.com>

Signed-off-by: Aymen Ben Tanfous <aymen.bentanfous@gmail.com>
Signed-off-by: Aymen Ben Tanfous <aymen.bentanfous@cimpress.com>
Signed-off-by: Aymen Ben Tanfous <aymenbentanfous@gmail.com>
Co-authored-by: Aymen Ben Tanfous <aymen.bentanfous@cimpress.com>
Co-authored-by: Aymen Ben Tanfous <aymenbentanfous@gmail.com>
2023-01-17 16:53:41 -05:00
Shun Nishitsuji
c3784349d3 fix: Remove unnecessary branch (#11963)
Already checked outside the conditional expression

Signed-off-by: asuforce <owata.sn@gmail.com>

Signed-off-by: asuforce <owata.sn@gmail.com>
2023-01-17 16:47:11 -05:00
Remington Breeze
2358669114 feat: App View extensions (#12006)
Signed-off-by: Remington Breeze <remington@breeze.software>
2023-01-17 09:17:27 -08:00
github-actions[bot]
c31d15e8d6 [Bot] docs: Update Snyk reports (#11985)
Signed-off-by: CI <ci@argoproj.com>

Signed-off-by: CI <ci@argoproj.com>
Co-authored-by: CI <ci@argoproj.com>
2023-01-15 02:47:03 +00:00
Michael Crenshaw
2ddb7772d1 fix: pathParamPrefix is optional (#11796) (#11943)
* fix: pathParamPrefix is optional

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

* go mod tidy

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

* fix import

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

* fix codegen

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

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2023-01-13 13:34:03 -05:00
dependabot[bot]
1ab40261c0 chore(deps): bump actions/cache from 3.2.2 to 3.2.3 (#11928)
Bumps [actions/cache](https://github.com/actions/cache) from 3.2.2 to 3.2.3.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](4723a57e26...58c146cc91)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-13 09:51:02 -05:00
schakrad
63e410a9fc fix(ui): trash icon for resources to be pruned, plus better tooltip (#10290) (#11171)
* Trash Icon for the resource that will be pruned on sync

Signed-off-by: schakradari <58915923+schakrad@users.noreply.github.com>

* Trash icon for the resource that gets pruned on sync.

Signed-off-by: schakradari <58915923+schakrad@users.noreply.github.com>

* Tobepruned icon on grid view

Signed-off-by: schakradari <58915923+schakrad@users.noreply.github.com>

* Update ui/src/app/applications/components/utils.tsx

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

Signed-off-by: schakradari <58915923+schakrad@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>
2023-01-12 12:26:20 -05:00
Michael Crenshaw
e82a6447e2 docs: add FOSSA badge to README (#11956)
* docs: add FOSSA badge to README

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

* organization

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

* no quality

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

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2023-01-12 10:04:05 -05:00
Alexander Matyushentsev
3b05351675 fix: Argo CD doesn't detect the repo type when repository is scoped (#11959)
Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
2023-01-12 07:34:44 +00:00
jannfis
cc2a27ef14 chore: Add K8s v1.26, v1.25 to CI and remove v1.22 (#11957)
* chore: Add K8s v1.26, v1.25 to CI and remove v1.22

Signed-off-by: jannfis <jann@mistrust.net>

* Accommodate for changed error message from K8s 1.25+

Signed-off-by: jannfis <jann@mistrust.net>

Signed-off-by: jannfis <jann@mistrust.net>
2023-01-11 18:47:27 -05:00
Michael Crenshaw
8d262f2585 docs: release cycle refresh (#11137)
* docs: release cycle

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

* remove TODOs

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

* add release champion

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

* formatting

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

* no 2.6 champion yet

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

* fix dates

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

* checklist links

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

* reorg

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

* reuse roadmap doc, add note about Release Champion access requirements

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

* note triage access requirement

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

* release issue template

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

* tweaks

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

* simplify

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

* update dates

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

* add notes for next release champion

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

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2023-01-11 17:12:26 -05:00
dependabot[bot]
88936be9ce chore(deps): bump actions/checkout from 3.2.0 to 3.3.0 (#11895)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3.2.0 to 3.3.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](755da8c3cf...ac59398561)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-11 14:05:56 -05:00
jannfis
1ccaefef1d fix: Explicitly set private key type for GPG key generation (#11944)
Signed-off-by: jannfis <jann@mistrust.net>

Signed-off-by: jannfis <jann@mistrust.net>
2023-01-11 14:03:09 -05:00
reggie-k
913ac509c2 docs: custom health check resource group wildcard (#4212)
Signed-off-by: reggie <reginakagan@gmail.com>

Signed-off-by: reggie <reginakagan@gmail.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2023-01-11 10:05:23 -05:00
Fish-pro
57d01a472c chore: use format to replace fmt in log output (#11854)
Signed-off-by: chen zechun <zechun.chen@daocloud.io>

Signed-off-by: chen zechun <zechun.chen@daocloud.io>
2023-01-10 15:35:12 -05:00
정승원
3c52ce1873 docs: Add M1 Section in cli_installation.md (#11911)
Signed-off-by: Triumph1 <seungwon.jeong@wesang.com>

Signed-off-by: Triumph1 <seungwon.jeong@wesang.com>
Co-authored-by: Triumph1 <seungwon.jeong@wesang.com>
2023-01-10 15:33:39 -05:00
dependabot[bot]
1c6d2806d1 chore(deps): bump actions/setup-node from 3.5.1 to 3.6.0 (#11896)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 3.5.1 to 3.6.0.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](8c91899e58...64ed1c7eab)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-10 15:24:50 -05:00
dependabot[bot]
720858fbbc chore(deps): bump actions/upload-artifact from 3.1.1 to 3.1.2 (#11929)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3.1.1 to 3.1.2.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](83fd05a356...0b7f8abb15)

---
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>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-10 15:20:49 -05:00
Ryan Umstead
cd3fe2d1b1 fix(redis): explicit bind to redis and sentinel for IPv4 clusters (#11388) (#11862)
* fix(redis): explicit bind to redis and sentinel for IPv4 clusters #11388

Signed-off-by: rumstead <rjumstead@gmail.com>

* fix(redis): run manifests generate

Signed-off-by: rumstead <rjumstead@gmail.com>

* fix(redis): run manifests generate

Signed-off-by: rumstead <rjumstead@gmail.com>

* Retrigger CI pipeline

Signed-off-by: rumstead <rjumstead@gmail.com>

Signed-off-by: rumstead <rjumstead@gmail.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2023-01-10 14:01:45 -05:00
Soumya Ghosh Dastidar
e32388066d fix: redact secret data in deep links (#11931)
Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>
2023-01-10 09:36:19 -08:00
Michael Crenshaw
ffff9112da ci: add security warnings for PR workflow (#11803)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2023-01-10 10:54:50 -05:00
Michael Crenshaw
efd3802856 docs: add an example ApplicationSet to document all fields (#11799)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2023-01-10 10:53:40 -05:00
Michael Crenshaw
9923159304 chore: upgrade redis to 7.0.7 to avoid CVE-2022-3996 (#11925)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2023-01-10 10:36:18 -05:00
Alex Eftimie
2f8da71a1b fix: parsed url is not exposed (#11816) (#11916)
* fix: parsed url is not exposed (#11816)

Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>

* subtler fix, thanks @woehrl01

Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>

Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>
2023-01-10 10:32:46 -05:00
Soumya Ghosh Dastidar
7f2dd9e8fc docs: added deep links doc (#11888)
* docs: added deep links doc

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>

* refactor: resolved review comments

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>

* refactor: moved cmp and deep links doc to operator manual

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>

* feat: add warning for templates

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>

* feat: add note for secret data fields being redacted

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>
2023-01-10 10:28:16 -05:00
Michael Crenshaw
fddb06fc54 fix: upgrade qs to avoid CVE-2022-24999 (#11743)
* fix: upgrade qs to avoid CVE-2022-24999

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

* don't explicitly add dependency

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

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2023-01-10 09:27:57 -05:00
dependabot[bot]
abf6d73b0c chore(deps): bump actions/cache from 3.2.0 to 3.2.2 (#11839)
Bumps [actions/cache](https://github.com/actions/cache) from 3.2.0 to 3.2.2.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](c17f4bf466...4723a57e26)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-09 17:11:28 -05:00
dependabot[bot]
983b9ca584 chore(deps): bump actions/download-artifact from 3.0.1 to 3.0.2 (#11894)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 3.0.1 to 3.0.2.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](9782bd6a98...9bc31d5ccc)

---
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>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-09 16:51:54 -05:00
Michael Crenshaw
1cc154f151 chore: better error messages (#11738)
* chore: better error messages

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

* Update util/db/cluster.go

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

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2023-01-09 16:32:27 -05:00
Michael Crenshaw
f6d5c31e98 docs: no longer mark parameter overrides feature as beta (#11673)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2023-01-09 16:32:15 -05:00
Michael Crenshaw
842b55b6ba chore: Verbose release notes (#11144)
* chore: verbose release notes

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

* fix duplication

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

* typo

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

* fix duplication

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

* updates from comments

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

* exclude bot commits

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

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2023-01-09 21:30:22 +00:00
Michael Crenshaw
69b36514e3 docs: note risks of secret-injection plugins (#11617)
* docs: note risks of secret-injection plugins

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

* grammar tweaks

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

* grammar tweaks

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

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2023-01-09 16:29:25 -05:00
Leonardo Luz Almeida
79bcaa6001 fix: web terminal namespace handler (#11891)
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
2023-01-09 16:27:58 -05:00
github-actions[bot]
f6abf72b6c [Bot] docs: Update Snyk reports (#11908)
Signed-off-by: CI <ci@argoproj.com>

Signed-off-by: CI <ci@argoproj.com>
Co-authored-by: CI <ci@argoproj.com>
2023-01-09 09:10:11 -05:00
Alex Eftimie
052a5d2f69 bug: fix url parsing for non git urls (oci://, no protocol etc) (#11819)
Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>
2023-01-06 14:39:58 -08:00
Alex Eftimie
c683ab916b fix: remove other occurrences of externalURLS #11887 (#11889)
Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>
2023-01-06 14:39:10 -08:00
Mahesh Baliga
8ee4387268 feat: inversion selection support for the resource filter on sync and wait app commands (#10548)
Signed-off-by: maheshbaliga <mahesh.baliga@infracloud.io>

Signed-off-by: maheshbaliga <mahesh.baliga@infracloud.io>
2023-01-05 15:52:36 -05:00
Mahesh Baliga
a454093924 feat: set cluster command (#9996)
Signed-off-by: maheshbaliga <mahesh.baliga@infracloud.io>

Signed-off-by: maheshbaliga <mahesh.baliga@infracloud.io>
2023-01-05 09:43:08 -05:00
jiwonaid
35fdd38d10 fix: ui cluster server url overlaps (#11873)
Signed-off-by: Jiwon Kim <jiwonaid0@gmail.com>
Co-authored-by: Remington Breeze <remington@breeze.software>
2023-01-04 19:42:39 +00:00
Alex Eftimie
55da026fd5 fix: Application's own link in UI (#11123) (#11124)
Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>
Co-authored-by: Remington Breeze <remington@breeze.software>
2023-01-04 10:40:51 -08:00
asingh
8f0ef8d326 fix: Applications with suspended jobs now marked "Suspended" instead of "Progressing" (#11603) (#11626)
* fix: add suspended condition

Signed-off-by: ashutosh16 <11219262+ashutosh16@users.noreply.github.com>

* fix: add suspended condition

Signed-off-by: ashutosh16 <11219262+ashutosh16@users.noreply.github.com>

* Update go.sum

Signed-off-by: asingh <11219262+ashutosh16@users.noreply.github.com>

* fix: add suspended condition

Signed-off-by: ashutosh16 <11219262+ashutosh16@users.noreply.github.com>

* fix: add suspended condition

Signed-off-by: ashutosh16 <11219262+ashutosh16@users.noreply.github.com>

* Update go.sum

Signed-off-by: asingh <11219262+ashutosh16@users.noreply.github.com>

* upgrade notes for 2.6

Signed-off-by: ashutosh16 <11219262+ashutosh16@users.noreply.github.com>

Signed-off-by: ashutosh16 <11219262+ashutosh16@users.noreply.github.com>
Signed-off-by: asingh <11219262+ashutosh16@users.noreply.github.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2023-01-03 16:19:43 -05:00
github-actions[bot]
2c1698022b [Bot] docs: Update Snyk reports (#11865)
Signed-off-by: CI <ci@argoproj.com>

Signed-off-by: CI <ci@argoproj.com>
Co-authored-by: CI <ci@argoproj.com>
2023-01-03 16:33:08 +00:00
dependabot[bot]
566d50f633 chore(deps): bump actions/cache from 3.0.11 to 3.2.0 (#11809)
Bumps [actions/cache](https://github.com/actions/cache) from 3.0.11 to 3.2.0.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](9b0c1fce7a...c17f4bf466)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-22 13:38:26 -05:00
Michael Crenshaw
50b6577345 fix: web terminal outside argocd namespace (#11166) (#11400)
* fix: web terminal outside argocd namespace (#11166)

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

* reorganize

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

* fix reference

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

* move things around, fix stuff maybe

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

* tests

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

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2022-12-22 13:28:53 -05:00
Michael Crenshaw
43c928e2e5 ci: enforce semantic PR title (#11779)
* ci: enforce semantic PR title

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

* concurrency limit

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

* remove scopes

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

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2022-12-21 19:35:03 +00:00
Ishita Sequeira
825a0f3aba fix: disable rollback button for apps with multiple sources (#11785)
* disble rollback button for apps with multiple sources

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

* fix lint errors

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

* disble rollback button for apps with multiple sources

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

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>
2022-12-21 12:37:24 -05:00
Chris Reilly
ec95d12d9f docs: Update bullet formatting on Progressive Rollouts.md (#11777)
The bullet list in the example format was rendering inline in the paragraph on the doc site rather than showing a bulleted list. This also makes the rest of the doc follow the same convention. 

Signed-off-by: Chris Reilly <chris@chris-reilly.com>

Signed-off-by: Chris Reilly <chris@chris-reilly.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>
2022-12-21 08:52:10 -05:00
Ishita Sequeira
05ab30ebe1 fix: set Path as empty if path is not specified for a source in multiple sources (#11756) (#11774)
* set Path as '' if path is not specified for a source in multiple sources

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

* update check for not setting value of path

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

* cleanup

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

* address comments

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

* fix lint

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

* fix lint

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

* Update ui/src/app/shared/components/revision.tsx

Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Signed-off-by: Ishita Sequeira <46771830+ishitasequeira@users.noreply.github.com>

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>
Signed-off-by: Ishita Sequeira <46771830+ishitasequeira@users.noreply.github.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2022-12-21 08:44:52 -05:00
dependabot[bot]
82a1e554d5 chore(deps): bump github.com/aws/aws-sdk-go from 1.44.156 to 1.44.164 (#11791)
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.44.156 to 1.44.164.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.44.156...v1.44.164)

---
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>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-21 08:44:14 -05:00
dependabot[bot]
ed4e80c95d chore(deps): bump golang.org/x/term from 0.1.0 to 0.3.0 (#11792)
Bumps [golang.org/x/term](https://github.com/golang/term) from 0.1.0 to 0.3.0.
- [Release notes](https://github.com/golang/term/releases)
- [Commits](https://github.com/golang/term/compare/v0.1.0...v0.3.0)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-21 08:42:42 -05:00
Justin Marquis
bb33e8ca76 chore: fix lint error (#11788)
Signed-off-by: Justin Marquis <34fathombelow@protonmail.com>

Signed-off-by: Justin Marquis <34fathombelow@protonmail.com>
2022-12-21 08:13:27 -05:00
Justin Marquis
a50a67e2ad chore: get image digest in seperate step (#11778)
* chore: get image digest in seperate step

Signed-off-by: Justin Marquis <34fathombelow@protonmail.com>

* Retrigger CI pipeline

Signed-off-by: Justin Marquis <34fathombelow@protonmail.com>

Signed-off-by: Justin Marquis <34fathombelow@protonmail.com>
2022-12-20 17:21:45 -05:00
dependabot[bot]
f8bc471801 chore(deps): bump github.com/fsnotify/fsnotify from 1.5.1 to 1.6.0 (#11553)
Bumps [github.com/fsnotify/fsnotify](https://github.com/fsnotify/fsnotify) from 1.5.1 to 1.6.0.
- [Release notes](https://github.com/fsnotify/fsnotify/releases)
- [Changelog](https://github.com/fsnotify/fsnotify/blob/main/CHANGELOG.md)
- [Commits](https://github.com/fsnotify/fsnotify/compare/v1.5.1...v1.6.0)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-20 18:17:09 +00:00
Gaël Jourdan-Weil
58ce42b824 docs: clarify project destination possibilities (#11706)
Clarify that it's possible to reference clusters by `cluster` or by `name`.

Signed-off-by: Gaël Jourdan-Weil <gjourdanweil@gmail.com>

Signed-off-by: Gaël Jourdan-Weil <gjourdanweil@gmail.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2022-12-20 12:51:41 -05:00
toyamagu
66d2f1e962 fix: sources.ref allow hyphen and underscore (#11775)
Signed-off-by: toyamagu2021@gmail.com <toyamagu2021@gmail.com>

Signed-off-by: toyamagu2021@gmail.com <toyamagu2021@gmail.com>
2022-12-20 12:50:07 -05:00
Nicholas Morey
3d79487e85 fix: support for enabling progressive rollouts from argocd-cmd-params-cm (#11776)
* fix(applicationset): use consistent syntax for env vars

Signed-off-by: Nicholas Morey <nicholas@morey.tech>

* fix(manifests): add new appset env var from configmap

Signed-off-by: Nicholas Morey <nicholas@morey.tech>

Signed-off-by: Nicholas Morey <nicholas@morey.tech>
2022-12-20 12:46:13 -05:00
Ishita Sequeira
0c5d4d8500 chore: change logging level to Debug (#11773)
Signed-off-by: ishitasequeira <ishiseq29@gmail.com>

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>
2022-12-20 11:37:39 -05:00
toyamagu
f65e0b52f5 docs: bump elasticsearch version to 8.5.1 (#11771)
Signed-off-by: toyamagu2021@gmail.com <toyamagu2021@gmail.com>

Signed-off-by: toyamagu2021@gmail.com <toyamagu2021@gmail.com>
2022-12-20 10:19:47 -05:00
dependabot[bot]
d7baab244f chore(deps): bump github.com/itchyny/gojq from 0.12.9 to 0.12.10 (#11677)
Bumps [github.com/itchyny/gojq](https://github.com/itchyny/gojq) from 0.12.9 to 0.12.10.
- [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.9...v0.12.10)

---
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>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-20 14:57:43 +00:00
Matt Clegg
231fab4e58 docs: correct SSO configuration URL in example configmap (#11720)
Signed-off-by: Matt Clegg <m@cle.gg>

Signed-off-by: Matt Clegg <m@cle.gg>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2022-12-20 08:57:00 -05:00
Phil Wright- Christie
b2bdbedc6a docs: Update example dockerfile (#11721)
The latest tag hasn't been updated in almost a year, and as a result, the ubuntu repositories are out of date and are throwing errors. This updates the example to use a fixed version, which are updated much more frequently.

Signed-off-by: Phil Wright- Christie <philwc@gmail.com>

Signed-off-by: Phil Wright- Christie <philwc@gmail.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2022-12-20 08:54:27 -05:00
Leonardo Luz Almeida
72c3d0fa58 fix: ssa e2e tests failing after updating to kubectl 1.26 (#11753)
* fix: ssa e2e test failing after updating to kubectl 1.26

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

* Remove pinned kubectl version

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

* Cleaner approach to fix e2e test

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

* Fix

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

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
2022-12-20 08:48:55 -05:00
Nicholas Morey
68d1a6f3d6 docs: clarify that all labels must exist (#11693)
It's unclear if all or any of the labels need to exist. This clarifies that all of the labels must exist.

Signed-off-by: Nicholas Morey <nicholas@morey.tech>

Signed-off-by: Nicholas Morey <nicholas@morey.tech>
2022-12-20 08:45:55 -05:00
Balaji Siva
9e392fa432 chore: add OpsMx to USERS.md (#11765)
adding our company name to Argo CD users.

Signed-off-by: Balaji Siva <balaji@opsmx.com>

Signed-off-by: Balaji Siva <balaji@opsmx.com>
2022-12-20 08:43:45 -05:00
dependabot[bot]
852f62c484 chore(deps): bump actions/setup-go from 3.4.0 to 3.5.0 (#11697)
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 3.4.0 to 3.5.0.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](d0a58c1c4d...6edd4406fa)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-20 08:40:33 -05:00
yanyx
8df3c19301 doc: correct kustomize demo path (#11762)
Signed-off-by: Yixing Yan <yixingyan@gmail.com>

Signed-off-by: Yixing Yan <yixingyan@gmail.com>
2022-12-20 08:37:35 -05:00
Justin Marquis
1d885b7eea fix: sign container images by digest (#11151)
* chore: sign container images by digest

Signed-off-by: Justin Marquis <34fathombelow@protonmail.com>

* use sha hash

Signed-off-by: Justin Marquis <34fathombelow@protonmail.com>

Signed-off-by: Justin Marquis <34fathombelow@protonmail.com>
2022-12-19 20:44:41 -05:00
Michael Crenshaw
1ad91259bd chore: upgrade go-oidc (#11579)
* chore: upgrade go-oidc

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

* take advantage of new error type

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

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2022-12-19 16:31:23 -05:00
Leonardo Luz Almeida
cb467bc231 chore: add kustomize project for testing param CMP locally (#11265)
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
2022-12-19 11:29:43 -05:00
Michael Crenshaw
234e44aaad chore: upgrade minimatch to avoid CVE-2022-3517 (#11745)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2022-12-19 11:25:40 -05:00
Michael Crenshaw
5bffa7b1ca chore: upgrade git-url-parse to avoid CVE-2022-2900 (#11744)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2022-12-19 11:25:34 -05:00
Justin Marquis
0dad6c9321 docs: update cosign docs (#11749)
Signed-off-by: Justin Marquis <34fathombelow@protonmail.com>

Signed-off-by: Justin Marquis <34fathombelow@protonmail.com>
2022-12-19 11:18:01 -05:00
wmgroot
cf7eb6aecb docs: add appset progressive rollout strategy proposal (#9979)
Signed-off-by: wmgroot <wmgroot@gmail.com>

Signed-off-by: wmgroot <wmgroot@gmail.com>
2022-12-19 10:57:36 -05:00
github-actions[bot]
7a7636d61d [Bot] Update Snyk reports (#11748)
Signed-off-by: CI <ci@argoproj.com>

Signed-off-by: CI <ci@argoproj.com>
Co-authored-by: CI <ci@argoproj.com>
2022-12-19 08:45:29 -05:00
Thomas Schuetz
0864a0212f feat: add health checks for keptn resources (#11716)
* feat: add keptnappversion

Signed-off-by: Thomas Schuetz <thomas.schuetz@dynatrace.com>

* feat: added keptn resource tests

Signed-off-by: Thomas Schuetz <thomas.schuetz@dynatrace.com>

* feat: fix test for KeptnWorkloadInstance

Signed-off-by: Thomas Schuetz <thomas.schuetz@dynatrace.com>

* fix: apiVersion and quotes

Signed-off-by: Thomas Schuetz <thomas.schuetz@dynatrace.com>

Signed-off-by: Thomas Schuetz <thomas.schuetz@dynatrace.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2022-12-17 00:33:20 +00:00
Jellyfrog
c4f6ed857d feat: Extend Cluster.cluster.x-k8s.io health check (#11705)
Signed-off-by: Jellyfrog <Jellyfrog@users.noreply.github.com>

Signed-off-by: Jellyfrog <Jellyfrog@users.noreply.github.com>
2022-12-16 18:01:43 -05:00
wei
2f16fcad6e feat: support Knative Serving 1.5 Custom Health Checks (#9719)
* fix: Update account.proto annotaion for gen grpc gateway

Signed-off-by: wei840222 <wei840222@gmail.com>

* fix: Changes from codegen

Signed-off-by: wei840222 <wei840222@gmail.com>

* Retrigger CI pipeline

Signed-off-by: wei.wan <wei.wan@linecorp.com>

* Retrigger CI pipeline

Signed-off-by: wei.wan <wei.wan@linecorp.com>

* fix: Changes from codegen

Signed-off-by: wei <wei840222@gmail.com>

* Retrigger CI pipeline

Signed-off-by: wei.wan <wei.wan@linecorp.com>

* Retrigger CI pipeline

Signed-off-by: wei <wei840222@gmail.com>

* feat: support Knative Serving 1.5 Custom Health Checks

Signed-off-by: wei.wan <wei.wan@linecorp.com>

* fix: fix test fail

Signed-off-by: wei.wan <wei.wan@linecorp.com>

* feat: support Knative Serving 1.5 Custom Health Checks

Signed-off-by: wei840222 <wei840222@gmail.com>

Signed-off-by: wei840222 <wei840222@gmail.com>
Signed-off-by: wei.wan <wei.wan@linecorp.com>
Signed-off-by: wei <wei840222@gmail.com>
Co-authored-by: wei.wan <wei.wan@linecorp.com>
2022-12-16 17:54:46 -05:00
github-actions[bot]
2b1f00dd4e [Bot] Update Snyk reports (#11739)
Signed-off-by: CI <ci@argoproj.com>

Signed-off-by: CI <ci@argoproj.com>
Co-authored-by: CI <ci@argoproj.com>
2022-12-16 17:53:06 -05:00
wmgroot
ec4e2f26d5 feat: AppSet Progressive Rollouts with RollingSync (#9437) (#10048)
Signed-off-by: Matt Groot <mgroot@indeed.com>

Signed-off-by: Matt Groot <mgroot@indeed.com>
Co-authored-by: Matt Groot <mgroot@indeed.com>
2022-12-16 22:11:58 +00:00
Ishita Sequeira
c6fa942e94 feat: Multiple sources for applications (#2789) (#10432)
* feat: support multiple sources for application

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

remove debug logging and unwanted code

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

fix lint and unit test errors

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

fix lint and unit test errors

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

* fix bug introduced after rebase

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

executed make codegen

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

* rebase with master

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

remove unwanted logging

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

fix ci failures

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

* fix index out of bounds error

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

* ui fixes

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>
Signed-off-by: Michael Crenshaw <michael@crenshaw.dev>
Signed-off-by: ishitasequeira <ishiseq29@gmail.com>

* add revisions to SyncOperation for rollback

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

* change Source to *ApplicationSource in ApplicationSpec

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

* fix env variable read logic for ValueFiles

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

* update multiple sources doc

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

* add repository lock and checkout target revision

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

fix codegen

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

* checkout all sources before generating manifest

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

generate mock reposerverclient

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

* update logic for returning ManifestResponse to avoid nil pointer issues

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

* fix nil reference and key mismatch bugs; add more logs (#6)

* fix nil reference and key mismatch bugs; add more logs
* remove temporary comment
* addressed the lint failure and added chart to RefTargeRevisionMapping
* normalize git repo (#7)
* do not leak lock releases
* prevent deadlock
* allow spec update
* move settings fetch outside loop
* cache busing
* return err instead of logging it
* no caching in test
* fix cache key marshaling

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

Rebase with master

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

* update grpc field numbers

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

* path resolution tests (#12)

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

do things in better ways

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

consolidate

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

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

* add regex check for value of source.ref

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

* add webhook tests

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

change Source to *ApplicationSource in ApplicationSpec

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

address PR comments

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

rebase with master

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

Retrigger CI pipeline

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

rebased with master

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

* fix env variable read logic for ValueFiles

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

Address PR comments

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

* add repository lock and checkout target revision

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

fix codegen

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

* checkout all sources before generating manifest

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

* generate mock reposerverclient

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

* address comments

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

* update logic for returning ManifestResponse to avoid nil pointer issues

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

* fix nil reference and key mismatch bugs; add more logs (#6)

* fix nil reference and key mismatch bugs; add more logs
* remove temporary comment
* addressed the lint failure and added chart to RefTargeRevisionMapping
* normalize git repo (#7)
* do not leak lock releases
* prevent deadlock
* allow spec update
* move settings fetch outside loop
* cache busing
* return err instead of logging it
* no caching in test
* fix cache key marshaling

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

Rebase with master

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

* update grpc field numbers

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

* add regex check for value of source.ref

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

* Rebase with master

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

* Added unit tests (#15)

* add unit tests 1
* fix lint

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

* fix application parameters tab, rebased UI changes, tests

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

* More tests (#16)

* more tests

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

fix lint error

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

Test get ref sources (#17)

* test GetRefSources

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>

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

GenerateManifests test (#18)

* GenerateManifests test

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

Fix broken tests (#19)

* fix broken tests

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

Symlink test (#20)

* check referenced sources for out-of-bounds symlinks

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

* unlock the values file repo before doing a symlink check (#22)

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

* multi source docs (#21)

* multi source docs

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

* fix warning title

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>

* add e2e tests for multiple sources and fix UI lint (#23)

* add e2e tests for multiple sources and fix UI lint

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

* add auto-sync and hard refresh to e2e tests

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

* change refresh type to RefreshTypeNormal for e2e

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

* update e2e testcase with helm data

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

* add TestMultiSourceAppWithSourceOverride

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

* add missing yaml file

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

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

* rebase with master

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

* rebase with master

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

* fix lint

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

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>
Signed-off-by: Michael Crenshaw <michael@crenshaw.dev>
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2022-12-16 15:47:08 -05:00
jannfis
66a1e40e39 docs: Document applications in any namespace (#10678)
* docs: Document applications in any namespace

Signed-off-by: jannfis <jann@mistrust.net>

* Fix some code blocks

Signed-off-by: jannfis <jann@mistrust.net>

* Fix link

Signed-off-by: jannfis <jann@mistrust.net>

* docs: Document applications in any namespace

Signed-off-by: jannfis <jann@mistrust.net>

* Fix some code blocks

Signed-off-by: jannfis <jann@mistrust.net>

* Fix link

Signed-off-by: jannfis <jann@mistrust.net>

* Apply reviewer comments

Signed-off-by: jannfis <jann@mistrust.net>

Signed-off-by: jannfis <jann@mistrust.net>
2022-12-16 14:41:38 -05:00
Alex Eftimie
a2d756e4ac feat: add google cloud source repo support (#7534) (#11618)
* feat: Add support for cloning Google Cloud Source repos (#7534)

* Google Cloud service account auth

Signed-off-by: David Becher <becher.david@googlemail.com>

* fix: Fill missing struct field (GCP SA key) in cli cmd

Signed-off-by: David Becher <becher.david@googlemail.com>

* fix(ui): Add proxy option when configuring Google Cloud Source repo

Signed-off-by: David Becher <becher.david@googlemail.com>

* fix: Remove secret (GCP SA key) in Get server req

Signed-off-by: David Becher <becher.david@googlemail.com>

* refactor: Do not use context.WithTimeout for Google creds

As the context is used in the background to refresh credentials, it
should not be cancelled.

Signed-off-by: David Becher <becher.david@googlemail.com>

* fix: Use proxy setting only in repo-service, not repocreds-service

Signed-off-by: David Becher <becher.david@googlemail.com>

* test: Create tests for GoogleCloudCreds

This commit refactors the implementation of GoogleCloudCreds in order to
make its methods testable.

Signed-off-by: David Becher <becher.david@googlemail.com>

* fix: Linting issues

Signed-off-by: David Becher <becher.david@googlemail.com>

* chore: Fix typo in docs.

Signed-off-by: David Becher <becher.david@googlemail.com>

* chore: Adjust url-allow-list for lint-docs action

Signed-off-by: David Becher <becher.david@googlemail.com>

* chore: Incorporate suggested refactorings

Signed-off-by: David Becher <becher.david@googlemail.com>

* Delete url-allow-list

Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>

* wrap errors

Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>

* More UI goodies and codegen

Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>

* Update docs screenshots

Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>

* move interface up next to other interfaces

Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>

* Reduce png size

Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>

* update generated

Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>

* fix whitespace from codegen

Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>

Signed-off-by: David Becher <becher.david@googlemail.com>
Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>
Co-authored-by: David Becher <becher.david@googlemail.com>
2022-12-16 17:07:26 +00:00
hopisaurus
46975dac36 chore: add Voyager Digital to USERS.md (#11735)
Signed-off-by: hopisaurus <hopisaurus@gmail.com>

Signed-off-by: hopisaurus <hopisaurus@gmail.com>
2022-12-16 16:59:53 +00:00
Detlev V
a89e489316 fix: support relative links in OCI tags query response (#11708)
* fix: support relative links in OCI tags query response

Pagination for OCI tags retrieval is not supported when the
Link header URI is relative.
According to https://docs.docker.com/registry/spec/api/#pagination
and the therein referenced RFC
https://www.rfc-editor.org/rfc/rfc5988#section-5
relative links should be resolved to the initial request URL

Signed-off-by: detvdl <detvdael.services@protonmail.com>

* chore: clean up unused prints & assert errors

Signed-off-by: detvdl <detvdael.services@protonmail.com>

* fix: stop double-escaping repoURL

Signed-off-by: detvdl <detvdael.services@protonmail.com>

* chore: CodeQL CWE-117 log sanitizing

Signed-off-by: detvdl <detvdael.services@protonmail.com>

* chore: remove unnecessary error

Signed-off-by: detvdl <detvdael.services@protonmail.com>

Signed-off-by: detvdl <detvdael.services@protonmail.com>
2022-12-16 16:01:34 +00:00
jannfis
396f5a2186 fix: Unbreak termination of operation with apps in other namespaces (#11239) (#11724)
* fix: Unbreak operation termination

Signed-off-by: jannfis <jann@mistrust.net>

* Revert change to Dockerfile

Signed-off-by: jannfis <jann@mistrust.net>

Signed-off-by: jannfis <jann@mistrust.net>
2022-12-16 09:26:16 -05:00
Justin Marquis
daf547407e chore: upgrade helm to most recent version (v3.10.3) (#11725)
* chore: upgrade helm to most recent version (v3.10.3)

Signed-off-by: Justin Marquis <34fathombelow@protonmail.com>

* Retrigger CI pipeline

Signed-off-by: Justin Marquis <34fathombelow@protonmail.com>

Signed-off-by: Justin Marquis <34fathombelow@protonmail.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2022-12-16 09:22:51 -05:00
Takuma Kume
9fe4ad3253 feat: ApplicationSet add create-delete policy #9101 (#11107)
* feat: ApplicationSet add create-delete policy

Signed-off-by: 久米 拓馬 <takuma.kume@pepabo.com>

* test for applicationSet policies

Signed-off-by: 久米 拓馬 <takuma.kume@pepabo.com>

* Update docs/operator-manual/applicationset/Controlling-Resource-Modification.md

Co-authored-by: Mubarak Jama <83465122+mubarak-j@users.noreply.github.com>
Signed-off-by: Takuma Kume <takuma.kume@gmail.com>

Signed-off-by: 久米 拓馬 <takuma.kume@pepabo.com>
Signed-off-by: Takuma Kume <takuma.kume@gmail.com>
Co-authored-by: Mubarak Jama <83465122+mubarak-j@users.noreply.github.com>
2022-12-16 09:05:15 -05:00
Matthew Bennett
ed0273039d feat: Allow Matrix generator to have two Git child generators without conflict (#10522) (#10523)
* misc: NoError instead of Error in repository test
Signed-off-by: Lobstrosity <matthew.t.bennett@gmail.com>

* misc: Extend lint timeout
Signed-off-by: Lobstrosity <matthew.t.bennett@gmail.com>

* feat: Add GitGenerator.PathParamPrefix
Signed-off-by: Lobstrosity <matthew.t.bennett@gmail.com>

* auto: Results of codegen
Signed-off-by: Lobstrosity <matthew.t.bennett@gmail.com>

* test: Add tests for PathParamPrefix
Signed-off-by: Lobstrosity <matthew.t.bennett@gmail.com>

* docs: Add notes to Matrix/Git generator docs about PathParamPrefix
Signed-off-by: Lobstrosity <matthew.t.bennett@gmail.com>

* misc: Undo unrelated test change
Signed-off-by: Lobstrosity <matthew.t.bennett@gmail.com>

* auto: Results of codegen
Signed-off-by: Lobstrosity <matthew.t.bennett@gmail.com>

* docs: Add detailed example
Signed-off-by: Lobstrosity <matthew.t.bennett@gmail.com>

Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2022-12-16 09:04:44 -05:00
Nandita
9decefe1d6 chore: Add Cloud Scale to USERS.md (#11731)
* Update USERS.md

Add cloud scale 

Signed-off-by: Nandita <105474264+nandita-cloudscaleinc@users.noreply.github.com>

* Update USERS.md

Signed-off-by: Nandita <105474264+nandita-cloudscaleinc@users.noreply.github.com>

* Update USERS.md

Signed-off-by: Nandita <105474264+nandita-cloudscaleinc@users.noreply.github.com>

* Update USERS.md

Signed-off-by: Nandita <105474264+nandita-cloudscaleinc@users.noreply.github.com>

* Update USERS.md

Signed-off-by: Nandita <105474264+nandita-cloudscaleinc@users.noreply.github.com>

Signed-off-by: Nandita <105474264+nandita-cloudscaleinc@users.noreply.github.com>
2022-12-16 08:34:45 -05:00
Leonardo Luz Almeida
1730e4bf4f docs: Clarification of the create namespace feature (#11723)
* docs: Clarification of the create namespace feature

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

* Address review suggestion

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

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
2022-12-16 03:29:20 +00:00
Michael Crenshaw
4f7a7f6a1b fix: pin kubectl version (#11726)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2022-12-15 20:08:52 -05:00
Alex Eftimie
358088ae1d fix: rollback react to known working version (#11703)
Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>

Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>
2022-12-14 14:06:42 +00:00
Alex Eftimie
3dcab562e2 chore: Add Getyourguide to USERS.md (#11704)
Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>

Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>
2022-12-14 08:06:37 -05:00
Remington Breeze
22e62fe173 feat: expose deep links in UI (#11680)
Signed-off-by: Remington Breeze <remington@breeze.software>
2022-12-13 21:07:39 +00:00
Michael Crenshaw
d29c07beaf chore: fix flaky e2e test for immutable fields (#11685)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2022-12-13 15:23:00 -05:00
schakrad
ac009c4860 fix: add pod age icon details in tooltip (#10290) (#11170)
* pod-age-icon details added in tooltip

Signed-off-by: schakradari <58915923+schakrad@users.noreply.github.com>

* Tooltip change

Signed-off-by: schakradari <58915923+schakrad@users.noreply.github.com>

Signed-off-by: schakradari <58915923+schakrad@users.noreply.github.com>
2022-12-13 09:45:49 -05:00
asingh
586c00d689 fix: appname in searchbar (#11493)
* fix: appname in searchbar

Signed-off-by: ashutosh16 <11219262+ashutosh16@users.noreply.github.com>

* fix: appname in searchbar

Signed-off-by: ashutosh16 <11219262+ashutosh16@users.noreply.github.com>

Signed-off-by: ashutosh16 <11219262+ashutosh16@users.noreply.github.com>
2022-12-13 09:35:04 -05:00
Marco Lecheler
f4c05ae94c chore: add Mercedes-Benz Tech Innovation to user list (#11682)
Signed-off-by: Marco Lecheler <marco.lecheler@mercedes-benz.com>

Signed-off-by: Marco Lecheler <marco.lecheler@mercedes-benz.com>
2022-12-13 09:29:44 -05:00
dependabot[bot]
c4c6bfad16 chore(deps): bump actions/checkout from 3.1.0 to 3.2.0 (#11679)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3.1.0 to 3.2.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](93ea575cb5...755da8c3cf)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-13 08:24:45 -05:00
dependabot[bot]
4431ace96a chore(deps): bump github.com/ktrysmt/go-bitbucket from 0.9.54 to 0.9.55 (#11678)
Bumps [github.com/ktrysmt/go-bitbucket](https://github.com/ktrysmt/go-bitbucket) from 0.9.54 to 0.9.55.
- [Release notes](https://github.com/ktrysmt/go-bitbucket/releases)
- [Commits](https://github.com/ktrysmt/go-bitbucket/compare/v0.9.54...v0.9.55)

---
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>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-13 04:09:49 +00:00
Soumya Ghosh Dastidar
99b222ce39 feat: show cmpv2 plugins in create app wizard (#11615)
* feat: show cmpv2 plugins in create app wizard

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>

* fix: fixed doc formatting and sidecar plugin info

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>

* feat: updated plugin info

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>
2022-12-12 18:31:06 -08:00
github-actions[bot]
95c95cf9e6 [Bot] Update Snyk reports (#11649)
Signed-off-by: CI <ci@argoproj.com>

Signed-off-by: CI <ci@argoproj.com>
Co-authored-by: CI <ci@argoproj.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2022-12-12 20:57:19 -05:00
Michael Crenshaw
627b91ef0e chore: fix flaky e2e test (#11670)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2022-12-12 17:33:58 -05:00
dependabot[bot]
ea7a264508 chore(deps-dev): bump @types/cookie from 0.3.3 to 0.5.1 in /ui (#11659)
Bumps [@types/cookie](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/cookie) from 0.3.3 to 0.5.1.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/cookie)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-12 22:33:20 +00:00
Michael Crenshaw
be50b1d9af chore: downgrade React to v17 (#11653)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2022-12-12 16:40:39 -05:00
Michael Crenshaw
9b6a34260d chore: fix flaky e2e test (#11509) (#11654)
* chore: fix flaky e2e test (#11509)

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

* don't centralize mock response - tests should be independent

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

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2022-12-12 12:14:00 -05:00
dependabot[bot]
cac7ad9917 chore(deps): bump github.com/casbin/casbin/v2 from 2.59.0 to 2.60.0 (#11656)
Bumps [github.com/casbin/casbin/v2](https://github.com/casbin/casbin) from 2.59.0 to 2.60.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.59.0...v2.60.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>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-12 09:21:02 -05:00
Mahesh Baliga
2fef0dee73 feat: pull request labels exposed in Pull Request generator template (#10204) (#11397)
Signed-off-by: maheshbaliga <mahesh.baliga@infracloud.io>

Signed-off-by: maheshbaliga <mahesh.baliga@infracloud.io>
2022-12-12 09:17:28 -05:00
Nicholas Morey
85ea242ea7 docs: kustomize has access to build environment (#11643)
Current docs reflect that the build environment is not available to kustomize. Since https://github.com/argoproj/argo-cd/pull/8096 it is now exposed for kustomize. This updates the kustomize section of the docs to reflect that.

Signed-off-by: Nicholas Morey <nicholas@morey.tech>

Signed-off-by: Nicholas Morey <nicholas@morey.tech>
2022-12-11 15:58:16 -05:00
dependabot[bot]
9832ce8fa7 chore(deps): bump express from 4.17.1 to 4.18.2 in /ui (#11591)
Bumps [express](https://github.com/expressjs/express) from 4.17.1 to 4.18.2.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/master/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.17.1...4.18.2)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-11 15:58:00 -05:00
dependabot[bot]
550b6732e5 chore(deps-dev): bump tslint-react from 3.6.0 to 5.0.0 in /ui (#11559)
Bumps [tslint-react](https://github.com/palantir/tslint-react) from 3.6.0 to 5.0.0.
- [Release notes](https://github.com/palantir/tslint-react/releases)
- [Commits](https://github.com/palantir/tslint-react/compare/3.6.0...5.0.0)

---
updated-dependencies:
- dependency-name: tslint-react
  dependency-type: direct:development
  update-type: version-update:semver-major
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-11 15:52:19 -05:00
dependabot[bot]
11fde44428 chore(deps): bump react-paginate from 6.5.0 to 8.1.4 in /ui (#11558)
Bumps [react-paginate](https://github.com/AdeleD/react-paginate) from 6.5.0 to 8.1.4.
- [Release notes](https://github.com/AdeleD/react-paginate/releases)
- [Changelog](https://github.com/AdeleD/react-paginate/blob/master/CHANGELOG.md)
- [Commits](https://github.com/AdeleD/react-paginate/compare/v6.5.0...v8.1.4)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-11 15:51:26 -05:00
Blake Pettersson
eb576a5f3e feat: add deny sources (#11639) (#11646)
This commit adds the ability to deny a source when it is prefixed with
`!`, in the same manner as with the "deny destinations" feature.

Fixes #11639.

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

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
2022-12-11 15:48:09 -05:00
Nicholas Morey
b4c12815f0 docs: fix web terminal step list numbering (#11590)
docs: fix web terminal step list numbering (#11590)
Signed-off-by: Nicholas Morey <nicholas@morey.tech>
2022-12-09 23:12:14 +00:00
Alexander Matyushentsev
42911db31a fix: Unknown sync operation state on app list page (#11621)
fix: Unknown sync operation state on app list page (#11621)

Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
2022-12-09 21:47:59 +00:00
Justin Marquis
f0359fbd78 chore: Bump version in master to 2.6.0 (#11641)
Signed-off-by: Justin Marquis <34fathombelow@protonmail.com>

Signed-off-by: Justin Marquis <34fathombelow@protonmail.com>
2022-12-09 19:16:37 +00:00
asingh
fba9154ab2 docs: add warning for user when using replace sync option (#11566)
* docs: adding warning to 'replace' sync option

Signed-off-by: ashutosh16 <11219262+ashutosh16@users.noreply.github.com>

* Update sync-options.md

Signed-off-by: asingh <11219262+ashutosh16@users.noreply.github.com>

Signed-off-by: ashutosh16 <11219262+ashutosh16@users.noreply.github.com>
Signed-off-by: asingh <11219262+ashutosh16@users.noreply.github.com>
2022-12-09 14:01:03 -05:00
Roger Rumao
9f2523b46d includeKinds for APIVersions in cluster info cache (#11241)
Signed-off-by: Roger Rumao <rogerrum@gmail.com>

Signed-off-by: Roger Rumao <rogerrum@gmail.com>
2022-12-09 12:56:18 -05:00
Leonardo Luz Almeida
f80d3bee84 feat: Add support for proxy extensions (#11307)
* feat: Add support for proxy extensions

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

* return list of extensions

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

* add service set in argocd server struct

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

* implements cluster name lookup

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

* add cli docs

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

* apply connection config defaults

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

* add unit tests

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

* fix lint

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

* fix test

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

* Address review comments

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

* Add test for invalid extension name

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

* Address review comments

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

* Fix deadcode lint

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

* Fix unused lint

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

* Fix deadcode lint

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

* Better error message

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

* Fix deadcode lint

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

* Fix empty branch

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

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
2022-12-09 12:02:55 -05:00
dependabot[bot]
9dab4f659d chore(deps): bump github.com/aws/aws-sdk-go from 1.44.129 to 1.44.156 (#11629)
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.44.129 to 1.44.156.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.44.129...v1.44.156)

---
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>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-09 10:02:22 -05:00
Marco Lecheler
07c0ee55ba fix: only add baseURL in github_app client for GHE client (#11622)
fixes #11613

Co-authored-by: crenshaw-dev <crenshaw-dev@users.noreply.github.com>
Signed-off-by: Marco Lecheler <marco.lecheler@mercedes-benz.com>

Signed-off-by: Marco Lecheler <marco.lecheler@mercedes-benz.com>
Co-authored-by: crenshaw-dev <crenshaw-dev@users.noreply.github.com>
2022-12-08 17:32:39 -05:00
Marco Lecheler
a3a3e8d65d fix: set baseURL in github_app client (#11613)
Signed-off-by: Marco Lecheler <marco.lecheler@mercedes-benz.com>

Signed-off-by: Marco Lecheler <marco.lecheler@mercedes-benz.com>
2022-12-08 10:28:46 -05:00
Cuong Nguyen Duc
4462debe28 chore: add Trusting Social users list (#11584)
* Add Trusting Social user

Signed-off-by: Cuong Nguyen Duc <90603605+cuong-ts@users.noreply.github.com>

* fixing other

Signed-off-by: Cuong Nguyen Duc <90603605+cuong-ts@users.noreply.github.com>
2022-12-08 09:24:04 -05:00
dependabot[bot]
9ceef4a1a1 chore(deps): bump github.com/casbin/casbin/v2 from 2.57.1 to 2.59.0 (#11607)
Bumps [github.com/casbin/casbin/v2](https://github.com/casbin/casbin) from 2.57.1 to 2.59.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.57.1...v2.59.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>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-08 09:14:23 -05:00
dependabot[bot]
74798a68e3 chore(deps): bump github.com/go-redis/redis/v8 from 8.11.3 to 8.11.5 (#11606)
Bumps [github.com/go-redis/redis/v8](https://github.com/go-redis/redis) from 8.11.3 to 8.11.5.
- [Release notes](https://github.com/go-redis/redis/releases)
- [Changelog](https://github.com/go-redis/redis/blob/v8.11.5/CHANGELOG.md)
- [Commits](https://github.com/go-redis/redis/compare/v8.11.3...v8.11.5)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-08 09:13:48 -05:00
dependabot[bot]
6c5da3f60b chore(deps): bump github.com/Masterminds/semver/v3 from 3.1.1 to 3.2.0 (#11605)
Bumps [github.com/Masterminds/semver/v3](https://github.com/Masterminds/semver) from 3.1.1 to 3.2.0.
- [Release notes](https://github.com/Masterminds/semver/releases)
- [Changelog](https://github.com/Masterminds/semver/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Masterminds/semver/compare/v3.1.1...v3.2.0)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-08 09:12:29 -05:00
Soumya Ghosh Dastidar
661afe0ad9 feat: added deep links backend changes (#11401)
* feat: added deep links backend changes

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>

* fix: add rbac check to list links services

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>

* feat: removed project param and updated sample config

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>

* feat: update sample config

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>
2022-12-07 11:39:45 -08:00
Alex Eftimie
30e37b7bb4 fix: misc css fixes for mobile (#5705) (#11508)
* Misc css fixes for mobile

Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>

* More fixes for mobile

Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>

* fix ui tests. bring back application status labels

Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>

Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>
2022-12-07 12:57:26 -05:00
Alex Eftimie
13dd04fa71 fix(helm): login OCI Helm dependencies correctly (#8563) (#11327)
Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>

Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>
2022-12-07 12:42:10 -05:00
Alex Eftimie
6ecd70ae74 fix(helm): helm v3 doesn't have these flags (#11100) (#11540)
* fix: helm v3 doesn't have these flags

Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>

* Revert repoAdd change. Was to greedy, ca-file is needed there

Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>

Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>
2022-12-07 12:41:43 -05:00
dependabot[bot]
c9f54652ba chore(deps): bump github.com/go-openapi/loads from 0.19.4 to 0.21.2 (#11569)
Bumps [github.com/go-openapi/loads](https://github.com/go-openapi/loads) from 0.19.4 to 0.21.2.
- [Release notes](https://github.com/go-openapi/loads/releases)
- [Commits](https://github.com/go-openapi/loads/compare/v0.19.4...v0.21.2)

---
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>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-07 11:08:36 -05:00
dependabot[bot]
5a8f64b428 chore(deps): bump sigs.k8s.io/structured-merge-diff/v4 (#11580)
Bumps [sigs.k8s.io/structured-merge-diff/v4](https://github.com/kubernetes-sigs/structured-merge-diff) from 4.2.1 to 4.2.3.
- [Release notes](https://github.com/kubernetes-sigs/structured-merge-diff/releases)
- [Changelog](https://github.com/kubernetes-sigs/structured-merge-diff/blob/master/RELEASE.md)
- [Commits](https://github.com/kubernetes-sigs/structured-merge-diff/compare/v4.2.1...v4.2.3)

---
updated-dependencies:
- dependency-name: sigs.k8s.io/structured-merge-diff/v4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-07 11:03:11 -05:00
Edgaras
434f35eec5 chore: add Vinted to users list (#11214)
Signed-off-by: Edgaras <edgaras@apsega.lt>

Signed-off-by: Edgaras <edgaras@apsega.lt>
2022-12-06 16:08:13 +00:00
Michael Vittrup Larsen
2e9f57316a docs: Add skipCrds and ignoreMissingValueFiles to application.yaml example (#11565) 2022-12-06 09:50:51 -05:00
dependabot[bot]
507bd9d2d0 chore(deps): bump github.com/go-openapi/runtime from 0.19.4 to 0.25.0 (#11568)
Bumps [github.com/go-openapi/runtime](https://github.com/go-openapi/runtime) from 0.19.4 to 0.25.0.
- [Release notes](https://github.com/go-openapi/runtime/releases)
- [Commits](https://github.com/go-openapi/runtime/compare/v0.19.4...v0.25.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>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-06 09:25:28 -05:00
Nathanael Liechti
4018fd8924 feat: Allow proxy to be saved when creating repoCreds (#11351) (#11425)
* fix: allow proxy to be saved in repoCreds (https + github app)

Signed-off-by: Nathanael Liechti <technat@technat.ch>

* chore: changes from codegen

Signed-off-by: Nathanael Liechti <technat@technat.ch>

* chore: add unit test for CreateRepoCreds

Signed-off-by: Nathanael Liechti <technat@technat.ch>

Signed-off-by: Nathanael Liechti <technat@technat.ch>
2022-12-06 09:17:36 -05:00
asingh
d2699888d1 fix: sidebar css (#11531)
Signed-off-by: ashutosh16 <11219262+ashutosh16@users.noreply.github.com>
Co-authored-by: Remington Breeze <remington@breeze.software>
2022-12-05 16:59:29 -08:00
Alex Eftimie
cf7bf14541 feat: show app age in application list view (#11209) (#11502)
Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>
2022-12-05 16:59:05 -08:00
Nathanael Liechti
5bb937cf3a fix: use repository GithubAppCreds proxy if set (#11422)
Signed-off-by: Nathanael Liechti <technat@technat.ch>

Signed-off-by: Nathanael Liechti <technat@technat.ch>
2022-12-05 12:25:55 -05:00
Murphy Chen
f25f0b2cee add otel interceptor (#11561)
Signed-off-by: minquan.chen <minquan.chen@daocloud.io>

Signed-off-by: minquan.chen <minquan.chen@daocloud.io>
2022-12-05 09:37:07 -05:00
Dieter Bocklandt
89792b4cc1 docs: update how to access arrays in Go templates (#11562)
Signed-off-by: Dieter Bocklandt <dieterbocklandt@gmail.com>

Signed-off-by: Dieter Bocklandt <dieterbocklandt@gmail.com>
2022-12-05 08:52:03 -05:00
dependabot[bot]
cbb430337f chore(deps): bump github.com/imdario/mergo from 0.3.12 to 0.3.13 (#11555)
Bumps [github.com/imdario/mergo](https://github.com/imdario/mergo) from 0.3.12 to 0.3.13.
- [Release notes](https://github.com/imdario/mergo/releases)
- [Commits](https://github.com/imdario/mergo/compare/0.3.12...v0.3.13)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-05 08:41:34 -05:00
dependabot[bot]
44a4ec16b5 chore(deps): bump github.com/ktrysmt/go-bitbucket from 0.9.40 to 0.9.54 (#11554)
Bumps [github.com/ktrysmt/go-bitbucket](https://github.com/ktrysmt/go-bitbucket) from 0.9.40 to 0.9.54.
- [Release notes](https://github.com/ktrysmt/go-bitbucket/releases)
- [Commits](https://github.com/ktrysmt/go-bitbucket/compare/v0.9.40...v0.9.54)

---
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>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-05 08:40:55 -05:00
dependabot[bot]
ac71ec8dfb chore(deps): bump github.com/valyala/fasttemplate from 1.2.1 to 1.2.2 (#11552)
Bumps [github.com/valyala/fasttemplate](https://github.com/valyala/fasttemplate) from 1.2.1 to 1.2.2.
- [Release notes](https://github.com/valyala/fasttemplate/releases)
- [Commits](https://github.com/valyala/fasttemplate/compare/v1.2.1...v1.2.2)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-05 08:38:03 -05:00
Jocelyn Thode
8e57f5383e chore: Update notifications-engine dependency (#11479)
* chore: update `notifications-engine`

Signed-off-by: Jocelyn Thode <jocelyn@thode.email>

* chore: generate notifications docs

Signed-off-by: Jocelyn Thode <jocelyn@thode.email>

Signed-off-by: Jocelyn Thode <jocelyn@thode.email>
2022-12-05 11:18:12 +02:00
Dan Garfield
42efcb36bf [Hack] Add concurrency to cluster creation in resource generator. (#11266)
* add threading to cluster creation

Signed-off-by: Dan Garfield <dan@codefresh.io>

* Add default values

Signed-off-by: Dan Garfield <dan@codefresh.io>

* Cleanup

Signed-off-by: Dan Garfield <dan@codefresh.io>

* Move external dependency to internal

Signed-off-by: Dan Garfield <dan@codefresh.io>

* ability to run cluster generation in parallel

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

* fix linter

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

Signed-off-by: Dan Garfield <dan@codefresh.io>
Signed-off-by: pashavictorovich <pavel@codefresh.io>
Co-authored-by: pasha-codefresh <pavel@codefresh.io>
2022-12-04 17:27:19 +02:00
Philip Haberkern
62c85d6f39 docs: Added ARGOCD_ENV_ prefix to FOO (#11545)
Signed-off-by: Philip Haberkern <59010269+thedatabaseme@users.noreply.github.com>

Signed-off-by: Philip Haberkern <59010269+thedatabaseme@users.noreply.github.com>
2022-12-03 21:53:19 -05:00
dependabot[bot]
9839564a67 chore(deps-dev): bump babel-jest from 24.9.0 to 26.6.3 in /ui (#11483)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-02 08:29:12 -08:00
dependabot[bot]
2b4c5659ea chore(deps-dev): bump @babel/preset-react from 7.7.0 to 7.18.6 in /ui (#11489)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-02 08:27:56 -08:00
dependabot[bot]
f6501accee chore(deps): bump decode-uri-component from 0.2.0 to 0.2.2 in /ui (#11533)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-02 08:24:50 -08:00
Duncan
2b3ac697d7 docs: Add CSI secret driver to the secret management options (#10900)
Signed-off-by: Duncan <62943186+duncan485@users.noreply.github.com>

Signed-off-by: Duncan <62943186+duncan485@users.noreply.github.com>
2022-12-02 08:51:04 -05:00
Antoine Pultier
c9af1f8eec docs: Improve Keycloak documentation for command line sign-in (#8758)
Documenting what is discussed in #2932

Signed-off-by: Antoine Pultier <antoine.pultier@sintef.no>

Signed-off-by: Antoine Pultier <antoine.pultier@sintef.no>
Co-authored-by: pasha-codefresh <pavel@codefresh.io>
2022-12-02 08:47:09 -05:00
Cedar
ac7be1f4b4 docs: Update operator manual installation helm available url (#11120)
Signed-off-by: cedarkuo <cedarkuo@gmail.com>

Signed-off-by: cedarkuo <cedarkuo@gmail.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2022-12-02 08:45:42 -05:00
Gerald Spencer
48da592248 docs: Update Pull Request generator documentation to include application lifecycle (#11274)
* Update Pull Request generator documentation

The lifecycle of the generated applications was not explained

Signed-off-by: Gerald Spencer <Geethree@users.noreply.github.com>

* Update docs/operator-manual/applicationset/Generators-Pull-Request.md

Co-authored-by: Alex Eftimie <alex.eftimie@getyourguide.com>
Signed-off-by: Gerald Spencer <Geethree@users.noreply.github.com>

Signed-off-by: Gerald Spencer <Geethree@users.noreply.github.com>
Co-authored-by: Alex Eftimie <alex.eftimie@getyourguide.com>
2022-12-02 08:44:31 -05:00
dependabot[bot]
7a1e8273f3 chore(deps-dev): bump @types/prop-types from 15.7.1 to 15.7.5 in /ui (#11487)
Bumps [@types/prop-types](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/prop-types) from 15.7.1 to 15.7.5.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/prop-types)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-02 05:17:08 +00:00
dependabot[bot]
cfad9edd4a chore(deps): bump actions/setup-go from 3.3.1 to 3.4.0 (#11535)
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 3.3.1 to 3.4.0.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](c4a742cab1...d0a58c1c4d)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-02 04:32:52 +00:00
dependabot[bot]
36c3d72a87 chore(deps): bump softprops/action-gh-release from 0.1.14 to 0.1.15 (#11534)
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 0.1.14 to 0.1.15.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](1e07f43987...de2c0eb89a)

---
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>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-02 04:25:01 +00:00
dependabot[bot]
16d50c2267 chore(deps): bump github.com/google/go-jsonnet from 0.18.0 to 0.19.1 (#11484)
Bumps [github.com/google/go-jsonnet](https://github.com/google/go-jsonnet) from 0.18.0 to 0.19.1.
- [Release notes](https://github.com/google/go-jsonnet/releases)
- [Changelog](https://github.com/google/go-jsonnet/blob/master/.goreleaser.yml)
- [Commits](https://github.com/google/go-jsonnet/compare/v0.18.0...v0.19.1)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-02 04:16:04 +00:00
dependabot[bot]
ac6949b0de chore(deps): bump github.com/mattn/go-zglob from 0.0.3 to 0.0.4 (#11486)
Bumps [github.com/mattn/go-zglob](https://github.com/mattn/go-zglob) from 0.0.3 to 0.0.4.
- [Release notes](https://github.com/mattn/go-zglob/releases)
- [Commits](https://github.com/mattn/go-zglob/compare/v0.0.3...v0.0.4)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-01 23:08:00 -05:00
Nicholas Morey
3ac4483052 docs: clarify finalizer effect and link to app-of-apps (#11272)
* docs: clarify deletion finalizer

- Provide a concise explanation of the effect of the finalizer. Which clarifies that it only takes effect once the Application has been deleted.

Signed-off-by: Nicholas Morey <nicholas@morey.tech>

* docs: fix wording and spelling

Signed-off-by: Nicholas Morey <nicholas@morey.tech>

* docs: fix spelling

Signed-off-by: Nicholas Morey <nicholas@morey.tech>

Signed-off-by: Nicholas Morey <nicholas@morey.tech>
2022-12-01 22:50:10 -05:00
Soumya Ghosh Dastidar
470ac1343f feat: add support for plugin name in CMPv2 (#11290) (#11341)
* feat: add support for plugin name in cmpV2

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>

* feat: updated e2e test to use name for CMPv2 plugin

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>

* docs: updated docs

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>

* fix: check whether final socket path is inside sock dir or not

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>
2022-12-01 22:30:09 -05:00
Remington Breeze
9a90bf8b1e chore: upgrade React version (#11467)
Signed-off-by: Remington Breeze <remington@breeze.software>
2022-12-01 22:24:44 -05:00
dependabot[bot]
addc758963 chore(deps-dev): bump @types/lodash-es from 4.17.5 to 4.17.6 in /ui (#11488)
Bumps [@types/lodash-es](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/lodash-es) from 4.17.5 to 4.17.6.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/lodash-es)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-01 22:15:28 -05:00
dependabot[bot]
2a9cc279ab chore(deps): bump github.com/golang-jwt/jwt/v4 from 4.4.2 to 4.4.3 (#11485)
Bumps [github.com/golang-jwt/jwt/v4](https://github.com/golang-jwt/jwt) from 4.4.2 to 4.4.3.
- [Release notes](https://github.com/golang-jwt/jwt/releases)
- [Changelog](https://github.com/golang-jwt/jwt/blob/main/VERSION_HISTORY.md)
- [Commits](https://github.com/golang-jwt/jwt/compare/v4.4.2...v4.4.3)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-01 22:11:59 -05:00
dependabot[bot]
2bb3820a62 chore(deps): bump github.com/alicebob/miniredis/v2 from 2.14.2 to 2.23.1 (#11481)
Bumps [github.com/alicebob/miniredis/v2](https://github.com/alicebob/miniredis) from 2.14.2 to 2.23.1.
- [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.14.2...v2.23.1)

---
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>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-01 22:11:17 -05:00
dependabot[bot]
489b670a96 chore(deps): bump github.com/evanphx/json-patch (#11482)
Bumps [github.com/evanphx/json-patch](https://github.com/evanphx/json-patch) from 4.12.0+incompatible to 5.6.0+incompatible.
- [Release notes](https://github.com/evanphx/json-patch/releases)
- [Commits](https://github.com/evanphx/json-patch/compare/v4.12.0...v5.6.0)

---
updated-dependencies:
- dependency-name: github.com/evanphx/json-patch
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-01 22:10:11 -05:00
Michael Merrill
f9f27cc644 fix: add missing changes for bitbucket cloud SCM provider (#10143) (#11150)
Signed-off-by: mmerrill3 <jjpaacks@gmail.com>

Signed-off-by: mmerrill3 <jjpaacks@gmail.com>
2022-11-30 21:01:48 -05:00
Alexander Matyushentsev
67ae39e99d fix: expose missing ReactDOM to enable extensions implementation (#11495)
Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>

Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
2022-11-30 18:44:01 +00:00
Gene Hand
981a1f1c9f chore: Update to v3 of the sprig library for ApplicationSets (#11277) (#11292)
* Update to v3 of the sprig library for ApplicationSets

Signed-off-by: Gene Hand <ghand@doximity.com>

* go mod tidy

Signed-off-by: Gene Hand <ghand@doximity.com>

* add Doximity to the users list

Signed-off-by: Gene Hand <ghand@doximity.com>

* empty commit to retest

Signed-off-by: Gene Hand <ghand@doximity.com>

* note the sprig semver change in the 2.6 upgrade guide

Signed-off-by: Gene Hand <ghand@doximity.com>

Signed-off-by: Gene Hand <ghand@doximity.com>
2022-11-29 22:34:06 +00:00
Michael Crenshaw
95b38f1db4 feat: parameterized config management plugins (#9135) (#9216)
* feat: parameterized CMPs

Signed-off-by: Michael Crenshaw <michael@crenshaw.dev>

* values types for parameters

Signed-off-by: Michael Crenshaw <michael@crenshaw.dev>

* Add types for CMP announcement

Signed-off-by: zachaller <zachaller@hotmail.com>
Signed-off-by: Michael Crenshaw <michael@crenshaw.dev>

* Reorg

Signed-off-by: zachaller <zachaller@hotmail.com>
Signed-off-by: Michael Crenshaw <michael@crenshaw.dev>

* finish type

Signed-off-by: zachaller <zachaller@hotmail.com>
Signed-off-by: Michael Crenshaw <michael@crenshaw.dev>

* First pass at working GetParametersAnnouncement

Signed-off-by: zachaller <zachaller@hotmail.com>
Signed-off-by: Michael Crenshaw <michael@crenshaw.dev>

* Typos

Signed-off-by: zachaller <zachaller@hotmail.com>
Signed-off-by: Michael Crenshaw <michael@crenshaw.dev>

* Make all fields optional

Signed-off-by: zachaller <zachaller@hotmail.com>
Signed-off-by: Michael Crenshaw <michael@crenshaw.dev>

* Make sure response makes it to repo server

Signed-off-by: zachaller <zachaller@hotmail.com>
Signed-off-by: Michael Crenshaw <michael@crenshaw.dev>

* Refactor for testing

Signed-off-by: zachaller <zachaller@hotmail.com>
Signed-off-by: Michael Crenshaw <michael@crenshaw.dev>

* lint

Signed-off-by: Michael Crenshaw <michael@crenshaw.dev>

* send build env to param announcement gen

Signed-off-by: Michael Crenshaw <michael@crenshaw.dev>

* test parameter announcement

Signed-off-by: Michael Crenshaw <michael@crenshaw.dev>

* tests

Signed-off-by: Michael Crenshaw <michael@crenshaw.dev>

* environ tests

Signed-off-by: Michael Crenshaw <michael@crenshaw.dev>

* Rename workdir to app dir

Signed-off-by: zachaller <zachaller@hotmail.com>
Signed-off-by: Michael Crenshaw <michael@crenshaw.dev>

* handle empty command, start ui work (#11)

* Add types for CMP announcement

Signed-off-by: zachaller <zachaller@hotmail.com>

* Reorg

Signed-off-by: zachaller <zachaller@hotmail.com>

* finish type

Signed-off-by: zachaller <zachaller@hotmail.com>

* First pass at working GetParametersAnnouncement

Signed-off-by: zachaller <zachaller@hotmail.com>

* Typos

Signed-off-by: zachaller <zachaller@hotmail.com>

* Make all fields optional

Signed-off-by: zachaller <zachaller@hotmail.com>

* Make sure response makes it to repo server

Signed-off-by: zachaller <zachaller@hotmail.com>

* Refactor for testing

Signed-off-by: zachaller <zachaller@hotmail.com>

* values types for parameters

Signed-off-by: Michael Crenshaw <michael@crenshaw.dev>

* lint

Signed-off-by: Michael Crenshaw <michael@crenshaw.dev>

* send build env to param announcement gen

Signed-off-by: Michael Crenshaw <michael@crenshaw.dev>

* test parameter announcement

* tests

Signed-off-by: Michael Crenshaw <michael@crenshaw.dev>

* environ tests

Signed-off-by: Michael Crenshaw <michael@crenshaw.dev>

* Rename workdir to app dir

Signed-off-by: zachaller <zachaller@hotmail.com>

* handle empty command, start ui work

Signed-off-by: Michael Crenshaw <michael@crenshaw.dev>

* fix order

Signed-off-by: Michael Crenshaw <michael@crenshaw.dev>

* fix map merging, make params read-only

Signed-off-by: Michael Crenshaw <michael@crenshaw.dev>

Co-authored-by: zachaller <zachaller@hotmail.com>

* Add helm PoC example plugin

Signed-off-by: zachaller <zachaller@hotmail.com>

* example as kustomize overlay

Signed-off-by: Michael Crenshaw <michael@crenshaw.dev>

* Parameterized cmps docs (#12)

* use printf instead of echo

Signed-off-by: Michael Crenshaw <michael@crenshaw.dev>

* docs

Signed-off-by: Michael Crenshaw <michael@crenshaw.dev>

* test for temp dir cleanup

Signed-off-by: Michael Crenshaw <michael@crenshaw.dev>

* handle empty params

Signed-off-by: Michael Crenshaw <michael@crenshaw.dev>

* handle empty values

Signed-off-by: Michael Crenshaw <michael@crenshaw.dev>

* consolidate types

Signed-off-by: Michael Crenshaw <michael@crenshaw.dev>

* fix tests

Signed-off-by: Michael Crenshaw <michael@crenshaw.dev>

* docs

Signed-off-by: Michael Crenshaw <michael@crenshaw.dev>

* docs

Signed-off-by: Michael Crenshaw <michael@crenshaw.dev>

* remove duplicate info

Signed-off-by: Michael Crenshaw <michael@crenshaw.dev>

* add warning about param announcements vs param values

Signed-off-by: Michael Crenshaw <michael@crenshaw.dev>

* tests (#13)

Signed-off-by: Michael Crenshaw <michael@crenshaw.dev>

* tests

Signed-off-by: Michael Crenshaw <michael@crenshaw.dev>

* fix types

Signed-off-by: Michael Crenshaw <michael@crenshaw.dev>

* fix test

Signed-off-by: Michael Crenshaw <michael@crenshaw.dev>

* fix codegen

Signed-off-by: Michael Crenshaw <michael@crenshaw.dev>

* fix codegen

Signed-off-by: Michael Crenshaw <michael@crenshaw.dev>

* revert test hack

Signed-off-by: Michael Crenshaw <michael@crenshaw.dev>

* docs correction

Signed-off-by: Michael Crenshaw <michael@crenshaw.dev>

* fix indentation

Signed-off-by: Michael Crenshaw <michael@crenshaw.dev>

* fix spacing

Signed-off-by: CI <michael@crenshaw.dev>

* move util function to util file and add test

Signed-off-by: CI <michael@crenshaw.dev>

* wrap error

Signed-off-by: CI <michael@crenshaw.dev>

* correct version number

Signed-off-by: CI <michael@crenshaw.dev>

* document necessity of collectionType param

Signed-off-by: CI <michael@crenshaw.dev>

* remove part of error message that's not useful (dir name is now randomized)

Signed-off-by: CI <michael@crenshaw.dev>

* fix things so that they are not broken

Signed-off-by: CI <michael@crenshaw.dev>

* don't close file before caller gets a chance to use it

Signed-off-by: CI <michael@crenshaw.dev>

* codegen

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>

* comments

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>

* DON'T PANIC

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

Signed-off-by: Michael Crenshaw <michael@crenshaw.dev>
Signed-off-by: zachaller <zachaller@hotmail.com>
Signed-off-by: CI <michael@crenshaw.dev>
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Co-authored-by: zachaller <zachaller@hotmail.com>
2022-11-29 13:08:32 -05:00
Michael Crenshaw
362abff610 chore: dependabot for npm (#11474)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2022-11-29 12:14:35 -05:00
Michael Crenshaw
012ffd584a chore: pin actions (#11360)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2022-11-29 12:13:16 -05:00
dependabot[bot]
50ed4bcc02 chore(deps): bump github.com/bradleyfalzon/ghinstallation/v2 (#11469)
Bumps [github.com/bradleyfalzon/ghinstallation/v2](https://github.com/bradleyfalzon/ghinstallation) from 2.0.4 to 2.1.0.
- [Release notes](https://github.com/bradleyfalzon/ghinstallation/releases)
- [Commits](https://github.com/bradleyfalzon/ghinstallation/compare/v2.0.4...v2.1.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>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-29 10:20:30 -05:00
fsl
a14aa81169 fix: upgrade golang.org/x/net vuln (#11447)
Signed-off-by: fsl <1171313930@qq.com>

Signed-off-by: fsl <1171313930@qq.com>
2022-11-29 15:11:00 +00:00
dependabot[bot]
18435c998e chore(deps): bump google.golang.org/grpc from 1.45.0 to 1.51.0 (#11454)
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.45.0 to 1.51.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.45.0...v1.51.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>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-29 15:09:28 +00:00
Michael Crenshaw
b8685bb243 chore: use set-output environment file (#10999)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2022-11-29 09:48:02 -05:00
Adrian Moisey
c30b7775ce docs: fix markdown formatting (#11460)
The exiting table is a bit off

Signed-off-by: Adrian Moisey <adrian@changeover.za.net>

Signed-off-by: Adrian Moisey <adrian@changeover.za.net>
2022-11-29 09:19:14 -05:00
dependabot[bot]
f6f183d1d9 chore(deps): bump github.com/gosimple/slug from 1.12.0 to 1.13.1 (#11452)
Bumps [github.com/gosimple/slug](https://github.com/gosimple/slug) from 1.12.0 to 1.13.1.
- [Release notes](https://github.com/gosimple/slug/releases)
- [Commits](https://github.com/gosimple/slug/compare/v1.12.0...v1.13.1)

---
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>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-29 08:35:51 -05:00
dependabot[bot]
47c17932ac chore(deps): bump github.com/golang-jwt/jwt/v4 from 4.2.0 to 4.4.2 (#11468)
Bumps [github.com/golang-jwt/jwt/v4](https://github.com/golang-jwt/jwt) from 4.2.0 to 4.4.2.
- [Release notes](https://github.com/golang-jwt/jwt/releases)
- [Changelog](https://github.com/golang-jwt/jwt/blob/main/VERSION_HISTORY.md)
- [Commits](https://github.com/golang-jwt/jwt/compare/v4.2.0...v4.4.2)

---
updated-dependencies:
- dependency-name: github.com/golang-jwt/jwt/v4
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-29 08:33:48 -05:00
dependabot[bot]
7c880c6006 chore(deps): bump github.com/itchyny/gojq from 0.12.3 to 0.12.9 (#11471)
Bumps [github.com/itchyny/gojq](https://github.com/itchyny/gojq) from 0.12.3 to 0.12.9.
- [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.3...v0.12.9)

---
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>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-29 08:32:05 -05:00
asingh
b9712fc908 fix: sonarlint issue (#11472)
Signed-off-by: ashutosh16 <11219262+ashutosh16@users.noreply.github.com>

Signed-off-by: ashutosh16 <11219262+ashutosh16@users.noreply.github.com>
2022-11-29 08:29:57 -05:00
Remington Breeze
83463c67be fix: incorrect can-i documentation (#11463)
Signed-off-by: Remington Breeze <remington@breeze.software>
Signed-off-by: Jesse Suen <jessesuen@users.noreply.github.com>
Co-authored-by: Jesse Suen <jessesuen@users.noreply.github.com>
2022-11-28 23:06:30 +00:00
Leonardo Luz Almeida
3db9bff3da chore: update otel libraries to 1.11.1 (#11461)
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
2022-11-28 16:24:16 -05:00
usernameisnull
752bc5f80d chore:remove redundant parentheses (#11436)
Signed-off-by: mabing <bing.ma@daocloud.io>

Signed-off-by: mabing <bing.ma@daocloud.io>
Co-authored-by: mabing <bing.ma@daocloud.io>
2022-11-26 13:45:19 -05:00
Saumeya Katyal
ba8931b67d fix: ui banner covering sidebar (#11101) 2022-11-25 13:52:00 -08:00
Alex Eftimie
9b6992af61 feat: Add wildcard support in OCI Helm Repositories targetRevision (#6686) (#10641)
* Add wildcard support in OCI Helm Repositories

A naive approach, adapting existing code for fetching the index.

Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>

* Fix unittest missing mock

Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>

* Fix release resolution also in Manual Sync dialog

Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>

* Show target revision in application list. Tiles and Table updated

Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>

* Follow Link rel=next in tags response for tag list completion (signed)

Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>

* Wrap errors into fmt.Errorf according to PR review

Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>

* Address PR comments, add test for tags MaxVersion and pagination

Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>

* Apply suggestions from code review

Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>

* more feedback from pr

Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>

* Revert url.JoinPath change - only available in 1.19

Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>

* use strings.Join. add unittest

Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>

* Safe access to app.status.sync object

Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>

* Remove status.revision from UI. It doesn't bring much value and it does clutter the ui a bit

Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>

* Update util/helm/client.go

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

* Update util/helm/client.go

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

Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.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>
2022-11-25 21:51:30 +00:00
dependabot[bot]
a0d7b5c2ba chore(deps): bump gopkg.in/go-playground/webhooks.v5 (#11369)
Bumps [gopkg.in/go-playground/webhooks.v5](https://github.com/go-playground/webhooks) from 5.11.0 to 5.17.0.
- [Release notes](https://github.com/go-playground/webhooks/releases)
- [Commits](https://github.com/go-playground/webhooks/compare/v5.11.0...v5.17.0)

---
updated-dependencies:
- dependency-name: gopkg.in/go-playground/webhooks.v5
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-25 21:13:14 +00:00
Nicholas Morey
e9598a3677 docs: improve build env variable list formatting (#11429)
* docs: normalize build env list

Signed-off-by: Nicholas Morey <nicholas@morey.tech>

* docs: use table instead of list

Signed-off-by: Nicholas Morey <nicholas@morey.tech>

* docs: remove separator from description

Signed-off-by: Nicholas Morey <nicholas@morey.tech>

Signed-off-by: Nicholas Morey <nicholas@morey.tech>
2022-11-25 15:31:04 -05:00
Nick Mohoric
e824f5e210 fix: Add support for /api/v1/applicationsets* via HTTP (#11409)
Signed-off-by: Nick Mohoric <nmohoric@hearst.com>

Signed-off-by: Nick Mohoric <nmohoric@hearst.com>
2022-11-25 15:14:25 -05:00
dependabot[bot]
ab51bc3cde chore(deps): bump github.com/prometheus/client_golang (#11366)
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.12.1 to 1.14.0.
- [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.12.1...v1.14.0)

---
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>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-25 14:31:44 -05:00
dependabot[bot]
1eaaa56a45 chore(deps): bump github.com/casbin/casbin/v2 from 2.39.1 to 2.57.1 (#11420)
Bumps [github.com/casbin/casbin/v2](https://github.com/casbin/casbin) from 2.39.1 to 2.57.1.
- [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.39.1...v2.57.1)

---
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>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-25 13:26:04 -05:00
Nathanael Liechti
6509d0b92f docs: update remote-debugging-docs (#11424)
Fix wrong port mapping, add explanation what actually happens and remove misleading phrase in vs-code section

Signed-off-by: Nathanael Liechti <technat@technat.ch>

Signed-off-by: Nathanael Liechti <technat@technat.ch>
2022-11-25 13:24:52 -05:00
Michael Crenshaw
a9da5d83d6 chore: push GHCR image to repo scope (#11394)
* chore: push GHCR image to repo scope

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

* missed a spot

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

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2022-11-22 13:43:32 -05:00
asingh
15b0785ba4 fix: hide app namespace on the ui (#11111) (#11247)
* fix: hide app namespace when irrelevant (#11111)

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

* wire up setting

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

* fix: hide app namespace

Signed-off-by: ashutosh16 <11219262+ashutosh16@users.noreply.github.com>

* fix: hide app namespace

Signed-off-by: ashutosh16 <11219262+ashutosh16@users.noreply.github.com>

* add null check

Signed-off-by: ashutosh16 <11219262+ashutosh16@users.noreply.github.com>

* Update ui/src/app/applications/components/utils.tsx

Co-authored-by: Blake Pettersson <blake.pettersson@gmail.com>
Signed-off-by: asingh <11219262+ashutosh16@users.noreply.github.com>

* lint

Signed-off-by: ashutosh16 <11219262+ashutosh16@users.noreply.github.com>

* fix name generation

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

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Signed-off-by: ashutosh16 <11219262+ashutosh16@users.noreply.github.com>
Signed-off-by: asingh <11219262+ashutosh16@users.noreply.github.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Co-authored-by: Blake Pettersson <blake.pettersson@gmail.com>
2022-11-21 22:16:36 +00:00
Robert Kelly
437cd4f1b5 chore: add Liatrio to the official users list (#11377)
Signed-off-by: Robert Kelly <RobertKelly@users.noreply.github.com>

Signed-off-by: Robert Kelly <RobertKelly@users.noreply.github.com>
2022-11-21 16:33:13 -05:00
Alex Eftimie
3f5c2eb60c feat(ui): add a filter for auto sync (#11357) 2022-11-21 09:20:34 -08:00
Soumya Ghosh Dastidar
13026e28ac proposal: Deep Links (#10278) 2022-11-21 08:56:48 -08:00
Alex Eftimie
967999df79 bug(ui): fix incomplete drop-down resource acctions (#11384)
Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>
2022-11-21 08:17:56 -08:00
Justin Marquis
a259654e32 chore: fix username for ghcr.io (#11373)
Signed-off-by: Justin Marquis <34fathombelow@protonmail.com>

Signed-off-by: Justin Marquis <34fathombelow@protonmail.com>
2022-11-19 19:52:32 +00:00
dependabot[bot]
bd6bb09320 chore(deps): bump actions/upload-artifact from 2 to 3 (#11365)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 2 to 3.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v2...v3)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-18 22:07:33 -05:00
dependabot[bot]
eaf6e9e0a0 chore(deps): bump actions/setup-node from 1 to 3 (#11364)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 1 to 3.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v1...v3)

---
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>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-18 22:06:08 -05:00
dependabot[bot]
9960f54166 chore(deps): bump actions/cache from 1 to 3 (#11363)
Bumps [actions/cache](https://github.com/actions/cache) from 1 to 3.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v1...v3)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-18 22:03:55 -05:00
dependabot[bot]
dc959e900f chore(deps): bump codecov/codecov-action from 1 to 3 (#11362)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 1 to 3.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v1...v3)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-18 22:02:09 -05:00
Nick Dombroski
ea3215bc0a chore: Include error when dex config unmarshal fails (#11349)
Signed-off-by: Nick Dombroski <nick.m.dombroski@gmail.com>

Signed-off-by: Nick Dombroski <nick.m.dombroski@gmail.com>
2022-11-18 21:15:45 -05:00
dependabot[bot]
7d24fe7e08 chore(deps): bump actions/download-artifact from 2 to 3 (#11361)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 2 to 3.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v2...v3)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-18 21:06:09 -05:00
Alex Eftimie
17e9ef409a docs: fix references to cli tools moved under argocd admin (#11181)
* docs: fix references to cli tools moved under argocd admin

Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>

* attempt to fix the build by fiddling the generated docs

Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>

* Update hack/gen-catalog/main.go

Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>

* docs: fix doc generator for argocd admin notifications

Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>

* docs: fix doc generator diff

Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>

Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>
2022-11-18 21:02:59 -05:00
Chauncey
f73e7014ce feat: Implement karmada CRD health checks (#11192)
Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>

Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>
2022-11-18 21:01:23 -05:00
Alexander Matyushentsev
097ed6f108 fix: application stuck in infinite reconciliation loop if using wrong project (#11246)
* fix: application stuck in infinite reconciliation loop if using wrong project

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

* add missing unit test

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

Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
2022-11-18 20:57:34 -05:00
F1ko
812664cbb1 fix: remove 0.0.0.0/0 ipblock from network policies (#11321) (#11322)
* fix: remove 0.0.0.0/0 ipblock from network policies

https://github.com/argoproj/argo-cd/issues/11321
Signed-off-by: Filip Nikolic <oss.filipn@gmail.com>

* chore: add postfinance to the list of users

Signed-off-by: Filip Nikolic <oss.filipn@gmail.com>

Signed-off-by: Filip Nikolic <oss.filipn@gmail.com>
2022-11-18 20:56:15 -05:00
Pier
299af2172f chore: add user to list (#11336)
* docs: add user to list

Signed-off-by: Pier <53210578+pie-r@users.noreply.github.com>

* retrigger the pipeline

Signed-off-by: Pier <53210578+pie-r@users.noreply.github.com>

Signed-off-by: Pier <53210578+pie-r@users.noreply.github.com>
2022-11-18 20:54:35 -05:00
Phước Trung
c9dfd41308 chore: add Wolffun Game to USERS (#11342)
Signed-off-by: Phước Trung <93299415+trungdlp-wolffun@users.noreply.github.com>

Signed-off-by: Phước Trung <93299415+trungdlp-wolffun@users.noreply.github.com>
2022-11-18 20:53:59 -05:00
Michael Crenshaw
aa02e79401 chore: grant packages.write for image workflow (#11358)
* chore: grant packages.write for image workflow

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

* use github token instead of PAT

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

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2022-11-19 00:44:48 +00:00
William Van Hevelingen
3b36f34d8f chore: Enable dependabot for automatic dependency updates (#8339)
Signed-off-by: William Van Hevelingen <william.vanhevelingen@acquia.com>

Signed-off-by: William Van Hevelingen <william.vanhevelingen@acquia.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2022-11-19 00:07:24 +00:00
Alex Eftimie
0ea88b7d72 feature: allow a custom labels on any resource to surface in the UI (tree view node tags) (#11153)
* feature: allow a custom label on any resource to surface the UI

Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>
2022-11-18 22:29:22 +00:00
Alex Eftimie
0c242fe535 fix(ui): fix sorting of parameters. Make the Remove override button clickable again (#11316)
Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>
Co-authored-by: Remington Breeze <remington@breeze.software>
2022-11-18 20:47:57 +00:00
Alex Eftimie
a72b262b5e feat: display auto sync status in application details view (#11200)
Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>
Co-authored-by: Remington Breeze <remington@breeze.software>
2022-11-18 18:51:13 +00:00
Alex Eftimie
2173b87b99 fix: set HELM_CONFIG_HOME dir for oci registry authentication; fixes: #11284 (#11285)
Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>
2022-11-17 14:23:16 -08:00
Justin Marquis
8f00d347b5 docs: update contributor meeting times (#11294)
Signed-off-by: Justin Marquis <34fathombelow@protonmail.com>

Signed-off-by: Justin Marquis <34fathombelow@protonmail.com>
2022-11-17 11:32:59 -05:00
Edmund Rhudy
c1b0c7ba4c fix: UI can now get clusters with slashes in name (#9812) (#9813)
* fix: #9812 UI can now get clusters with slashes in name

Fixes #9812

If a cluster name has a slash in it, the API would not be able
to fetch that cluster and would display "in-cluster (undefined)"
for that application. This fixes that issue by URI-encoding
the cluster name on the UI side and URI-decoding the cluster name
on the API side.

Signed-off-by: Edmund Rhudy <erhudy@users.noreply.github.com>

* Retrigger CI pipeline

Signed-off-by: Edmund Rhudy <erhudy@users.noreply.github.com>

Signed-off-by: Edmund Rhudy <erhudy@users.noreply.github.com>
2022-11-17 09:55:17 -05:00
Michael Crenshaw
e1c21480e4 chore: use --password-stdin for docker login (#11331)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2022-11-17 14:43:59 +00:00
Alexander Matyushentsev
9bd0ed0d56 fix: application list api is very slow when fields query parameter is supplied (#11250)
* fix: application list api is very slow when fields query parameter is supplied

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

* regenerate docs

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

* document the requirement to maintain support fields of application list/watch api

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

Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
2022-11-16 09:42:05 -08:00
Husni Rofiq Muttaqin
d2da477791 chore: Add Divistant to Users list (#11298)
Signed-off-by: hrofiq <husni@divistant.com>

Signed-off-by: hrofiq <husni@divistant.com>
Co-authored-by: hrofiq <husni@divistant.com>
2022-11-15 20:00:32 -05:00
Patrice Chalin
0240958c15 docs: Use new Google Analytics 4 ID (#11291)
Signed-off-by: Patrice Chalin <chalin@cncf.io>

Signed-off-by: Patrice Chalin <chalin@cncf.io>
2022-11-15 13:41:27 -08:00
Shuai Zhang
4328bfc1ff fix: allow resolving repo root as jsonnet lib path (#11119)
Signed-off-by: shuai-zh <shuaiz8023@gmail.com>
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2022-11-15 12:56:48 -08:00
Nicholas Morey
817161a33b docs: add info about sync interval (#11281)
* docs: add info about sync interval

Add information about the sync interval to the Automated Sync Policy page. Users will likely check this page when looking for how to configure the sync interval.

Signed-off-by: Nicholas Morey <nicholas@morey.tech>

* docs: add default value

Signed-off-by: Nicholas Morey <nicholas@morey.tech>

Signed-off-by: Nicholas Morey <nicholas@morey.tech>
2022-11-14 17:52:15 +00:00
github-actions[bot]
87a0d02b3a [Bot] Update Snyk reports (#11282)
Signed-off-by: CI <ci@argoproj.com>

Signed-off-by: CI <ci@argoproj.com>
Co-authored-by: CI <ci@argoproj.com>
2022-11-14 10:22:43 -05:00
Alex Eftimie
16c6e36ee4 chore(docs): fix build, prepare for google analytics v4 (#10850) (#11248)
* fix docs build. prepare for google analytics v4

Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>

* fix build

Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>

* fix build codegen check

Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>

Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>
2022-11-14 08:50:05 -05:00
Ferenc Horvay
8375840344 fix: add check for trailing/leading whitespace in project role group names (#10919) (#10988)
* fix: add check for trailing/leading whitespace in project role group names

Signed-off-by: Ferenc <ferenc.horvay@web.de>

* fix: change expected output on whitespace test

Signed-off-by: Ferenc <ferenc.horvay@web.de>

* fix: apply requested changes

Signed-off-by: Ferenc <ferenc.horvay@web.de>

Signed-off-by: Ferenc <ferenc.horvay@web.de>
2022-11-14 08:28:06 -05:00
Michael Crenshaw
41b1ebef83 docs: fix formatting (#11245)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2022-11-09 21:27:11 +00:00
Alex Eftimie
4cf807e67a fix(ui): show orphaned as gray. fixes: #11180 (#11218)
Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>
2022-11-09 11:46:42 -08:00
ChangZhuo Chen (陳昌倬)
6344d9623e docs: add example for config management plugins exclusion (#11187)
Signed-off-by: ChangZhuo Chen (陳昌倬) <czchen@czchen.org>

Signed-off-by: ChangZhuo Chen (陳昌倬) <czchen@czchen.org>
2022-11-09 08:29:22 -05:00
Justin Marquis
1a8dd249c0 fix: use non distroless image for dex (#11219)
* fix: use non distroless image for dex

Signed-off-by: Justin Marquis <34fathombelow@protonmail.com>

* change image in ci workflow

Signed-off-by: Justin Marquis <34fathombelow@protonmail.com>

Signed-off-by: Justin Marquis <34fathombelow@protonmail.com>
2022-11-09 08:22:06 -05:00
Leonardo Luz Almeida
b0dab38c7d fix: point gitops-engine to current master (#11230)
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
2022-11-08 22:46:44 +00:00
Jesse Suen
1f0d4cfccc fix: retry token creation/deletion upon project conflict errors (#11199)
Signed-off-by: Jesse Suen <jesse@akuity.io>
2022-11-08 13:52:00 -08:00
Arthur Busser
1ae5aff2f8 chore: add Pigment to list of users (#11127)
Signed-off-by: Arthur Busser <arthur.busser@gopigment.com>

Signed-off-by: Arthur Busser <arthur.busser@gopigment.com>
2022-11-08 16:07:19 -05:00
Leonardo Luz Almeida
fe151a1c0e fix: do not mutate live when managed namespace enabled (#11197)
* fix: do not mutate live when managed namespace enabled

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

* fix unit-test

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

* fix unit-test

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

* Fix lint

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

* remove trackingID from e2e test validation

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

* fix e2e

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

* remove unnecessary config

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

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
2022-11-08 16:06:05 -05:00
Alex Eftimie
149926dec4 Action menu: sort items, show in resource details page (#11008)
Signed-off-by: Alex Eftimie <alex.eftimie@getyourguide.com>
Co-authored-by: Remington Breeze <remington@breeze.software>
2022-11-08 17:45:28 +00:00
reggie-k
d5a961c7f6 feat: Shared custom health check for multiple resources (#4212) (#10885)
* Kind wildcard support in health customizations

Signed-off-by: reggie <reginakagan@gmail.com>

* Updated health customizations docs to using the correct field with a /

Signed-off-by: reggie <reginakagan@gmail.com>

* Updated health customizations docs to using the correct field with a /

Signed-off-by: reggie <reginakagan@gmail.com>

* Document resource kind wildcard for custom health check

Signed-off-by: reggie <reginakagan@gmail.com>

* Implemented wildcard * support in API Group and Resource Kind and updated docs

Signed-off-by: reggie <reginakagan@gmail.com>

* Implemented wildcard * support in API Group and Resource Kind and updated docs

Signed-off-by: reggie <reginakagan@gmail.com>

* Implemented wildcard * support in API Group and Resource Kind and updated docs

Signed-off-by: reggie <reginakagan@gmail.com>

* Removed code duplication and returned an empty string instead of an error

Signed-off-by: reggie <reginakagan@gmail.com>

Signed-off-by: reggie <reginakagan@gmail.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2022-11-08 08:42:08 -05:00
github-actions[bot]
428bf48734 [Bot] Update Snyk reports (#11205)
Signed-off-by: CI <ci@argoproj.com>

Signed-off-by: CI <ci@argoproj.com>
Co-authored-by: CI <ci@argoproj.com>
2022-11-07 13:50:24 -05:00
Roee Landesman
4d6d20427e chore: Add Envoy to Users list (#11169)
Signed-off-by: Roee Landesman <roee.landesman@envoy.com>

Signed-off-by: Roee Landesman <roee.landesman@envoy.com>
2022-11-07 07:57:51 -05:00
Lukas Grossar
9bada88f0f docs(user-guide): update link to Helm hooks documentation (#11045)
Signed-off-by: Lukas Grossar <lukas.grossar@adfinis.com>

Signed-off-by: Lukas Grossar <lukas.grossar@adfinis.com>
2022-11-07 07:55:32 -05:00
my-git9
234fc9d1cd chore: beta.kubernetes.io/arch has been deprecated in 1.14 (#11016)
Signed-off-by: xin.li <xin.li@daocloud.io>

Signed-off-by: xin.li <xin.li@daocloud.io>
2022-11-07 07:54:44 -05:00
Nolan Emirot
79f4b5ceb6 docs: fix typo in declarative-setup.md (#11190)
* fix: typo

Signed-off-by: emirot <emirot.nolan@gmail.com>

* chore: fix typo

Signed-off-by: emirot <emirot.nolan@gmail.com>

Signed-off-by: emirot <emirot.nolan@gmail.com>
2022-11-07 07:52:46 -05:00
d3adb5
1ae0317423 chore: add Objective to USERS.md (#11202)
Signed-off-by: d3adb5 <me@d3adb5.net>

Signed-off-by: d3adb5 <me@d3adb5.net>
2022-11-07 07:47:25 -05:00
Chris Lewis
cfb24701d2 docs: Add Contributor's Quickstart Page (#11108)
* First Draft

* Update docs/contributors_quickstart.md

Co-authored-by: ChanJong Na <cjna@umich.edu>
Signed-off-by: ctlewis <lewisengineer@gmail.com>

* Update docs/contributors_quickstart.md

Co-authored-by: Dan Garfield <dan@codefresh.io>
Signed-off-by: ctlewis <lewisengineer@gmail.com>

* Update docs/contributors_quickstart.md

Co-authored-by: Moshe Shitrit <moshe@s5t.dev>
Signed-off-by: ctlewis <lewisengineer@gmail.com>

* Update docs/contributors_quickstart.md

Co-authored-by: Jason Poley <jason.poley@gmail.com>
Signed-off-by: ctlewis <lewisengineer@gmail.com>

* Update docs/contributors_quickstart.md

Co-authored-by: Moshe Shitrit <moshe@s5t.dev>
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* Update docs/contributors_quickstart.md

Co-authored-by: Garima Negi <garima.negy@gmail.com>
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* tweaks

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

* undo temporary change

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

* Add sign off

Signed-off-by: Chris Lewis <clewis@powercosts.com>

* Update docs/developer-guide/contributors-quickstart.md

Co-authored-by: Angela Wilson <84730053+awilson-payit@users.noreply.github.com>
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* Update docs/developer-guide/contributors-quickstart.md

Co-authored-by: Andre Marcelo-Tanner <andre@enthropia.com>
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

Signed-off-by: ctlewis <lewisengineer@gmail.com>
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Signed-off-by: Chris Lewis <clewis@powercosts.com>
Co-authored-by: Chris Lewis <clewis@powercosts.com>
Co-authored-by: ChanJong Na <cjna@umich.edu>
Co-authored-by: Dan Garfield <dan@codefresh.io>
Co-authored-by: Moshe Shitrit <moshe@s5t.dev>
Co-authored-by: Jason Poley <jason.poley@gmail.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Co-authored-by: Garima Negi <garima.negy@gmail.com>
Co-authored-by: Angela Wilson <84730053+awilson-payit@users.noreply.github.com>
Co-authored-by: Andre Marcelo-Tanner <andre@enthropia.com>
2022-11-04 20:21:27 -04:00
Abhishek Veeramalla
e21a82fcc1 feat: Add new admin command to print Argo CD initial password (11117) (#11155)
* feat: Add new admin command to print Argo CD initial password (11117)

Signed-off-by: iam-veeramalla <abhishek.veeramalla@gmail.com>

* fix failing CI

Signed-off-by: iam-veeramalla <abhishek.veeramalla@gmail.com>

* fix failing CI

Signed-off-by: iam-veeramalla <abhishek.veeramalla@gmail.com>

* fix failing CI

Signed-off-by: iam-veeramalla <abhishek.veeramalla@gmail.com>

* fix failing CI

Signed-off-by: iam-veeramalla <abhishek.veeramalla@gmail.com>

* fix failing CI

Signed-off-by: iam-veeramalla <abhishek.veeramalla@gmail.com>

* Update docs/getting_started.md

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

* Update cmd/argocd/commands/admin/initial_password.go

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

* Update docs/user-guide/commands/argocd_admin_initial-password.md

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

Signed-off-by: iam-veeramalla <abhishek.veeramalla@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>
2022-11-04 16:57:35 +00:00
Michael Crenshaw
ac69e27fd2 docs: debugging CMPs (#11142)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2022-11-04 14:10:53 +00:00
Michael Crenshaw
46ae472cee docs: document metadata access for go-templated cluster generator (#10929)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2022-11-04 09:03:25 -04:00
Michael Crenshaw
08124045dc docs: add Dockerfile example for plugin (#11130)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2022-11-04 09:02:25 -04:00
Blake Pettersson
777302191f feat: enable metadata to be set on namespaces (#10672)
* namespace labels

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

* create namespace should support annotations

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

* handle also modification hook

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

* regenerate entity on modify hook

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

* manifests

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

* feat: enable metadata to be set on namespaces

This builds upon the work that @pasha-codefresh did in #10288.

The main differences between this PR and the previous one is that we use
SSA to diff between different versions of the namespace, as well as
having a slightly different API in gitops-engine for setting the
namespace modifier.

We now also set the ownership of the namespace in ArgoCD.

Closes #4628
Closes #6215
Closes #7799

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

* fix: don't always track namespaces

For now, only allow namespaces managed with `managedNamespaceMetadata`
to have tracking set by Argo. Ideally we'd like new namespaces to also
be tracked by Argo, but there's currently an issue with a failing
integration test.

Also wrap error message if setting the app instance errors on the
namespace.

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

* fix: always return true with `hasManagedMetadata`

If `hasManagedMetadata` is set, `true` should always be returned.

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

* docs: add clarifying docs on resource tracking

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

* style: pr tweaks

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

* fix: re-add label unsetting

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

* Update gitops-engine to current master

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

Signed-off-by: pashavictorovich <pavel@codefresh.io>
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
Co-authored-by: pashavictorovich <pavel@codefresh.io>
Co-authored-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
2022-11-04 08:59:16 -04:00
balajisa
ebf2682214 docs(user-guide): Add doc for import argocd packages (#11041) (#11096)
* Add doc for argocd pkg import

Signed-off-by: balajisa09 <balajisa09@gmail.com>

* Update docs/user-guide/import.md

Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Signed-off-by: balajisa <50614674+balajisa09@users.noreply.github.com>

* Add detailed solution

Signed-off-by: balajisa09 <balajisa09@gmail.com>

* Update suggestions

Signed-off-by: balajisa09 <balajisa09@gmail.com>

* Update docs/user-guide/import.md

Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Signed-off-by: balajisa <50614674+balajisa09@users.noreply.github.com>

* Update docs/user-guide/import.md

Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Signed-off-by: balajisa <50614674+balajisa09@users.noreply.github.com>

* Update docs/user-guide/import.md

Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Signed-off-by: balajisa <50614674+balajisa09@users.noreply.github.com>

* Update docs/user-guide/import.md

Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Signed-off-by: balajisa <50614674+balajisa09@users.noreply.github.com>

* Update docs/user-guide/import.md

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

* fix code block

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

Signed-off-by: balajisa09 <balajisa09@gmail.com>
Signed-off-by: balajisa <50614674+balajisa09@users.noreply.github.com>
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Co-authored-by: balajisa09 <balajisa09@gmail.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2022-11-04 08:43:21 -04:00
Artur Rodrigues
a773b1effb chore: add debug logs around CMP manifest generation (#11185)
* docs: note one single CMP per app

Signed-off-by: Artur Rodrigues <artur.rodrigues@lacework.net>

* cmp: debug logs around manifest handling

Signed-off-by: Artur Rodrigues <artur.rodrigues@lacework.net>

Signed-off-by: Artur Rodrigues <artur.rodrigues@lacework.net>
2022-11-03 20:30:50 -04:00
Michael Crenshaw
7101965bd6 fix: templating keys in ApplicationSet (#11076) (#11163)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2022-11-03 19:17:04 -04:00
Hariharasuthan99
c8cae4a293 chore: Add Amadeus to user list (#11177)
Co-authored-by: hraajeshwar <hariharasuthan.raajeshwar@amadeus.com>
2022-11-03 17:08:48 -04:00
Saumeya Katyal
3047db9709 docs: add ui banner options in docs (#10907)
Signed-off-by: saumeya <saumeyakatyal@gmail.com>

Signed-off-by: saumeya <saumeyakatyal@gmail.com>
2022-11-03 16:39:53 -04:00
Leonardo Luz Almeida
327936d164 fix: handle apiGroup updates in resource-tracking (#11012)
* fix: handle apiGroup updates in resource-tracking

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

* Fix test

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

* change the fix approach by inspecting tracking id from the config

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

* add unit-test to validate the scenario

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

* fix test lint

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

* review fixes

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

* Reword godocs for clarity

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

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
2022-11-03 15:02:13 -04:00
Justin Marquis
9fa3c4fa94 fix: upgrade redis-ha chart to 4.22.3, redis regression (#11176)
* chore: upgrade redis-ha chart to 4.22.3, redis regression

Signed-off-by: Justin Marquis <34fathombelow@protonmail.com>

* fix manifest

Signed-off-by: Justin Marquis <34fathombelow@protonmail.com>

* fix missing cidr

Signed-off-by: Justin Marquis <34fathombelow@protonmail.com>

* fix typo

Signed-off-by: Justin Marquis <34fathombelow@protonmail.com>

* fix typo

Signed-off-by: Justin Marquis <34fathombelow@protonmail.com>

Signed-off-by: Justin Marquis <34fathombelow@protonmail.com>
2022-11-03 15:00:48 -04:00
Zach Aller
297eb7168a chore: update owners file from membership meeting (#11184)
Signed-off-by: zachaller <zachaller@users.noreply.github.com>

Signed-off-by: zachaller <zachaller@users.noreply.github.com>
2022-11-03 14:54:01 -04:00
github-actions[bot]
21731c9c2d [Bot] Update Snyk reports (#11162)
Signed-off-by: CI <ci@argoproj.com>

Signed-off-by: CI <ci@argoproj.com>
Co-authored-by: CI <ci@argoproj.com>
2022-11-02 14:05:49 +00:00
Mike Mwanje
ec649b6d86 docs: Add AirQo to users list (#11160)
Signed-off-by: Mike Mwanje <mwanjemike767@gmail.com>

Signed-off-by: Mike Mwanje <mwanjemike767@gmail.com>
2022-11-02 13:43:14 +00:00
Michael Crenshaw
f60ae50f38 chore: don't generate release notes (#11141)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2022-11-01 20:15:16 +00:00
Jooho Lee
4aaed135b8 docs: Add SI Analytics to ArgoCD Users list (#11110) 2022-11-01 13:06:35 -04:00
544 changed files with 93388 additions and 26631 deletions

32
.github/ISSUE_TEMPLATE/release.md vendored Normal file
View File

@@ -0,0 +1,32 @@
---
name: Argo CD Release
about: Used by our Release Champion to track progress of a minor release
title: 'Argo CD Release vX.X'
labels: 'release'
assignees: ''
---
Target RC1 date: ___. __, ____
Target GA date: ___. __, ____
- [ ] Create new section in the [Release Planning doc](https://docs.google.com/document/d/1trJIomcgXcfvLw0aYnERrFWfPjQOfYMDJOCh1S8nMBc/edit?usp=sharing)
- [ ] Schedule a Release Planning meeting roughly two weeks before the scheduled Release freeze date by adding it to the community calendar (or delegate this task to someone with write access to the community calendar)
- [ ] Include Zoom link in the invite
- [ ] Post in #argo-cd and #argo-contributors one week before the meeting
- [ ] Post again one hour before the meeting
- [ ] At the meeting, remove issues/PRs from the project's column for that release which have not been “claimed” by at least one Approver (add it to the next column if Approver requests that)
- [ ] 1wk before feature freeze post in #argo-contributors that PRs must be merged by DD-MM-YYYY to be included in the release - ask approvers to drop items from milestone they cant merge
- [ ] At least two days before RC1 date, draft RC blog post and submit it for review (or delegate this task)
- [ ] Cut RC1 (or delegate this task to an Approver and coordinate timing)
- [ ] Create new release branch
- [ ] Add the release branch to ReadTheDocs
- [ ] Confirm that tweet and blog post are ready
- [ ] Trigger the release
- [ ] After the release is finished, publish tweet and blog post
- [ ] Post in #argo-cd and #argo-announcements with lots of emojis announcing the release and requesting help testing
- [ ] Monitor support channels for issues, cherry-picking bugfixes and docs fixes as appropriate (or delegate this task to an Approver and coordinate timing)
- [ ] At release date, evaluate if any bugs justify delaying the release. If not, cut the release (or delegate this task to an Approver and coordinate timing)
- [ ] If unreleased changes are on the release branch for {current minor version minus 3}, cut a final patch release for that series (or delegate this task to an Approver and coordinate timing)
- [ ] After the release, post in #argo-cd that the {current minor version minus 3} has reached EOL (example: https://cloud-native.slack.com/archives/C01TSERG0KZ/p1667336234059729)
- [ ] (For the next release champion) Review the [items scheduled for the next release](https://github.com/orgs/argoproj/projects/25). If any item does not have an assignee who can commit to finish the feature, move it to the next release.
- [ ] (For the next release champion) Schedule a time mid-way through the release cycle to review items again.

18
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,18 @@
version: 2
updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "daily"
ignore:
- dependency-name: k8s.io/*
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
- package-ecosystem: "npm"
directory: "/ui/"
schedule:
interval: "daily"

View File

@@ -27,9 +27,9 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: Setup Golang
uses: actions/setup-go@v3
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
with:
go-version: ${{ env.GOLANG_VERSION }}
- name: Download all Go modules
@@ -45,13 +45,13 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: Setup Golang
uses: actions/setup-go@v3
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
with:
go-version: ${{ env.GOLANG_VERSION }}
- name: Restore go build cache
uses: actions/cache@v1
uses: actions/cache@627f0f41f6904a5b1efbaed9f96d9eb58e92e920 # v3.2.4
with:
path: ~/.cache/go-build
key: ${{ runner.os }}-go-build-v1-${{ github.run_id }}
@@ -69,13 +69,13 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: Setup Golang
uses: actions/setup-go@v3
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
with:
go-version: ${{ env.GOLANG_VERSION }}
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@0ad9a0988b3973e851ab0a07adf248ec2e100376 # v3.3.1
with:
version: v1.46.2
args: --timeout 10m --exclude SA5011 --verbose
@@ -92,11 +92,11 @@ jobs:
- name: Create checkout directory
run: mkdir -p ~/go/src/github.com/argoproj
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: Create symlink in GOPATH
run: ln -s $(pwd) ~/go/src/github.com/argoproj/argo-cd
- name: Setup Golang
uses: actions/setup-go@v3
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
with:
go-version: ${{ env.GOLANG_VERSION }}
- name: Install required packages
@@ -116,7 +116,7 @@ jobs:
run: |
echo "/usr/local/bin" >> $GITHUB_PATH
- name: Restore go build cache
uses: actions/cache@v1
uses: actions/cache@627f0f41f6904a5b1efbaed9f96d9eb58e92e920 # v3.2.4
with:
path: ~/.cache/go-build
key: ${{ runner.os }}-go-build-v1-${{ github.run_id }}
@@ -133,12 +133,12 @@ jobs:
- name: Run all unit tests
run: make test-local
- name: Generate code coverage artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: code-coverage
path: coverage.out
- name: Generate test results artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: test-results
path: test-results/
@@ -155,11 +155,11 @@ jobs:
- name: Create checkout directory
run: mkdir -p ~/go/src/github.com/argoproj
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: Create symlink in GOPATH
run: ln -s $(pwd) ~/go/src/github.com/argoproj/argo-cd
- name: Setup Golang
uses: actions/setup-go@v3
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
with:
go-version: ${{ env.GOLANG_VERSION }}
- name: Install required packages
@@ -179,7 +179,7 @@ jobs:
run: |
echo "/usr/local/bin" >> $GITHUB_PATH
- name: Restore go build cache
uses: actions/cache@v1
uses: actions/cache@627f0f41f6904a5b1efbaed9f96d9eb58e92e920 # v3.2.4
with:
path: ~/.cache/go-build
key: ${{ runner.os }}-go-build-v1-${{ github.run_id }}
@@ -196,7 +196,7 @@ jobs:
- name: Run all unit tests
run: make test-race-local
- name: Generate test results artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: race-results
path: test-results/
@@ -206,9 +206,9 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: Setup Golang
uses: actions/setup-go@v3
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
with:
go-version: ${{ env.GOLANG_VERSION }}
- name: Create symlink in GOPATH
@@ -250,14 +250,14 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: Setup NodeJS
uses: actions/setup-node@v1
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
with:
node-version: '12.18.4'
- name: Restore node dependency cache
id: cache-dependencies
uses: actions/cache@v1
uses: actions/cache@627f0f41f6904a5b1efbaed9f96d9eb58e92e920 # v3.2.4
with:
path: ui/node_modules
key: ${{ runner.os }}-node-dep-v2-${{ hashFiles('**/yarn.lock') }}
@@ -287,12 +287,12 @@ jobs:
sonar_secret: ${{ secrets.SONAR_TOKEN }}
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with:
fetch-depth: 0
- name: Restore node dependency cache
id: cache-dependencies
uses: actions/cache@v1
uses: actions/cache@627f0f41f6904a5b1efbaed9f96d9eb58e92e920 # v3.2.4
with:
path: ui/node_modules
key: ${{ runner.os }}-node-dep-v2-${{ hashFiles('**/yarn.lock') }}
@@ -303,16 +303,16 @@ jobs:
run: |
mkdir -p test-results
- name: Get code coverage artifiact
uses: actions/download-artifact@v2
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
name: code-coverage
- name: Get test result artifact
uses: actions/download-artifact@v2
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
name: test-results
path: test-results
- name: Upload code coverage information to codecov.io
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3.1.1
with:
file: coverage.out
- name: Perform static code analysis using SonarCloud
@@ -348,7 +348,7 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
k3s-version: [v1.24.3, v1.23.3, v1.22.6]
k3s-version: [v1.26.0, v1.25.4, v1.24.3, v1.23.3]
needs:
- build-go
env:
@@ -366,9 +366,9 @@ jobs:
GITLAB_TOKEN: ${{ secrets.E2E_TEST_GITLAB_TOKEN }}
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: Setup Golang
uses: actions/setup-go@v3
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
with:
go-version: ${{ env.GOLANG_VERSION }}
- name: GH actions workaround - Kill XSP4 process
@@ -386,7 +386,7 @@ jobs:
sudo chown runner $HOME/.kube/config
kubectl version
- name: Restore go build cache
uses: actions/cache@v1
uses: actions/cache@627f0f41f6904a5b1efbaed9f96d9eb58e92e920 # v3.2.4
with:
path: ~/.cache/go-build
key: ${{ runner.os }}-go-build-v1-${{ github.run_id }}
@@ -412,9 +412,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.35.3-distroless
docker pull ghcr.io/dexidp/dex:v2.35.3
docker pull argoproj/argo-cd-ci-builder:v1.0.0
docker pull redis:7.0.5-alpine
docker pull redis:7.0.7-alpine
- name: Create target directory for binaries in the build-process
run: |
mkdir -p dist
@@ -442,7 +442,7 @@ jobs:
set -x
make test-e2e-local
- name: Upload e2e-server logs
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: e2e-server-k8s${{ matrix.k3s-version }}.log
path: /tmp/e2e-server.log

View File

@@ -29,11 +29,11 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@8aff97f12c99086bdb92ff62ae06dbbcdf07941b # v2.1.33
# Override language selection by uncommenting this and choosing your languages
# with:
# languages: go, javascript, csharp, python, cpp, java
@@ -41,7 +41,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@v2
uses: github/codeql-action/autobuild@8aff97f12c99086bdb92ff62ae06dbbcdf07941b # v2.1.33
# Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
@@ -55,4 +55,4 @@ jobs:
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@8aff97f12c99086bdb92ff62ae06dbbcdf07941b # v2.1.33

View File

@@ -23,37 +23,38 @@ jobs:
publish:
permissions:
contents: write # for git to push upgrade commit if not already deployed
packages: write # for pushing packages to GHCR, which is used by cd.apps.argoproj.io to avoid polluting Quay with tags
if: github.repository == 'argoproj/argo-cd'
runs-on: ubuntu-22.04
env:
GOPATH: /home/runner/work/argo-cd/argo-cd
steps:
- uses: actions/setup-go@v3
- uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
with:
go-version: ${{ env.GOLANG_VERSION }}
- uses: actions/checkout@master
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with:
path: src/github.com/argoproj/argo-cd
# get image tag
- run: echo ::set-output name=tag::$(cat ./VERSION)-${GITHUB_SHA::8}
- run: echo "tag=$(cat ./VERSION)-${GITHUB_SHA::8}" >> $GITHUB_OUTPUT
working-directory: ./src/github.com/argoproj/argo-cd
id: image
# login
- run: |
docker login ghcr.io --username $USERNAME --password $PASSWORD
docker login quay.io --username "${DOCKER_USERNAME}" --password "${DOCKER_TOKEN}"
docker login ghcr.io --username $USERNAME --password-stdin <<< "$PASSWORD"
docker login quay.io --username "$DOCKER_USERNAME" --password-stdin <<< "$DOCKER_TOKEN"
if: github.event_name == 'push'
env:
USERNAME: ${{ secrets.USERNAME }}
PASSWORD: ${{ secrets.TOKEN }}
USERNAME: ${{ github.actor }}
PASSWORD: ${{ secrets.GITHUB_TOKEN }}
DOCKER_USERNAME: ${{ secrets.RELEASE_QUAY_USERNAME }}
DOCKER_TOKEN: ${{ secrets.RELEASE_QUAY_TOKEN }}
# build
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # v2.1.0
- uses: docker/setup-buildx-action@15c905b16b06416d2086efa066dd8e3a35cc7f98 # v2.4.0
- run: |
IMAGE_PLATFORMS=linux/amd64
if [[ "${{ github.event_name }}" == "push" || "${{ contains(github.event.pull_request.labels.*.name, 'test-arm-image') }}" == "true" ]]
@@ -61,20 +62,27 @@ jobs:
IMAGE_PLATFORMS=linux/amd64,linux/arm64,linux/s390x,linux/ppc64le
fi
echo "Building image for platforms: $IMAGE_PLATFORMS"
docker buildx build --platform $IMAGE_PLATFORMS --push="${{ github.event_name == 'push' }}" \
-t ghcr.io/argoproj/argocd:${{ steps.image.outputs.tag }} \
docker buildx build --platform $IMAGE_PLATFORMS --sbom=false --provenance=false --push="${{ github.event_name == 'push' }}" \
-t ghcr.io/argoproj/argo-cd/argocd:${{ steps.image.outputs.tag }} \
-t quay.io/argoproj/argocd:latest .
working-directory: ./src/github.com/argoproj/argo-cd
# sign container images
- name: Install cosign
uses: sigstore/cosign-installer@main
uses: sigstore/cosign-installer@9becc617647dfa20ae7b1151972e9b3a2c338a2b # v2.8.1
with:
cosign-release: 'v1.13.0'
cosign-release: 'v1.13.1'
- name: Install crane to get digest of image
uses: imjasonh/setup-crane@e82f1b9a8007d399333baba4d75915558e9fb6a4
- name: Get digest of image
run: |
echo "IMAGE_DIGEST=$(crane digest quay.io/argoproj/argocd:latest)" >> $GITHUB_ENV
- name: Sign Argo CD latest image
run: |
cosign sign --key env://COSIGN_PRIVATE_KEY quay.io/argoproj/argocd:latest
cosign sign --key env://COSIGN_PRIVATE_KEY quay.io/argoproj/argocd@${{ env.IMAGE_DIGEST }}
# Displays the public key to share.
cosign public-key --key env://COSIGN_PRIVATE_KEY
env:
@@ -88,7 +96,7 @@ jobs:
env:
TOKEN: ${{ secrets.TOKEN }}
- run: |
docker run -u $(id -u):$(id -g) -v $(pwd):/src -w /src --rm -t ghcr.io/argoproj/argocd:${{ steps.image.outputs.tag }} kustomize edit set image quay.io/argoproj/argocd=ghcr.io/argoproj/argocd:${{ steps.image.outputs.tag }}
docker run -u $(id -u):$(id -g) -v $(pwd):/src -w /src --rm -t ghcr.io/argoproj/argo-cd/argocd:${{ steps.image.outputs.tag }} kustomize edit set image quay.io/argoproj/argocd=ghcr.io/argoproj/argo-cd/argocd:${{ steps.image.outputs.tag }}
git config --global user.email 'ci@argoproj.com'
git config --global user.name 'CI'
git diff --exit-code && echo 'Already deployed' || (git commit -am 'Upgrade argocd to ${{ steps.image.outputs.tag }}' && git push)

41
.github/workflows/pr-title-check.yml vendored Normal file
View File

@@ -0,0 +1,41 @@
name: "Lint PR"
on:
pull_request_target:
types:
- opened
- edited
- synchronize
# IMPORTANT: No checkout actions, scripts, or builds should be added to this workflow. Permissions should always be used
# with extreme caution.
permissions:
contents: read
# PR updates can happen in quick succession leading to this
# workflow being trigger a number of times. This limits it
# to one run per PR.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
main:
permissions:
pull-requests: read # for amannn/action-semantic-pull-request to analyze PRs
statuses: write # for amannn/action-semantic-pull-request to mark status of analyzed PR
name: Validate PR title
runs-on: ubuntu-latest
steps:
# IMPORTANT: Carefully review changes when updating this action. Using the pull_request_target event requires caution.
- uses: amannn/action-semantic-pull-request@01d5fd8a8ebb9aafe902c40c53f0f4744f7381eb # v5.0.2
with:
types: |
feat
fix
docs
test
ci
chore
[Bot] docs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -12,7 +12,7 @@ on:
- "!release-v0*"
env:
GOLANG_VERSION: '1.18'
GOLANG_VERSION: '1.18'
permissions:
contents: read
@@ -43,7 +43,7 @@ jobs:
GIT_EMAIL: argoproj@gmail.com
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
@@ -147,7 +147,7 @@ jobs:
echo "RELEASE_NOTES=${RELEASE_NOTES}" >> $GITHUB_ENV
- name: Setup Golang
uses: actions/setup-go@v3
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
with:
go-version: ${{ env.GOLANG_VERSION }}
@@ -195,19 +195,19 @@ jobs:
QUAY_TOKEN: ${{ secrets.RELEASE_QUAY_TOKEN }}
run: |
set -ue
docker login quay.io --username "${QUAY_USERNAME}" --password "${QUAY_TOKEN}"
docker login quay.io --username "${QUAY_USERNAME}" --password-stdin <<< "${QUAY_TOKEN}"
# Remove the following when Docker Hub is gone
docker login --username "${DOCKER_USERNAME}" --password "${DOCKER_TOKEN}"
docker login --username "${DOCKER_USERNAME}" --password-stdin <<< "${DOCKER_TOKEN}"
if: ${{ env.DRY_RUN != 'true' }}
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # v2.1.0
- uses: docker/setup-buildx-action@15c905b16b06416d2086efa066dd8e3a35cc7f98 # v2.4.0
- name: Build and push Docker image for release
run: |
set -ue
git clean -fd
mkdir -p dist/
docker buildx build --platform linux/amd64,linux/arm64,linux/s390x,linux/ppc64le --push -t ${IMAGE_NAMESPACE}/argocd:v${TARGET_VERSION} -t argoproj/argocd:v${TARGET_VERSION} .
docker buildx build --platform linux/amd64,linux/arm64,linux/s390x,linux/ppc64le --sbom=false --provenance=false --push -t ${IMAGE_NAMESPACE}/argocd:v${TARGET_VERSION} -t argoproj/argocd:v${TARGET_VERSION} .
make release-cli
make checksums
chmod +x ./dist/argocd-linux-amd64
@@ -215,13 +215,20 @@ jobs:
if: ${{ env.DRY_RUN != 'true' }}
- name: Install cosign
uses: sigstore/cosign-installer@main
uses: sigstore/cosign-installer@9becc617647dfa20ae7b1151972e9b3a2c338a2b # v2.8.1
with:
cosign-release: 'v1.13.0'
cosign-release: 'v1.13.1'
- name: Install crane to get digest of image
uses: imjasonh/setup-crane@e82f1b9a8007d399333baba4d75915558e9fb6a4
- name: Get digest of image
run: |
echo "IMAGE_DIGEST=$(crane digest quay.io/argoproj/argocd:v${TARGET_VERSION})" >> $GITHUB_ENV
- name: Sign Argo CD container images and assets
run: |
cosign sign --key env://COSIGN_PRIVATE_KEY ${IMAGE_NAMESPACE}/argocd:v${TARGET_VERSION}
cosign sign --key env://COSIGN_PRIVATE_KEY ${IMAGE_NAMESPACE}/argocd@${{ env.IMAGE_DIGEST }}
cosign sign-blob --key env://COSIGN_PRIVATE_KEY ./dist/argocd-${TARGET_VERSION}-checksums.txt > ./dist/argocd-${TARGET_VERSION}-checksums.sig
# Retrieves the public key to release as an asset
cosign public-key --key env://COSIGN_PRIVATE_KEY > ./dist/argocd-cosign.pub
@@ -232,7 +239,7 @@ jobs:
- name: Read release notes file
id: release-notes
uses: juliangruber/read-file-action@v1
uses: juliangruber/read-file-action@02bbba9876a8f870efd4ad64e3b9088d3fb94d4b # v1.1.6
with:
path: ${{ env.RELEASE_NOTES }}
@@ -243,7 +250,7 @@ jobs:
git push origin ${RELEASE_TAG}
- name: Dry run GitHub release
uses: actions/create-release@v1
uses: actions/create-release@0cb9c9b65d5d1901c1f53e5e66eaf4afd303e70e # v1.1.4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
id: create_release
@@ -264,7 +271,7 @@ jobs:
SIGS_BOM_VERSION: v0.2.1
# comma delimited list of project relative folders to inspect for package
# managers (gomod, yarn, npm).
PROJECT_FOLDERS: ".,./ui"
PROJECT_FOLDERS: ".,./ui"
# full qualified name of the docker image to be inspected
DOCKER_IMAGE: ${{env.IMAGE_NAMESPACE}}/argocd:v${{env.TARGET_VERSION}}
run: |
@@ -295,7 +302,7 @@ jobs:
if: ${{ env.DRY_RUN != 'true' }}
- name: Create GitHub release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v0.1.15
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
@@ -303,7 +310,6 @@ jobs:
tag_name: ${{ env.RELEASE_TAG }}
draft: ${{ env.DRAFT_RELEASE }}
prerelease: ${{ env.PRE_RELEASE }}
generate_release_notes: true
body: ${{ steps.release-notes.outputs.content }} # Pre-pended to the generated notes
files: |
dist/argocd-*
@@ -314,7 +320,7 @@ jobs:
- name: Update homebrew formula
env:
HOMEBREW_TOKEN: ${{ secrets.RELEASE_HOMEBREW_TOKEN }}
uses: dawidd6/action-homebrew-bump-formula@v3
uses: dawidd6/action-homebrew-bump-formula@02e79d9da43d79efa846d73695b6052cbbdbf48a # v3.8.3
with:
token: ${{env.HOMEBREW_TOKEN}}
formula: argocd

View File

@@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Build reports
@@ -31,6 +31,6 @@ jobs:
git config --global user.email 'ci@argoproj.com'
git config --global user.name 'CI'
git add docs/snyk
git commit -m "[Bot] Update Snyk reports" --signoff
git commit -m "[Bot] docs: Update Snyk reports" --signoff
git push --set-upstream origin "$pr_branch"
gh pr create -B master -H "$pr_branch" --title '[Bot] docs: Update Snyk report' --body ''

View File

@@ -36,6 +36,8 @@ RUN ./install.sh helm-linux && \
####################################################################################################
FROM $BASE_IMAGE AS argocd-base
LABEL org.opencontainers.image.source="https://github.com/argoproj/argo-cd"
USER root
ENV ARGOCD_USER_ID=999

View File

@@ -64,13 +64,20 @@ else
DOCKER_SRC_MOUNT="$(PWD):/go/src/github.com/argoproj/argo-cd$(VOLUME_MOUNT)"
endif
# User and group IDs to map to the test container
CONTAINER_UID=$(shell id -u)
CONTAINER_GID=$(shell id -g)
# Set SUDO to sudo to run privileged commands with sudo
SUDO?=
# Runs any command in the argocd-test-utils container in server mode
# Server mode container will start with uid 0 and drop privileges during runtime
define run-in-test-server
docker run --rm -it \
$(SUDO) docker run --rm -it \
--name argocd-test-server \
-u $(shell id -u):$(shell id -g) \
-e USER_ID=$(shell id -u) \
-u $(CONTAINER_UID):$(CONTAINER_GID) \
-e USER_ID=$(CONTAINER_UID) \
-e HOME=/home/user \
-e GOPATH=/go \
-e GOCACHE=/tmp/go-build-cache \
@@ -98,9 +105,9 @@ endef
# Runs any command in the argocd-test-utils container in client mode
define run-in-test-client
docker run --rm -it \
$(SUDO) docker run --rm -it \
--name argocd-test-client \
-u $(shell id -u):$(shell id -g) \
-u $(CONTAINER_UID):$(CONTAINER_GID) \
-e HOME=/home/user \
-e GOPATH=/go \
-e ARGOCD_E2E_K3S=$(ARGOCD_E2E_K3S) \
@@ -119,7 +126,7 @@ endef
#
define exec-in-test-server
docker exec -it -u $(shell id -u):$(shell id -g) -e ARGOCD_E2E_RECORD=$(ARGOCD_E2E_RECORD) -e ARGOCD_E2E_K3S=$(ARGOCD_E2E_K3S) argocd-test-server $(1)
$(SUDO) docker exec -it -u $(CONTAINER_UID):$(CONTAINER_GID) -e ARGOCD_E2E_RECORD=$(ARGOCD_E2E_RECORD) -e ARGOCD_E2E_K3S=$(ARGOCD_E2E_K3S) argocd-test-server $(1)
endef
PATH:=$(PATH):$(PWD)/hack
@@ -244,8 +251,8 @@ release-cli: clean-debug build-ui
.PHONY: test-tools-image
test-tools-image:
ifndef SKIP_TEST_TOOLS_IMAGE
docker build --build-arg UID=$(shell id -u) -t $(TEST_TOOLS_PREFIX)$(TEST_TOOLS_IMAGE) -f test/container/Dockerfile .
docker tag $(TEST_TOOLS_PREFIX)$(TEST_TOOLS_IMAGE) $(TEST_TOOLS_PREFIX)$(TEST_TOOLS_IMAGE):$(TEST_TOOLS_TAG)
$(SUDO) docker build --build-arg UID=$(CONTAINER_UID) -t $(TEST_TOOLS_PREFIX)$(TEST_TOOLS_IMAGE) -f test/container/Dockerfile .
$(SUDO) docker tag $(TEST_TOOLS_PREFIX)$(TEST_TOOLS_IMAGE) $(TEST_TOOLS_PREFIX)$(TEST_TOOLS_IMAGE):$(TEST_TOOLS_TAG)
endif
.PHONY: manifests-local
@@ -326,7 +333,7 @@ mod-vendor: test-tools-image
mod-vendor-local: mod-download-local
go mod vendor
# Deprecated - replace by install-local-tools
# Deprecated - replace by install-tools-local
.PHONY: install-lint-tools
install-lint-tools:
./hack/install.sh lint-tools
@@ -512,7 +519,7 @@ build-docs-local:
.PHONY: build-docs
build-docs:
docker run ${MKDOCS_RUN_ARGS} --rm -it -p 8000:8000 -v ${CURRENT_DIR}:/docs ${MKDOCS_DOCKER_IMAGE} build
docker run ${MKDOCS_RUN_ARGS} --rm -it -v ${CURRENT_DIR}:/docs --entrypoint "" ${MKDOCS_DOCKER_IMAGE} sh -c 'pip install -r docs/requirements.txt; mkdocs build'
.PHONY: serve-docs-local
serve-docs-local:
@@ -520,7 +527,7 @@ serve-docs-local:
.PHONY: serve-docs
serve-docs:
docker run ${MKDOCS_RUN_ARGS} --rm -it -p 8000:8000 -v ${CURRENT_DIR}:/docs ${MKDOCS_DOCKER_IMAGE} serve -a 0.0.0.0:8000
docker run ${MKDOCS_RUN_ARGS} --rm -it -p 8000:8000 -v ${CURRENT_DIR}/site:/site -w /site --entrypoint "" ${MKDOCS_DOCKER_IMAGE} python3 -m http.server --bind 0.0.0.0 8000
# Verify that kubectl can connect to your K8s cluster from Docker

2
OWNERS
View File

@@ -27,3 +27,5 @@ reviewers:
- wanghong230
- ciiay
- saumeya
- zachaller
- 34fathombelow

View File

@@ -1,6 +1,17 @@
[![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) [![slack](https://img.shields.io/badge/slack-argoproj-brightgreen.svg?logo=slack)](https://argoproj.github.io/community/join-slack) [![codecov](https://codecov.io/gh/argoproj/argo-cd/branch/master/graph/badge.svg)](https://codecov.io/gh/argoproj/argo-cd) [![Release Version](https://img.shields.io/github/v/release/argoproj/argo-cd?label=argo-cd)](https://github.com/argoproj/argo-cd/releases/latest) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/4486/badge)](https://bestpractices.coreinfrastructure.org/projects/4486) [![Twitter Follow](https://img.shields.io/twitter/follow/argoproj?style=social)](https://twitter.com/argoproj)
**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)
**Code:**
[![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)
[![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:**
[![Twitter Follow](https://img.shields.io/twitter/follow/argoproj?style=social)](https://twitter.com/argoproj)
[![Slack](https://img.shields.io/badge/slack-argoproj-brightgreen.svg?logo=slack)](https://argoproj.github.io/community/join-slack)
# Argo CD - Declarative Continuous Delivery for Kubernetes
## What is Argo CD?

View File

@@ -1,7 +1,7 @@
# Defined below are the security contacts for this repo.
#
# DO NOT REPORT SECURITY VULNERABILITIES DIRECTLY TO THESE NAMES, FOLLOW THE
# INSTRUCTIONS AT https://argo-cd.readthedocs.io/en/latest/security_considerations/#reporting-vulnerabilities
# INSTRUCTIONS AT https://github.com/argoproj/argo-cd/security/policy
alexmt
edlee2121

View File

@@ -11,9 +11,11 @@ Currently, the following organizations are **officially** using Argo CD:
1. [Adevinta](https://www.adevinta.com/)
1. [Adfinis](https://adfinis.com)
1. [Adventure](https://jp.adventurekk.com/)
1. [AirQo](https://airqo.net/)
1. [Akuity](https://akuity.io/)
1. [Alibaba Group](https://www.alibabagroup.com/)
1. [Allianz Direct](https://www.allianzdirect.de/)
1. [Amadeus IT Group](https://amadeus.com/)
1. [Ambassador Labs](https://www.getambassador.io/)
1. [ANSTO - Australian Synchrotron](https://www.synchrotron.org.au/)
1. [Ant Group](https://www.antgroup.com/)
@@ -29,18 +31,21 @@ Currently, the following organizations are **officially** using Argo CD:
1. [BigPanda](https://bigpanda.io)
1. [BioBox Analytics](https://biobox.io)
1. [BMW Group](https://www.bmwgroup.com/)
1. [PT Boer Technology (Btech)](https://btech.id/)
1. [Boozt](https://www.booztgroup.com/)
1. [Boticario](https://www.boticario.com.br/)
1. [Bulder Bank](https://bulderbank.no)
1. [Camptocamp](https://camptocamp.com)
1. [Capital One](https://www.capitalone.com)
1. [CARFAX](https://www.carfax.com)
1. [CARFAX Europe](https://www.carfax.eu)
1. [Casavo](https://casavo.com)
1. [Celonis](https://www.celonis.com/)
1. [CERN](https://home.cern/)
1. [Chargetrip](https://chargetrip.com)
1. [Chime](https://www.chime.com)
1. [Cisco ET&I](https://eti.cisco.com/)
1. [Cloud Scale](https://cloudscaleinc.com/)
1. [Cobalt](https://www.cobalt.io/)
1. [Codefresh](https://www.codefresh.io/)
1. [Codility](https://www.codility.com/)
@@ -56,6 +61,8 @@ Currently, the following organizations are **officially** using Argo CD:
1. [Deutsche Telekom AG](https://telekom.com)
1. [Devopsi - Poland Software/DevOps Consulting](https://devopsi.pl/)
1. [Devtron Labs](https://github.com/devtron-labs/devtron)
1. [Divistant](https://divistant.com)
1. [Doximity](https://www.doximity.com/)
1. [EDF Renewables](https://www.edf-re.com/)
1. [edX](https://edx.org)
1. [Elastic](https://elastic.co/)
@@ -65,6 +72,7 @@ Currently, the following organizations are **officially** using Argo CD:
1. [END.](https://www.endclothing.com/)
1. [Energisme](https://energisme.com/)
1. [enigmo](https://enigmo.co.jp/)
1. [Envoy](https://envoy.com/)
1. [Faro](https://www.faro.com/)
1. [Fave](https://myfave.com)
1. [Flip](https://flip.id)
@@ -75,7 +83,8 @@ Currently, the following organizations are **officially** using Argo CD:
1. [G DATA CyberDefense AG](https://www.gdata-software.com/)
1. [Garner](https://www.garnercorp.com)
1. [Generali Deutschland AG](https://www.generali.de/)
2. [Gepardec](https://gepardec.com/)
1. [Gepardec](https://gepardec.com/)
1. [GetYourGuide](https://www.getyourguide.com/)
1. [Gitpod](https://www.gitpod.io)
1. [Gllue](https://gllue.com)
1. [gloat](https://gloat.com/)
@@ -97,6 +106,7 @@ Currently, the following organizations are **officially** using Argo CD:
1. [Ibotta](https://home.ibotta.com)
1. [IITS-Consulting](https://iits-consulting.de)
1. [imaware](https://imaware.health)
1. [Indeed](https://indeed.com)
1. [Index Exchange](https://www.indexexchange.com/)
1. [InsideBoard](https://www.insideboard.com)
1. [Intuit](https://www.intuit.com/)
@@ -116,6 +126,7 @@ Currently, the following organizations are **officially** using Argo CD:
1. [Kurly](https://www.kurly.com/)
1. [LexisNexis](https://www.lexisnexis.com/)
1. [Lian Chu Securities](https://lczq.com)
1. [Liatrio](https://www.liatrio.com)
1. [Lightricks](https://www.lightricks.com/)
1. [LINE](https://linecorp.com/en/)
1. [Lytt](https://www.lytt.co/)
@@ -128,6 +139,7 @@ Currently, the following organizations are **officially** using Argo CD:
1. [Max Kelsen](https://www.maxkelsen.com/)
1. [MeDirect](https://medirect.com.mt/)
1. [Meican](https://meican.com/)
1. [Mercedes-Benz Tech Innovation](https://www.mercedes-benz-techinnovation.com/)
1. [Metanet](http://www.metanet.co.kr/en/)
1. [MindSpore](https://mindspore.cn)
1. [Mirantis](https://mirantis.com/)
@@ -142,14 +154,17 @@ Currently, the following organizations are **officially** using Argo CD:
1. [Nextdoor](https://nextdoor.com/)
1. [Nikkei](https://www.nikkei.co.jp/nikkeiinfo/en/)
1. [Nitro](https://gonitro.com)
1. [Objective](https://www.objective.com.br/)
1. [OCCMundial](https://occ.com.mx)
1. [Octadesk](https://octadesk.com)
1. [omegaUp](https://omegaUp.com)
1. [Omni](https://omni.se/)
1. [openEuler](https://openeuler.org)
1. [openGauss](https://opengauss.org/)
1. [openLooKeng](https://openlookeng.io)
1. [OpenSaaS Studio](https://opensaas.studio)
1. [Opensurvey](https://www.opensurvey.co.kr/)
1. [OpsMx](https://opsmx.io)
1. [OpsVerse](https://opsverse.io)
1. [Optoro](https://www.optoro.com/)
1. [Orbital Insight](https://orbitalinsight.com/)
@@ -157,11 +172,15 @@ Currently, the following organizations are **officially** using Argo CD:
1. [Packlink](https://www.packlink.com/)
1. [Pandosearch](https://www.pandosearch.com/en/home)
1. [PagerDuty](https://www.pagerduty.com/)
1. [Patreon](https://www.patreon.com/)
1. [PayPay](https://paypay.ne.jp/)
1. [Peloton Interactive](https://www.onepeloton.com/)
1. [Pigment](https://www.gopigment.com/)
1. [Pipefy](https://www.pipefy.com/)
1. [Pismo](https://pismo.io/)
1. [Platform9 Systems](https://platform9.com/)
1. [Polarpoint.io](https://polarpoint.io)
1. [PostFinance](https://github.com/postfinance)
1. [Preferred Networks](https://preferred.jp/en/)
1. [Productboard](https://www.productboard.com/)
1. [Prudential](https://prudential.com.sg)
@@ -181,10 +200,13 @@ Currently, the following organizations are **officially** using Argo CD:
1. [Saildrone](https://www.saildrone.com/)
1. [Saloodo! GmbH](https://www.saloodo.com)
1. [Sap Labs](http://sap.com)
1. [Sauce Labs](https://saucelabs.com/)
1. [Schwarz IT](https://jobs.schwarz/it-mission)
1. [SI Analytics](https://si-analytics.ai)
1. [Skit](https://skit.ai/)
1. [Skyscanner](https://www.skyscanner.net/)
1. [Smilee.io](https://smilee.io)
1. [Smood.ch](https://www.smood.ch/)
1. [Snapp](https://snapp.ir/)
1. [Snyk](https://snyk.io/)
1. [Softway Medical](https://www.softwaymedical.fr/)
@@ -213,6 +235,7 @@ Currently, the following organizations are **officially** using Argo CD:
1. [Toss](https://toss.im/en)
1. [Trendyol](https://www.trendyol.com/)
1. [tru.ID](https://tru.id)
1. [Trusting Social](https://trustingsocial.com/)
1. [Twilio SendGrid](https://sendgrid.com)
1. [tZERO](https://www.tzero.com/)
1. [UBIO](https://ub.io/)
@@ -221,9 +244,11 @@ Currently, the following organizations are **officially** using Argo CD:
1. [Unifonic Inc](https://www.unifonic.com/)
1. [Universidad Mesoamericana](https://www.umes.edu.gt/)
1. [Viaduct](https://www.viaduct.ai/)
1. [Vinted](https://vinted.com/)
1. [Virtuo](https://www.govirtuo.com/)
1. [VISITS Technologies](https://visits.world/en)
1. [Volvo Cars](https://www.volvocars.com/)
1. [Voyager Digital](https://www.investvoyager.com/)
1. [VSHN - The DevOps Company](https://vshn.ch/)
1. [Walkbase](https://www.walkbase.com/)
1. [Webstores](https://www.webstores.nl)
@@ -232,6 +257,7 @@ Currently, the following organizations are **officially** using Argo CD:
1. [WeMo Scooter](https://www.wemoscooter.com/)
1. [Whitehat Berlin](https://whitehat.berlin) by Guido Maria Serra +Fenaroli
1. [Witick](https://witick.io/)
1. [Wolffun Game](https://www.wolffungame.com/)
1. [WooliesX](https://wooliesx.com.au/)
1. [Woolworths Group](https://www.woolworthsgroup.com.au/)
1. [WSpot](https://www.wspot.com.br/)

View File

@@ -1 +1 @@
2.5.0
2.6.0

View File

@@ -25,6 +25,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/intstr"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/tools/record"
ctrl "sigs.k8s.io/controller-runtime"
@@ -69,6 +70,8 @@ type ApplicationSetReconciler struct {
KubeClientset kubernetes.Interface
utils.Policy
utils.Renderer
EnableProgressiveSyncs bool
}
// +kubebuilder:rbac:groups=argoproj.io,resources=applicationsets,verbs=get;list;watch;create;update;patch;delete
@@ -134,6 +137,27 @@ func (r *ApplicationSetReconciler) Reconcile(ctx context.Context, req ctrl.Reque
return ctrl.Result{RequeueAfter: ReconcileRequeueOnValidationError}, nil
}
// 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.
appSyncMap := map[string]bool{}
if r.EnableProgressiveSyncs && applicationSetInfo.Spec.Strategy != nil {
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 {
appMap[app.Name] = app
}
appSyncMap, err = r.performProgressiveSyncs(ctx, applicationSetInfo, applications, desiredApplications, appMap)
if err != nil {
return ctrl.Result{}, fmt.Errorf("failed to perform progressive sync reconciliation for application set: %w", err)
}
}
var validApps []argov1alpha1.Application
for i := range desiredApplications {
if validateErrors[i] == nil {
@@ -162,6 +186,26 @@ func (r *ApplicationSetReconciler) Reconcile(ctx context.Context, req ctrl.Reque
)
}
if r.EnableProgressiveSyncs {
// trigger appropriate application syncs if RollingSync strategy is enabled
if progressiveSyncsStrategyEnabled(&applicationSetInfo, "RollingSync") {
validApps, err = r.syncValidApplications(ctx, &applicationSetInfo, appSyncMap, appMap, validApps)
if err != nil {
_ = r.setApplicationSetStatusCondition(ctx,
&applicationSetInfo,
argov1alpha1.ApplicationSetCondition{
Type: argov1alpha1.ApplicationSetConditionErrorOccurred,
Message: err.Error(),
Reason: argov1alpha1.ApplicationSetReasonSyncApplicationError,
Status: argov1alpha1.ApplicationSetConditionStatusTrue,
}, parametersGenerated,
)
return ctrl.Result{}, err
}
}
}
if r.Policy.Update() {
err = r.createOrUpdateInCluster(ctx, applicationSetInfo, validApps)
if err != nil {
@@ -528,6 +572,11 @@ func (r *ApplicationSetReconciler) createOrUpdateInCluster(ctx context.Context,
// Copy only the Application/ObjectMeta fields that are significant, from the generatedApp
found.Spec = generatedApp.Spec
// allow setting the Operation field to trigger a sync operation on an Application
if generatedApp.Operation != nil {
found.Operation = generatedApp.Operation
}
// Preserve specially treated argo cd annotations:
// * https://github.com/argoproj/applicationset/issues/180
// * https://github.com/argoproj/argo-cd/issues/10500
@@ -726,4 +775,541 @@ func (r *ApplicationSetReconciler) removeFinalizerOnInvalidDestination(ctx conte
return nil
}
func (r *ApplicationSetReconciler) performProgressiveSyncs(ctx context.Context, appset argov1alpha1.ApplicationSet, applications []argov1alpha1.Application, desiredApplications []argov1alpha1.Application, appMap map[string]argov1alpha1.Application) (map[string]bool, error) {
appDependencyList, appStepMap, err := r.buildAppDependencyList(ctx, appset, desiredApplications)
if err != nil {
return nil, fmt.Errorf("failed to build app dependency list: %w", err)
}
_, err = r.updateApplicationSetApplicationStatus(ctx, &appset, applications, appStepMap)
if err != nil {
return nil, fmt.Errorf("failed to update applicationset app status: %w", err)
}
log.Infof("ApplicationSet %v step list:", appset.Name)
for i, step := range appDependencyList {
log.Infof("step %v: %+v", i+1, step)
}
appSyncMap, err := r.buildAppSyncMap(ctx, appset, appDependencyList, appMap)
if err != nil {
return nil, fmt.Errorf("failed to build app sync map: %w", err)
}
log.Infof("Application allowed to sync before maxUpdate?: %+v", appSyncMap)
_, err = r.updateApplicationSetApplicationStatusProgress(ctx, &appset, appSyncMap, appStepMap, appMap)
if err != nil {
return nil, fmt.Errorf("failed to update applicationset application status progress: %w", err)
}
_, err = r.updateApplicationSetApplicationStatusConditions(ctx, &appset)
if err != nil {
return nil, fmt.Errorf("failed to update applicationset application status conditions: %w", err)
}
return appSyncMap, nil
}
// this list tracks which Applications belong to each RollingUpdate step
func (r *ApplicationSetReconciler) buildAppDependencyList(ctx context.Context, 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
}
steps := []argov1alpha1.ApplicationSetRolloutStep{}
if progressiveSyncsStrategyEnabled(&applicationSet, "RollingSync") {
steps = applicationSet.Spec.Strategy.RollingSync.Steps
}
appDependencyList := make([][]string, 0)
for range steps {
appDependencyList = append(appDependencyList, make([]string, 0))
}
appStepMap := map[string]int{}
// 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
allNotInMatched := true // needed to support correct AND behavior between multiple NotIn MatchExpressions
notInUsed := false // since we default to allNotInMatched == true, track whether a NotIn expression was actually used
for _, matchExpression := range step.MatchExpressions {
if matchExpression.Operator == "In" {
if val, ok := app.Labels[matchExpression.Key]; ok {
valueMatched := labelMatchedExpression(val, matchExpression)
if !valueMatched { // none of the matchExpression values was a match with the Application'ss labels
selected = false
break
}
} else {
selected = false // no matching label key with In means this Application will not be included in the current step
break
}
} else if matchExpression.Operator == "NotIn" {
notInUsed = true // a NotIn selector was used in this matchExpression
if val, ok := app.Labels[matchExpression.Key]; ok {
valueMatched := labelMatchedExpression(val, matchExpression)
if !valueMatched { // none of the matchExpression values was a match with the Application's labels
allNotInMatched = false
}
} else {
allNotInMatched = false // no matching label key with NotIn means this Application may still be included in the current step
}
} else { // handle invalid operator selection
log.Warnf("skipping AppSet rollingUpdate step Application selection for %q, invalid matchExpression operator provided: %q ", applicationSet.Name, matchExpression.Operator)
selected = false
break
}
}
if notInUsed && allNotInMatched { // check if all NotIn Expressions matched, if so exclude this Application
selected = false
}
if selected {
appDependencyList[i] = append(appDependencyList[i], app.Name)
if val, ok := appStepMap[app.Name]; ok {
log.Warnf("AppSet '%v' has a invalid matchExpression that selects Application '%v' label twice, in steps %v and %v", applicationSet.Name, app.Name, val+1, i+1)
} else {
appStepMap[app.Name] = i
}
}
}
}
return appDependencyList, appStepMap, nil
}
func labelMatchedExpression(val string, matchExpression argov1alpha1.ApplicationMatchExpression) bool {
valueMatched := false
for _, value := range matchExpression.Values {
if val == value {
valueMatched = true
break
}
}
return valueMatched
}
// this map is used to determine which stage of Applications are ready to be updated in the reconciler loop
func (r *ApplicationSetReconciler) buildAppSyncMap(ctx context.Context, applicationSet argov1alpha1.ApplicationSet, appDependencyList [][]string, appMap map[string]argov1alpha1.Application) (map[string]bool, error) {
appSyncMap := map[string]bool{}
syncEnabled := true
// healthy stages and the first non-healthy stage should have sync enabled
// every stage after should have sync disabled
for i := range appDependencyList {
// set the syncEnabled boolean for every Application in the current step
for _, appName := range appDependencyList[i] {
appSyncMap[appName] = syncEnabled
}
// 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
syncEnabled = false
break
}
appStatus := applicationSet.Status.ApplicationStatus[idx]
if app, ok := appMap[appName]; ok {
syncEnabled = appSyncEnabledForNextStep(&applicationSet, app, appStatus)
if !syncEnabled {
break
}
} else {
// application name not found in the list of applications managed by this ApplicationSet, maybe because it's being deleted
syncEnabled = false
break
}
}
}
return appSyncMap, nil
}
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"
}
return true
}
func progressiveSyncsStrategyEnabled(appset *argov1alpha1.ApplicationSet, strategyType string) bool {
if appset.Spec.Strategy == nil || appset.Spec.Strategy.Type != strategyType {
return false
}
if strategyType == "RollingSync" && appset.Spec.Strategy.RollingSync == nil {
return false
}
return true
}
func isApplicationHealthy(app argov1alpha1.Application) bool {
healthStatusString, syncStatusString, operationPhaseString := statusStrings(app)
if healthStatusString == "Healthy" && syncStatusString != "OutOfSync" && (operationPhaseString == "Succeeded" || operationPhaseString == "") {
return true
}
return false
}
func statusStrings(app argov1alpha1.Application) (string, string, string) {
healthStatusString := string(app.Status.Health.Status)
syncStatusString := string(app.Status.Sync.Status)
operationPhaseString := ""
if app.Status.OperationState != nil {
operationPhaseString = string(app.Status.OperationState.Phase)
}
return healthStatusString, syncStatusString, operationPhaseString
}
// check the status of each Application's status and promote Applications to the next status if needed
func (r *ApplicationSetReconciler) updateApplicationSetApplicationStatus(ctx context.Context, 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)
currentAppStatus := argov1alpha1.ApplicationSetApplicationStatus{}
if idx == -1 {
// AppStatus not found, set default status of "Waiting"
currentAppStatus = argov1alpha1.ApplicationSetApplicationStatus{
Application: app.Name,
LastTransitionTime: &now,
Message: "No Application status found, defaulting status to Waiting.",
Status: "Waiting",
Step: fmt.Sprint(appStepMap[app.Name] + 1),
}
} else {
// we have an existing AppStatus
currentAppStatus = applicationSet.Status.ApplicationStatus[idx]
}
appOutdated := false
if progressiveSyncsStrategyEnabled(applicationSet, "RollingSync") {
appOutdated = syncStatusString == "OutOfSync"
}
if appOutdated && currentAppStatus.Status != "Waiting" && currentAppStatus.Status != "Pending" {
log.Infof("Application %v is outdated, updating its ApplicationSet status to Waiting", app.Name)
currentAppStatus.LastTransitionTime = &now
currentAppStatus.Status = "Waiting"
currentAppStatus.Message = "Application has pending changes, setting status to Waiting."
currentAppStatus.Step = fmt.Sprint(appStepMap[currentAppStatus.Application] + 1)
}
if currentAppStatus.Status == "Pending" {
if operationPhaseString == "Succeeded" && app.Status.OperationState.StartedAt.After(currentAppStatus.LastTransitionTime.Time) {
log.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" {
log.Infof("Application %v has entered Progressing status, updating its ApplicationSet status to Progressing", app.Name)
currentAppStatus.LastTransitionTime = &now
currentAppStatus.Status = "Progressing"
currentAppStatus.Message = "Application resource became Progressing, updating status from Pending to Progressing."
currentAppStatus.Step = fmt.Sprint(appStepMap[currentAppStatus.Application] + 1)
}
}
if currentAppStatus.Status == "Waiting" && isApplicationHealthy(app) {
log.Infof("Application %v is already synced and healthy, updating its ApplicationSet status to Healthy", app.Name)
currentAppStatus.LastTransitionTime = &now
currentAppStatus.Status = healthStatusString
currentAppStatus.Message = "Application resource is already Healthy, updating status from Waiting to Healthy."
currentAppStatus.Step = fmt.Sprint(appStepMap[currentAppStatus.Application] + 1)
}
if currentAppStatus.Status == "Progressing" && isApplicationHealthy(app) {
log.Infof("Application %v has completed Progressing status, updating its ApplicationSet status to Healthy", app.Name)
currentAppStatus.LastTransitionTime = &now
currentAppStatus.Status = healthStatusString
currentAppStatus.Message = "Application resource became Healthy, updating status from Progressing to Healthy."
currentAppStatus.Step = fmt.Sprint(appStepMap[currentAppStatus.Application] + 1)
}
appStatuses = append(appStatuses, currentAppStatus)
}
err := r.setAppSetApplicationStatus(ctx, applicationSet, appStatuses)
if err != nil {
return nil, fmt.Errorf("failed to set AppSet application statuses: %w", err)
}
return appStatuses, nil
}
// check Applications that are in Waiting status and promote them to Pending if needed
func (r *ApplicationSetReconciler) updateApplicationSetApplicationStatusProgress(ctx context.Context, applicationSet *argov1alpha1.ApplicationSet, appSyncMap map[string]bool, appStepMap map[string]int, appMap map[string]argov1alpha1.Application) ([]argov1alpha1.ApplicationSetApplicationStatus, error) {
now := metav1.Now()
appStatuses := make([]argov1alpha1.ApplicationSetApplicationStatus, 0, len(applicationSet.Status.ApplicationStatus))
// if we have no RollingUpdate steps, clear out the existing ApplicationStatus entries
if applicationSet.Spec.Strategy != nil && applicationSet.Spec.Strategy.Type != "" && applicationSet.Spec.Strategy.Type != "AllAtOnce" {
updateCountMap := []int{}
totalCountMap := []int{}
length := 0
if progressiveSyncsStrategyEnabled(applicationSet, "RollingSync") {
length = len(applicationSet.Spec.Strategy.RollingSync.Steps)
}
for s := 0; s < length; s++ {
updateCountMap = append(updateCountMap, 0)
totalCountMap = append(totalCountMap, 0)
}
// populate updateCountMap with counts of existing Pending and Progressing Applications
for _, appStatus := range applicationSet.Status.ApplicationStatus {
totalCountMap[appStepMap[appStatus.Application]] += 1
if progressiveSyncsStrategyEnabled(applicationSet, "RollingSync") {
if appStatus.Status == "Pending" || appStatus.Status == "Progressing" {
updateCountMap[appStepMap[appStatus.Application]] += 1
}
}
}
for _, appStatus := range applicationSet.Status.ApplicationStatus {
maxUpdateAllowed := true
maxUpdate := &intstr.IntOrString{}
if progressiveSyncsStrategyEnabled(applicationSet, "RollingSync") {
maxUpdate = applicationSet.Spec.Strategy.RollingSync.Steps[appStepMap[appStatus.Application]].MaxUpdate
}
// by default allow all applications to update if maxUpdate is unset
if maxUpdate != nil {
maxUpdateVal, err := intstr.GetScaledValueFromIntOrPercent(maxUpdate, totalCountMap[appStepMap[appStatus.Application]], false)
if err != nil {
log.Warnf("AppSet '%v' has a invalid maxUpdate value '%+v', ignoring maxUpdate logic for this step: %v", applicationSet.Name, maxUpdate, err)
}
// ensure that percentage values greater than 0% always result in at least 1 Application being selected
if maxUpdate.Type == intstr.String && maxUpdate.StrVal != "0%" && maxUpdateVal < 1 {
maxUpdateVal = 1
}
if updateCountMap[appStepMap[appStatus.Application]] >= maxUpdateVal {
maxUpdateAllowed = false
log.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 {
log.Infof("Application %v moved to Pending status, watching for the Application to start Progressing", appStatus.Application)
appStatus.LastTransitionTime = &now
appStatus.Status = "Pending"
appStatus.Message = "Application moved to Pending status, watching for the Application resource to start Progressing."
appStatus.Step = fmt.Sprint(appStepMap[appStatus.Application] + 1)
updateCountMap[appStepMap[appStatus.Application]] += 1
}
appStatuses = append(appStatuses, appStatus)
}
}
err := r.setAppSetApplicationStatus(ctx, applicationSet, appStatuses)
if err != nil {
return nil, fmt.Errorf("failed to set AppSet app status: %w", err)
}
return appStatuses, nil
}
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" {
appSetProgressing = true
break
}
}
appSetConditionProgressing := false
for _, appSetCondition := range applicationSet.Status.Conditions {
if appSetCondition.Type == argov1alpha1.ApplicationSetConditionRolloutProgressing && appSetCondition.Status == argov1alpha1.ApplicationSetConditionStatusTrue {
appSetConditionProgressing = true
break
}
}
if appSetProgressing && !appSetConditionProgressing {
_ = r.setApplicationSetStatusCondition(ctx,
applicationSet,
argov1alpha1.ApplicationSetCondition{
Type: argov1alpha1.ApplicationSetConditionRolloutProgressing,
Message: "ApplicationSet Rollout Rollout started",
Reason: argov1alpha1.ApplicationSetReasonApplicationSetModified,
Status: argov1alpha1.ApplicationSetConditionStatusTrue,
}, false,
)
} else if !appSetProgressing && appSetConditionProgressing {
_ = r.setApplicationSetStatusCondition(ctx,
applicationSet,
argov1alpha1.ApplicationSetCondition{
Type: argov1alpha1.ApplicationSetConditionRolloutProgressing,
Message: "ApplicationSet Rollout Rollout complete",
Reason: argov1alpha1.ApplicationSetReasonApplicationSetRolloutComplete,
Status: argov1alpha1.ApplicationSetConditionStatusFalse,
}, false,
)
}
return applicationSet.Status.Conditions, nil
}
func findApplicationStatusIndex(appStatuses []argov1alpha1.ApplicationSetApplicationStatus, application string) int {
for i := range appStatuses {
if appStatuses[i].Application == application {
return i
}
}
return -1
}
// setApplicationSetApplicationStatus updates the ApplicatonSet's status field
// with any new/changed Application statuses.
func (r *ApplicationSetReconciler) setAppSetApplicationStatus(ctx context.Context, applicationSet *argov1alpha1.ApplicationSet, applicationStatuses []argov1alpha1.ApplicationSetApplicationStatus) error {
needToUpdateStatus := false
for i := range applicationStatuses {
appStatus := applicationStatuses[i]
idx := findApplicationStatusIndex(applicationSet.Status.ApplicationStatus, appStatus.Application)
if idx == -1 {
needToUpdateStatus = true
break
}
currentStatus := applicationSet.Status.ApplicationStatus[idx]
if currentStatus.Message != appStatus.Message || currentStatus.Status != appStatus.Status {
needToUpdateStatus = true
break
}
}
if needToUpdateStatus {
// fetch updated Application Set object before updating it
namespacedName := types.NamespacedName{Namespace: applicationSet.Namespace, Name: applicationSet.Name}
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)
}
for i := range applicationStatuses {
applicationSet.Status.SetApplicationStatus(applicationStatuses[i])
}
// Update the newly fetched object with new set of ApplicationStatus
err := r.Client.Status().Update(ctx, applicationSet)
if err != nil {
log.Errorf("unable to set application set status: %v", err)
return fmt.Errorf("unable to set application set status: %v", 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 nil
}
func (r *ApplicationSetReconciler) syncValidApplications(ctx context.Context, applicationSet *argov1alpha1.ApplicationSet, appSyncMap map[string]bool, appMap map[string]argov1alpha1.Application, validApps []argov1alpha1.Application) ([]argov1alpha1.Application, error) {
rolloutApps := []argov1alpha1.Application{}
for i := range validApps {
pruneEnabled := false
// ensure that Applications generated with RollingSync do not have an automated sync policy, since the AppSet controller will handle triggering the sync operation instead
if validApps[i].Spec.SyncPolicy != nil && validApps[i].Spec.SyncPolicy.Automated != nil {
pruneEnabled = validApps[i].Spec.SyncPolicy.Automated.Prune
validApps[i].Spec.SyncPolicy.Automated = nil
}
appSetStatusPending := false
idx := findApplicationStatusIndex(applicationSet.Status.ApplicationStatus, validApps[i].Name)
if idx > -1 && applicationSet.Status.ApplicationStatus[idx].Status == "Pending" {
// only trigger a sync for Applications that are in Pending status, since this is governed by maxUpdate
appSetStatusPending = true
}
// check appSyncMap to determine which Applications are ready to be updated and which should be skipped
if appSyncMap[validApps[i].Name] && appMap[validApps[i].Name].Status.Sync.Status == "OutOfSync" && appSetStatusPending {
log.Infof("triggering sync for application: %v, prune enabled: %v", validApps[i].Name, pruneEnabled)
validApps[i], _ = syncApplication(validApps[i], pruneEnabled)
}
rolloutApps = append(rolloutApps, validApps[i])
}
return rolloutApps, nil
}
// 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",
Automated: true,
},
Info: []*argov1alpha1.Info{
{
Name: "Reason",
Value: "ApplicationSet RollingSync triggered a sync of this Application resource.",
},
},
Sync: &argov1alpha1.SyncOperation{},
}
if application.Spec.SyncPolicy != nil {
if application.Spec.SyncPolicy.Retry != nil {
operation.Retry = *application.Spec.SyncPolicy.Retry
}
if application.Spec.SyncPolicy.SyncOptions != nil {
operation.Sync.SyncOptions = application.Spec.SyncPolicy.SyncOptions
}
operation.Sync.Prune = prune
}
application.Operation = &operation
return application, nil
}
var _ handler.EventHandler = &clusterSecretEventHandler{}

File diff suppressed because it is too large Load Diff

View File

@@ -23,6 +23,8 @@ spec:
template:
metadata:
name: 'myapp-{{ .branch }}-{{ .number }}'
labels:
key1: '{{ index .labels 0 }}'
spec:
source:
repoURL: 'https://github.com/myorg/myrepo.git'

View File

@@ -85,6 +85,7 @@ func (g *GitGenerator) generateParamsForGitDirectories(appSetGenerator *argoproj
"total": len(allPaths),
"repoURL": appSetGenerator.Git.RepoURL,
"revision": appSetGenerator.Git.Revision,
"pathParamPrefix": appSetGenerator.Git.PathParamPrefix,
}).Info("applications result from the repo service")
requestedApps := g.filterApps(appSetGenerator.Git.Directories, allPaths)
@@ -121,7 +122,7 @@ func (g *GitGenerator) generateParamsForGitFiles(appSetGenerator *argoprojiov1al
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], useGoTemplate)
paramsArray, err := g.generateParamsFromGitFile(path, allFiles[path], useGoTemplate, appSetGenerator.Git.PathParamPrefix)
if err != nil {
return nil, fmt.Errorf("unable to process file '%s': %v", path, err)
}
@@ -133,7 +134,7 @@ func (g *GitGenerator) generateParamsForGitFiles(appSetGenerator *argoprojiov1al
return res, nil
}
func (g *GitGenerator) generateParamsFromGitFile(filePath string, fileContent []byte, useGoTemplate bool) ([]map[string]interface{}, error) {
func (g *GitGenerator) generateParamsFromGitFile(filePath string, fileContent []byte, useGoTemplate bool, pathParamPrefix string) ([]map[string]interface{}, error) {
objectsFound := []map[string]interface{}{}
// First, we attempt to parse as an array
@@ -167,7 +168,11 @@ func (g *GitGenerator) generateParamsFromGitFile(filePath string, fileContent []
paramPath["basenameNormalized"] = utils.SanitizeName(path.Base(paramPath["path"].(string)))
paramPath["filenameNormalized"] = utils.SanitizeName(path.Base(paramPath["filename"].(string)))
paramPath["segments"] = strings.Split(paramPath["path"].(string), "/")
params["path"] = paramPath
if pathParamPrefix != "" {
params[pathParamPrefix] = map[string]interface{}{"path": paramPath}
} else {
params["path"] = paramPath
}
} else {
flat, err := flatten.Flatten(objectFound, "", flatten.DotStyle)
if err != nil {
@@ -176,14 +181,18 @@ func (g *GitGenerator) generateParamsFromGitFile(filePath string, fileContent []
for k, v := range flat {
params[k] = fmt.Sprintf("%v", v)
}
params["path"] = path.Dir(filePath)
params["path.basename"] = path.Base(params["path"].(string))
params["path.filename"] = path.Base(filePath)
params["path.basenameNormalized"] = utils.SanitizeName(path.Base(params["path"].(string)))
params["path.filenameNormalized"] = utils.SanitizeName(path.Base(params["path.filename"].(string)))
for k, v := range strings.Split(params["path"].(string), "/") {
pathParamName := "path"
if pathParamPrefix != "" {
pathParamName = pathParamPrefix+"."+pathParamName
}
params[pathParamName] = path.Dir(filePath)
params[pathParamName+".basename"] = path.Base(params[pathParamName].(string))
params[pathParamName+".filename"] = path.Base(filePath)
params[pathParamName+".basenameNormalized"] = utils.SanitizeName(path.Base(params[pathParamName].(string)))
params[pathParamName+".filenameNormalized"] = utils.SanitizeName(path.Base(params[pathParamName+".filename"].(string)))
for k, v := range strings.Split(params[pathParamName].(string), "/") {
if len(v) > 0 {
params["path["+strconv.Itoa(k)+"]"] = v
params[pathParamName+"["+strconv.Itoa(k)+"]"] = v
}
}
}
@@ -192,7 +201,6 @@ func (g *GitGenerator) generateParamsFromGitFile(filePath string, fileContent []
}
return res, nil
}
func (g *GitGenerator) filterApps(Directories []argoprojiov1alpha1.GitDirectoryGeneratorItem, allPaths []string) []string {
@@ -223,9 +231,7 @@ func (g *GitGenerator) filterApps(Directories []argoprojiov1alpha1.GitDirectoryG
return res
}
func (g *GitGenerator) generateParamsFromApps(requestedApps []string, _ *argoprojiov1alpha1.ApplicationSetGenerator, useGoTemplate bool) []map[string]interface{} {
// TODO: At some point, the applicationSetGenerator param should be used
func (g *GitGenerator) generateParamsFromApps(requestedApps []string, appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator, useGoTemplate bool) []map[string]interface{} {
res := make([]map[string]interface{}, len(requestedApps))
for i, a := range requestedApps {
@@ -237,14 +243,22 @@ func (g *GitGenerator) generateParamsFromApps(requestedApps []string, _ *argopro
paramPath["basename"] = path.Base(a)
paramPath["basenameNormalized"] = utils.SanitizeName(path.Base(a))
paramPath["segments"] = strings.Split(paramPath["path"].(string), "/")
params["path"] = paramPath
if appSetGenerator.Git.PathParamPrefix != "" {
params[appSetGenerator.Git.PathParamPrefix] = map[string]interface{}{"path": paramPath}
} else {
params["path"] = paramPath
}
} else {
params["path"] = a
params["path.basename"] = path.Base(a)
params["path.basenameNormalized"] = utils.SanitizeName(path.Base(a))
for k, v := range strings.Split(params["path"].(string), "/") {
pathParamName := "path"
if appSetGenerator.Git.PathParamPrefix != "" {
pathParamName = appSetGenerator.Git.PathParamPrefix+"."+pathParamName
}
params[pathParamName] = a
params[pathParamName+".basename"] = path.Base(a)
params[pathParamName+".basenameNormalized"] = utils.SanitizeName(path.Base(a))
for k, v := range strings.Split(params[pathParamName].(string), "/") {
if len(v) > 0 {
params["path["+strconv.Itoa(k)+"]"] = v
params[pathParamName+"["+strconv.Itoa(k)+"]"] = v
}
}
}

View File

@@ -51,7 +51,7 @@ func Test_generateParamsFromGitFile(t *testing.T) {
params, err := (*GitGenerator)(nil).generateParamsFromGitFile("path/dir/file_name.yaml", []byte(`
foo:
bar: baz
`), false)
`), false, "")
if err != nil {
t.Fatal(err)
}
@@ -69,11 +69,33 @@ foo:
}, params)
}
func Test_generatePrefixedParamsFromGitFile(t *testing.T) {
params, err := (*GitGenerator)(nil).generateParamsFromGitFile("path/dir/file_name.yaml", []byte(`
foo:
bar: baz
`), false, "myRepo")
if err != nil {
t.Fatal(err)
}
assert.Equal(t, []map[string]interface{}{
{
"foo.bar": "baz",
"myRepo.path": "path/dir",
"myRepo.path.basename": "dir",
"myRepo.path.filename": "file_name.yaml",
"myRepo.path.basenameNormalized": "dir",
"myRepo.path.filenameNormalized": "file-name.yaml",
"myRepo.path[0]": "path",
"myRepo.path[1]": "dir",
},
}, params)
}
func Test_generateParamsFromGitFileGoTemplate(t *testing.T) {
params, err := (*GitGenerator)(nil).generateParamsFromGitFile("path/dir/file_name.yaml", []byte(`
foo:
bar: baz
`), true)
`), true, "")
if err != nil {
t.Fatal(err)
}
@@ -97,15 +119,46 @@ foo:
}, params)
}
func Test_generatePrefixedParamsFromGitFileGoTemplate(t *testing.T) {
params, err := (*GitGenerator)(nil).generateParamsFromGitFile("path/dir/file_name.yaml", []byte(`
foo:
bar: baz
`), true, "myRepo")
if err != nil {
t.Fatal(err)
}
assert.Equal(t, []map[string]interface{}{
{
"foo": map[string]interface{}{
"bar": "baz",
},
"myRepo": map[string]interface{}{
"path": map[string]interface{}{
"path": "path/dir",
"basename": "dir",
"filename": "file_name.yaml",
"basenameNormalized": "dir",
"filenameNormalized": "file-name.yaml",
"segments": []string{
"path",
"dir",
},
},
},
},
}, params)
}
func TestGitGenerateParamsFromDirectories(t *testing.T) {
cases := []struct {
name string
directories []argoprojiov1alpha1.GitDirectoryGeneratorItem
repoApps []string
repoError error
expected []map[string]interface{}
expectedError error
name string
directories []argoprojiov1alpha1.GitDirectoryGeneratorItem
pathParamPrefix string
repoApps []string
repoError error
expected []map[string]interface{}
expectedError error
}{
{
name: "happy flow - created apps",
@@ -124,6 +177,24 @@ func TestGitGenerateParamsFromDirectories(t *testing.T) {
},
expectedError: nil,
},
{
name: "It prefixes path parameters with PathParamPrefix",
directories: []argoprojiov1alpha1.GitDirectoryGeneratorItem{{Path: "*"}},
pathParamPrefix: "myRepo",
repoApps: []string{
"app1",
"app2",
"app_3",
"p1/app4",
},
repoError: nil,
expected: []map[string]interface{}{
{"myRepo.path": "app1", "myRepo.path.basename": "app1", "myRepo.path.basenameNormalized": "app1", "myRepo.path[0]": "app1"},
{"myRepo.path": "app2", "myRepo.path.basename": "app2", "myRepo.path.basenameNormalized": "app2", "myRepo.path[0]": "app2"},
{"myRepo.path": "app_3", "myRepo.path.basename": "app_3", "myRepo.path.basenameNormalized": "app-3", "myRepo.path[0]": "app_3"},
},
expectedError: nil,
},
{
name: "It filters application according to the paths",
directories: []argoprojiov1alpha1.GitDirectoryGeneratorItem{{Path: "p1/*"}, {Path: "p1/*/*"}},
@@ -212,9 +283,10 @@ func TestGitGenerateParamsFromDirectories(t *testing.T) {
Spec: argoprojiov1alpha1.ApplicationSetSpec{
Generators: []argoprojiov1alpha1.ApplicationSetGenerator{{
Git: &argoprojiov1alpha1.GitGenerator{
RepoURL: "RepoURL",
Revision: "Revision",
Directories: testCaseCopy.directories,
RepoURL: "RepoURL",
Revision: "Revision",
Directories: testCaseCopy.directories,
PathParamPrefix: testCaseCopy.pathParamPrefix,
},
}},
},
@@ -237,12 +309,13 @@ func TestGitGenerateParamsFromDirectories(t *testing.T) {
func TestGitGenerateParamsFromDirectoriesGoTemplate(t *testing.T) {
cases := []struct {
name string
directories []argoprojiov1alpha1.GitDirectoryGeneratorItem
repoApps []string
repoError error
expected []map[string]interface{}
expectedError error
name string
directories []argoprojiov1alpha1.GitDirectoryGeneratorItem
pathParamPrefix string
repoApps []string
repoError error
expected []map[string]interface{}
expectedError error
}{
{
name: "happy flow - created apps",
@@ -288,6 +361,57 @@ func TestGitGenerateParamsFromDirectoriesGoTemplate(t *testing.T) {
},
expectedError: nil,
},
{
name: "It prefixes path parameters with PathParamPrefix",
directories: []argoprojiov1alpha1.GitDirectoryGeneratorItem{{Path: "*"}},
pathParamPrefix: "myRepo",
repoApps: []string{
"app1",
"app2",
"app_3",
"p1/app4",
},
repoError: nil,
expected: []map[string]interface{}{
{
"myRepo": map[string]interface{}{
"path": map[string]interface{}{
"path": "app1",
"basename": "app1",
"basenameNormalized": "app1",
"segments": []string{
"app1",
},
},
},
},
{
"myRepo": map[string]interface{}{
"path": map[string]interface{}{
"path": "app2",
"basename": "app2",
"basenameNormalized": "app2",
"segments": []string{
"app2",
},
},
},
},
{
"myRepo": map[string]interface{}{
"path": map[string]interface{}{
"path": "app_3",
"basename": "app_3",
"basenameNormalized": "app-3",
"segments": []string{
"app_3",
},
},
},
},
},
expectedError: nil,
},
{
name: "It filters application according to the paths",
directories: []argoprojiov1alpha1.GitDirectoryGeneratorItem{{Path: "p1/*"}, {Path: "p1/*/*"}},
@@ -455,9 +579,10 @@ func TestGitGenerateParamsFromDirectoriesGoTemplate(t *testing.T) {
GoTemplate: true,
Generators: []argoprojiov1alpha1.ApplicationSetGenerator{{
Git: &argoprojiov1alpha1.GitGenerator{
RepoURL: "RepoURL",
Revision: "Revision",
Directories: testCaseCopy.directories,
RepoURL: "RepoURL",
Revision: "Revision",
Directories: testCaseCopy.directories,
PathParamPrefix: testCaseCopy.pathParamPrefix,
},
}},
},

View File

@@ -144,9 +144,10 @@ func (m *MatrixGenerator) GetRequeueAfter(appSetGenerator *argoprojiov1alpha1.Ap
for _, r := range appSetGenerator.Matrix.Generators {
base := &argoprojiov1alpha1.ApplicationSetGenerator{
List: r.List,
Clusters: r.Clusters,
Git: r.Git,
List: r.List,
Clusters: r.Clusters,
Git: r.Git,
PullRequest: r.PullRequest,
}
generators := GetRelevantGenerators(base, m.supportedGenerators)

View File

@@ -399,6 +399,8 @@ func TestMatrixGetRequeueAfter(t *testing.T) {
Elements: []apiextensionsv1.JSON{{Raw: []byte(`{"cluster": "Cluster","url": "Url"}`)}},
}
pullRequestGenerator := &argoprojiov1alpha1.PullRequestGenerator{}
testCases := []struct {
name string
baseGenerators []argoprojiov1alpha1.ApplicationSetNestedGenerator
@@ -431,6 +433,31 @@ func TestMatrixGetRequeueAfter(t *testing.T) {
gitGetRequeueAfter: time.Duration(1),
expected: time.Duration(1),
},
{
name: "returns the minimal time for pull request",
baseGenerators: []argoprojiov1alpha1.ApplicationSetNestedGenerator{
{
Git: gitGenerator,
},
{
PullRequest: pullRequestGenerator,
},
},
gitGetRequeueAfter: time.Duration(15 * time.Second),
expected: time.Duration(15 * time.Second),
},
{
name: "returns the default time if no requeueAfterSeconds is provided",
baseGenerators: []argoprojiov1alpha1.ApplicationSetNestedGenerator{
{
Git: gitGenerator,
},
{
PullRequest: pullRequestGenerator,
},
},
expected: time.Duration(30 * time.Minute),
},
}
for _, testCase := range testCases {
@@ -441,16 +468,18 @@ func TestMatrixGetRequeueAfter(t *testing.T) {
for _, g := range testCaseCopy.baseGenerators {
gitGeneratorSpec := argoprojiov1alpha1.ApplicationSetGenerator{
Git: g.Git,
List: g.List,
Git: g.Git,
List: g.List,
PullRequest: g.PullRequest,
}
mock.On("GetRequeueAfter", &gitGeneratorSpec).Return(testCaseCopy.gitGetRequeueAfter, nil)
}
var matrixGenerator = NewMatrixGenerator(
map[string]Generator{
"Git": mock,
"List": &ListGenerator{},
"Git": mock,
"List": &ListGenerator{},
"PullRequest": &PullRequestGenerator{},
},
)

View File

@@ -90,13 +90,19 @@ func (g *PullRequestGenerator) GenerateParams(appSetGenerator *argoprojiov1alpha
shortSHALength = len(pull.HeadSHA)
}
params = append(params, map[string]interface{}{
paramMap := map[string]interface{}{
"number": strconv.Itoa(pull.Number),
"branch": pull.Branch,
"branch_slug": slug.Make(pull.Branch),
"head_sha": pull.HeadSHA,
"head_short_sha": pull.HeadSHA[:shortSHALength],
})
}
// PR lables will only be supported for Go Template appsets, since fasttemplate will be deprecated.
if applicationSetInfo != nil && applicationSetInfo.Spec.GoTemplate {
paramMap["labels"] = pull.Labels
}
params = append(params, paramMap)
}
return params, nil
}

View File

@@ -17,9 +17,10 @@ import (
func TestPullRequestGithubGenerateParams(t *testing.T) {
ctx := context.Background()
cases := []struct {
selectFunc func(context.Context, *argoprojiov1alpha1.PullRequestGenerator, *argoprojiov1alpha1.ApplicationSet) (pullrequest.PullRequestService, error)
expected []map[string]interface{}
expectedErr error
selectFunc func(context.Context, *argoprojiov1alpha1.PullRequestGenerator, *argoprojiov1alpha1.ApplicationSet) (pullrequest.PullRequestService, error)
expected []map[string]interface{}
expectedErr error
applicationSet argoprojiov1alpha1.ApplicationSet
}{
{
selectFunc: func(context.Context, *argoprojiov1alpha1.PullRequestGenerator, *argoprojiov1alpha1.ApplicationSet) (pullrequest.PullRequestService, error) {
@@ -107,6 +108,71 @@ func TestPullRequestGithubGenerateParams(t *testing.T) {
expected: nil,
expectedErr: fmt.Errorf("error listing repos: fake error"),
},
{
selectFunc: func(context.Context, *argoprojiov1alpha1.PullRequestGenerator, *argoprojiov1alpha1.ApplicationSet) (pullrequest.PullRequestService, error) {
return pullrequest.NewFakeService(
ctx,
[]*pullrequest.PullRequest{
&pullrequest.PullRequest{
Number: 1,
Branch: "branch1",
HeadSHA: "089d92cbf9ff857a39e6feccd32798ca700fb958",
Labels: []string{"preview"},
},
},
nil,
)
},
expected: []map[string]interface{}{
{
"number": "1",
"branch": "branch1",
"branch_slug": "branch1",
"head_sha": "089d92cbf9ff857a39e6feccd32798ca700fb958",
"head_short_sha": "089d92cb",
"labels": []string{"preview"},
},
},
expectedErr: nil,
applicationSet: argoprojiov1alpha1.ApplicationSet{
Spec: argoprojiov1alpha1.ApplicationSetSpec{
// Application set is using Go Template.
GoTemplate: true,
},
},
},
{
selectFunc: func(context.Context, *argoprojiov1alpha1.PullRequestGenerator, *argoprojiov1alpha1.ApplicationSet) (pullrequest.PullRequestService, error) {
return pullrequest.NewFakeService(
ctx,
[]*pullrequest.PullRequest{
&pullrequest.PullRequest{
Number: 1,
Branch: "branch1",
HeadSHA: "089d92cbf9ff857a39e6feccd32798ca700fb958",
Labels: []string{"preview"},
},
},
nil,
)
},
expected: []map[string]interface{}{
{
"number": "1",
"branch": "branch1",
"branch_slug": "branch1",
"head_sha": "089d92cbf9ff857a39e6feccd32798ca700fb958",
"head_short_sha": "089d92cb",
},
},
expectedErr: nil,
applicationSet: argoprojiov1alpha1.ApplicationSet{
Spec: argoprojiov1alpha1.ApplicationSetSpec{
// Application set is using fasttemplate.
GoTemplate: false,
},
},
},
}
for _, c := range cases {
@@ -117,7 +183,7 @@ func TestPullRequestGithubGenerateParams(t *testing.T) {
PullRequest: &argoprojiov1alpha1.PullRequestGenerator{},
}
got, gotErr := gen.GenerateParams(&generatorConfig, nil)
got, gotErr := gen.GenerateParams(&generatorConfig, &c.applicationSet)
assert.Equal(t, c.expectedErr, gotErr)
assert.ElementsMatch(t, c.expected, got)
}

View File

@@ -122,6 +122,15 @@ func (g *SCMProviderGenerator) GenerateParams(appSetGenerator *argoprojiov1alpha
if err != nil {
return nil, fmt.Errorf("error initializing Azure Devops service: %v", err)
}
} else if providerConfig.Bitbucket != nil {
appPassword, err := g.getSecretRef(ctx, providerConfig.Bitbucket.AppPasswordRef, applicationSetInfo.Namespace)
if err != nil {
return nil, fmt.Errorf("error fetching Bitbucket cloud appPassword: %v", 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)
}
} else {
return nil, fmt.Errorf("no SCM provider implementation configured")
}

View File

@@ -20,10 +20,12 @@ func Client(g github_app_auth.Authentication, url string) (*github.Client, error
url = g.EnterpriseBaseURL
}
var client *github.Client
httpClient := http.Client{Transport: rt}
if url == "" {
httpClient := http.Client{Transport: rt}
client = github.NewClient(&httpClient)
} else {
rt.BaseURL = url
httpClient := http.Client{Transport: rt}
client, err = github.NewEnterpriseClient(url, url, &httpClient)
if err != nil {
return nil, fmt.Errorf("failed to create github enterprise client: %w", err)

View File

@@ -69,6 +69,7 @@ func (b *BitbucketService) List(_ context.Context) ([]*PullRequest, error) {
Number: pull.ID,
Branch: pull.FromRef.DisplayID, // ID: refs/heads/main DisplayID: main
HeadSHA: pull.FromRef.LatestCommit, // This is not defined in the official docs, but works in practice
Labels: []string{}, // Not supported by library
})
}

View File

@@ -122,16 +122,19 @@ func TestListPullRequestPagination(t *testing.T) {
Number: 101,
Branch: "feature-101",
HeadSHA: "ab3cf2e4d1517c83e720d2585b9402dbef71f992",
Labels: []string{},
}, *pullRequests[0])
assert.Equal(t, PullRequest{
Number: 102,
Branch: "feature-102",
HeadSHA: "bb3cf2e4d1517c83e720d2585b9402dbef71f992",
Labels: []string{},
}, *pullRequests[1])
assert.Equal(t, PullRequest{
Number: 200,
Branch: "feature-200",
HeadSHA: "cb3cf2e4d1517c83e720d2585b9402dbef71f992",
Labels: []string{},
}, *pullRequests[2])
}
@@ -284,11 +287,13 @@ func TestListPullRequestBranchMatch(t *testing.T) {
Number: 101,
Branch: "feature-101",
HeadSHA: "ab3cf2e4d1517c83e720d2585b9402dbef71f992",
Labels: []string{},
}, *pullRequests[0])
assert.Equal(t, PullRequest{
Number: 102,
Branch: "feature-102",
HeadSHA: "bb3cf2e4d1517c83e720d2585b9402dbef71f992",
Labels: []string{},
}, *pullRequests[1])
regexp = `.*2$`
@@ -305,6 +310,7 @@ func TestListPullRequestBranchMatch(t *testing.T) {
Number: 102,
Branch: "feature-102",
HeadSHA: "bb3cf2e4d1517c83e720d2585b9402dbef71f992",
Labels: []string{},
}, *pullRequests[0])
regexp = `[\d{2}`

View File

@@ -57,7 +57,17 @@ func (g *GiteaService) List(ctx context.Context) ([]*PullRequest, error) {
Number: int(pr.Index),
Branch: pr.Head.Ref,
HeadSHA: pr.Head.Sha,
Labels: getGiteaPRLabelNames(pr.Labels),
})
}
return list, nil
}
// Get the Gitea pull request label names.
func getGiteaPRLabelNames(giteaLabels []*gitea.Label) []string {
var labelNames []string
for _, giteaLabel := range giteaLabels {
labelNames = append(labelNames, giteaLabel.Name)
}
return labelNames
}

View File

@@ -8,6 +8,7 @@ import (
"net/http/httptest"
"testing"
"code.gitea.io/sdk/gitea"
"github.com/stretchr/testify/assert"
)
@@ -257,3 +258,32 @@ func TestGiteaList(t *testing.T) {
assert.Equal(t, prs[0].Branch, "test")
assert.Equal(t, prs[0].HeadSHA, "7bbaf62d92ddfafd9cc8b340c619abaec32bc09f")
}
func TestGetGiteaPRLabelNames(t *testing.T) {
Tests := []struct {
Name string
PullLabels []*gitea.Label
ExpectedResult []string
}{
{
Name: "PR has labels",
PullLabels: []*gitea.Label{
&gitea.Label{Name: "label1"},
&gitea.Label{Name: "label2"},
&gitea.Label{Name: "label3"},
},
ExpectedResult: []string{"label1", "label2", "label3"},
},
{
Name: "PR does not have labels",
PullLabels: []*gitea.Label{},
ExpectedResult: nil,
},
}
for _, test := range Tests {
t.Run(test.Name, func(t *testing.T) {
labels := getGiteaPRLabelNames(test.PullLabels)
assert.Equal(t, test.ExpectedResult, labels)
})
}
}

View File

@@ -68,6 +68,7 @@ func (g *GithubService) List(ctx context.Context) ([]*PullRequest, error) {
Number: *pull.Number,
Branch: *pull.Head.Ref,
HeadSHA: *pull.Head.SHA,
Labels: getGithubPRLabelNames(pull.Labels),
})
}
if resp.NextPage == 0 {
@@ -97,3 +98,12 @@ func containLabels(expectedLabels []string, gotLabels []*github.Label) bool {
}
return true
}
// Get the Github pull request label names.
func getGithubPRLabelNames(gitHubLabels []*github.Label) []string {
var labelNames []string
for _, gitHubLabel := range gitHubLabels {
labelNames = append(labelNames, *gitHubLabel.Name)
}
return labelNames
}

View File

@@ -4,6 +4,7 @@ import (
"testing"
"github.com/google/go-github/v35/github"
"github.com/stretchr/testify/assert"
)
func toPtr(s string) *string {
@@ -57,3 +58,32 @@ func TestContainLabels(t *testing.T) {
})
}
}
func TestGetGitHubPRLabelNames(t *testing.T) {
Tests := []struct {
Name string
PullLabels []*github.Label
ExpectedResult []string
}{
{
Name: "PR has labels",
PullLabels: []*github.Label{
&github.Label{Name: toPtr("label1")},
&github.Label{Name: toPtr("label2")},
&github.Label{Name: toPtr("label3")},
},
ExpectedResult: []string{"label1", "label2", "label3"},
},
{
Name: "PR does not have labels",
PullLabels: []*github.Label{},
ExpectedResult: nil,
},
}
for _, test := range Tests {
t.Run(test.Name, func(t *testing.T) {
labels := getGithubPRLabelNames(test.PullLabels)
assert.Equal(t, test.ExpectedResult, labels)
})
}
}

View File

@@ -72,6 +72,7 @@ func (g *GitLabService) List(ctx context.Context) ([]*PullRequest, error) {
Number: mr.IID,
Branch: mr.SourceBranch,
HeadSHA: mr.SHA,
Labels: mr.Labels,
})
}
if resp.NextPage == 0 {

View File

@@ -12,6 +12,8 @@ type PullRequest struct {
Branch string
// HeadSHA is the SHA of the HEAD from which the pull request originated.
HeadSHA string
// Labels of the pull request.
Labels []string
}
type PullRequestService interface {

View File

@@ -11,6 +11,7 @@ var Policies = map[string]Policy{
"sync": &SyncPolicy{},
"create-only": &CreateOnlyPolicy{},
"create-update": &CreateUpdatePolicy{},
"create-delete": &CreateDeletePolicy{},
}
type SyncPolicy struct{}
@@ -42,3 +43,13 @@ func (p *CreateOnlyPolicy) Update() bool {
func (p *CreateOnlyPolicy) Delete() bool {
return false
}
type CreateDeletePolicy struct{}
func (p *CreateDeletePolicy) Update() bool {
return false
}
func (p *CreateDeletePolicy) Delete() bool {
return true
}

View File

@@ -12,7 +12,7 @@ import (
"text/template"
"unsafe"
"github.com/Masterminds/sprig"
"github.com/Masterminds/sprig/v3"
"github.com/valyala/fasttemplate"
log "github.com/sirupsen/logrus"
@@ -133,6 +133,16 @@ func (r *Render) deeplyReplace(copy, original reflect.Value, replaceMap map[stri
if err := r.deeplyReplace(copyValue, originalValue, replaceMap, useGoTemplate); err != nil {
return err
}
// Keys can be templated as well as values (e.g. to template something into an annotation).
if key.Kind() == reflect.String {
templatedKey, err := r.Replace(key.String(), replaceMap, useGoTemplate)
if err != nil {
return err
}
key = reflect.ValueOf(templatedKey)
}
copy.SetMapIndex(key, copyValue)
}

View File

@@ -7,6 +7,7 @@ import (
"github.com/sirupsen/logrus"
logtest "github.com/sirupsen/logrus/hooks/test"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
@@ -40,7 +41,7 @@ func TestRenderTemplateParams(t *testing.T) {
Namespace: "default",
},
Spec: argoappsv1.ApplicationSpec{
Source: argoappsv1.ApplicationSource{
Source: &argoappsv1.ApplicationSource{
Path: "",
RepoURL: "",
TargetRevision: "",
@@ -219,7 +220,7 @@ func TestRenderTemplateParamsGoTemplate(t *testing.T) {
Namespace: "default",
},
Spec: argoappsv1.ApplicationSpec{
Source: argoappsv1.ApplicationSource{
Source: &argoappsv1.ApplicationSource{
Path: "",
RepoURL: "",
TargetRevision: "",
@@ -461,14 +462,56 @@ func TestRenderTemplateParamsGoTemplate(t *testing.T) {
}
})
}
}
func TestRenderTemplateKeys(t *testing.T) {
t.Run("fasttemplate", func(t *testing.T) {
application := &argoappsv1.Application{
ObjectMeta: metav1.ObjectMeta{
Annotations: map[string]string{
"annotation-{{key}}": "annotation-{{value}}",
},
},
}
params := map[string]interface{}{
"key": "some-key",
"value": "some-value",
}
render := Render{}
newApplication, err := render.RenderTemplateParams(application, nil, params, false)
require.NoError(t, err)
require.Contains(t, newApplication.ObjectMeta.Annotations, "annotation-some-key")
assert.Equal(t, newApplication.ObjectMeta.Annotations["annotation-some-key"], "annotation-some-value")
})
t.Run("gotemplate", func(t *testing.T) {
application := &argoappsv1.Application{
ObjectMeta: metav1.ObjectMeta{
Annotations: map[string]string{
"annotation-{{ .key }}": "annotation-{{ .value }}",
},
},
}
params := map[string]interface{}{
"key": "some-key",
"value": "some-value",
}
render := Render{}
newApplication, err := render.RenderTemplateParams(application, nil, params, true)
require.NoError(t, err)
require.Contains(t, newApplication.ObjectMeta.Annotations, "annotation-some-key")
assert.Equal(t, newApplication.ObjectMeta.Annotations["annotation-some-key"], "annotation-some-value")
})
}
func TestRenderTemplateParamsFinalizers(t *testing.T) {
emptyApplication := &argoappsv1.Application{
Spec: argoappsv1.ApplicationSpec{
Source: argoappsv1.ApplicationSource{
Source: &argoappsv1.ApplicationSource{
Path: "",
RepoURL: "",
TargetRevision: "",

View File

@@ -1,4 +0,0 @@
-----BEGIN PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEesHEB7vX5Y2RxXypjMy1nI1z7iRG
JI9/gt/sYqzpsa65aaNP4npM43DDxoIy/MQBo9s/mxGxmA+8UXeDpVC9vw==
-----END PUBLIC KEY-----

View File

@@ -735,6 +735,42 @@
}
}
},
"/api/v1/applications/{name}/links": {
"get": {
"tags": [
"ApplicationService"
],
"summary": "ListLinks returns the list of all application deep links",
"operationId": "ApplicationService_ListLinks",
"parameters": [
{
"type": "string",
"name": "name",
"in": "path",
"required": true
},
{
"type": "string",
"name": "namespace",
"in": "query"
}
],
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/applicationLinksResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
}
}
},
"/api/v1/applications/{name}/logs": {
"get": {
"tags": [
@@ -1385,6 +1421,67 @@
}
}
},
"/api/v1/applications/{name}/resource/links": {
"get": {
"tags": [
"ApplicationService"
],
"summary": "ListResourceLinks returns the list of all resource deep links",
"operationId": "ApplicationService_ListResourceLinks",
"parameters": [
{
"type": "string",
"name": "name",
"in": "path",
"required": true
},
{
"type": "string",
"name": "namespace",
"in": "query"
},
{
"type": "string",
"name": "resourceName",
"in": "query"
},
{
"type": "string",
"name": "version",
"in": "query"
},
{
"type": "string",
"name": "group",
"in": "query"
},
{
"type": "string",
"name": "kind",
"in": "query"
},
{
"type": "string",
"name": "appNamespace",
"in": "query"
}
],
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/applicationLinksResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
}
}
},
"/api/v1/applications/{name}/revisions/{revision}/metadata": {
"get": {
"tags": [
@@ -2560,6 +2657,37 @@
}
}
},
"/api/v1/projects/{name}/links": {
"get": {
"tags": [
"ProjectService"
],
"summary": "ListLinks returns all deep links for the particular project",
"operationId": "ProjectService_ListLinks",
"parameters": [
{
"type": "string",
"name": "name",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/applicationLinksResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
}
}
},
"/api/v1/projects/{name}/syncwindows": {
"get": {
"tags": [
@@ -3296,6 +3424,18 @@
"description": "Reference between project and repository that allow you automatically to be added as item inside SourceRepos project entity.",
"name": "project",
"in": "query"
},
{
"type": "string",
"description": "Google Cloud Platform service account key.",
"name": "gcpServiceAccountKey",
"in": "query"
},
{
"type": "boolean",
"description": "Whether to force HTTP basic auth.",
"name": "forceHttpBasicAuth",
"in": "query"
}
],
"responses": {
@@ -3454,6 +3594,29 @@
}
}
},
"/api/v1/settings/plugins": {
"get": {
"tags": [
"SettingsService"
],
"summary": "Get returns Argo CD plugins",
"operationId": "SettingsService_GetPlugins",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/clusterSettingsPluginsResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
}
}
},
"/api/v1/stream/applications": {
"get": {
"tags": [
@@ -3900,6 +4063,34 @@
}
}
},
"applicationLinkInfo": {
"type": "object",
"properties": {
"description": {
"type": "string"
},
"iconClass": {
"type": "string"
},
"title": {
"type": "string"
},
"url": {
"type": "string"
}
}
},
"applicationLinksResponse": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"$ref": "#/definitions/applicationLinkInfo"
}
}
}
},
"applicationLogEntry": {
"type": "object",
"properties": {
@@ -4097,6 +4288,9 @@
"appLabelKey": {
"type": "string"
},
"appsInAnyNamespaceEnabled": {
"type": "boolean"
},
"configManagementPlugins": {
"type": "array",
"items": {
@@ -4177,6 +4371,17 @@
}
}
},
"clusterSettingsPluginsResponse": {
"type": "object",
"properties": {
"plugins": {
"type": "array",
"items": {
"$ref": "#/definitions/clusterPlugin"
}
}
}
},
"gpgkeyGnuPGPublicKeyCreateResponse": {
"type": "object",
"title": "Response to a public key creation request",
@@ -4197,6 +4402,24 @@
"type": "object",
"title": "Generic (empty) response for GPG public key CRUD requests"
},
"intstrIntOrString": {
"description": "+protobuf=true\n+protobuf.options.(gogoproto.goproto_stringer)=false\n+k8s:openapi-gen=true",
"type": "object",
"title": "IntOrString is a type that can hold an int32 or a string. When used in\nJSON or YAML marshalling and unmarshalling, it produces or consumes the\ninner type. This allows you to have, for example, a JSON field that can\naccept a name or number.\nTODO: Rename to Int32OrString",
"properties": {
"intVal": {
"type": "integer",
"format": "int32"
},
"strVal": {
"type": "string"
},
"type": {
"type": "string",
"format": "int64"
}
}
},
"notificationService": {
"type": "object",
"properties": {
@@ -4505,6 +4728,65 @@
}
}
},
"repositoryParameterAnnouncement": {
"type": "object",
"properties": {
"array": {
"description": "array is the default value of the parameter if the parameter is an array.",
"type": "array",
"items": {
"type": "string"
}
},
"collectionType": {
"description": "collectionType is the type of value this parameter holds - either a single value (a string) or a collection\n(array or map). If collectionType is set, only the field with that type will be used. If collectionType is not\nset, `string` is the default. If collectionType is set to an invalid value, a validation error is thrown.",
"type": "string"
},
"itemType": {
"description": "itemType determines the primitive data type represented by the parameter. Parameters are always encoded as\nstrings, but this field lets them be interpreted as other primitive types.",
"type": "string"
},
"map": {
"description": "map is the default value of the parameter if the parameter is a map.",
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"name": {
"description": "name is the name identifying a parameter.",
"type": "string"
},
"required": {
"description": "required defines if this given parameter is mandatory.",
"type": "boolean"
},
"string": {
"description": "string is the default value of the parameter if the parameter is a string.",
"type": "string"
},
"title": {
"description": "title is a human-readable text of the parameter name.",
"type": "string"
},
"tooltip": {
"description": "tooltip is a human-readable description of the parameter.",
"type": "string"
}
}
},
"repositoryPluginAppSpec": {
"type": "object",
"title": "PluginAppSpec contains details about a plugin-type Application",
"properties": {
"parametersAnnouncement": {
"type": "array",
"items": {
"$ref": "#/definitions/repositoryParameterAnnouncement"
}
}
}
},
"repositoryRefs": {
"type": "object",
"title": "A subset of the repository's named refs",
@@ -4551,6 +4833,9 @@
"kustomize": {
"$ref": "#/definitions/repositoryKustomizeAppSpec"
},
"plugin": {
"$ref": "#/definitions/repositoryPluginAppSpec"
},
"type": {
"type": "string"
}
@@ -5373,6 +5658,23 @@
}
}
},
"v1alpha1ApplicationMatchExpression": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"operator": {
"type": "string"
},
"values": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"v1alpha1ApplicationSet": {
"type": "object",
"title": "ApplicationSet is a set of Application resources\n+genclient\n+genclient:noStatus\n+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object\n+kubebuilder:resource:path=applicationsets,shortName=appset;appsets\n+kubebuilder:subresource:status",
@@ -5388,6 +5690,31 @@
}
}
},
"v1alpha1ApplicationSetApplicationStatus": {
"type": "object",
"title": "ApplicationSetApplicationStatus contains details about each Application managed by the ApplicationSet",
"properties": {
"application": {
"type": "string",
"title": "Application contains the name of the Application resource"
},
"lastTransitionTime": {
"$ref": "#/definitions/v1Time"
},
"message": {
"type": "string",
"title": "Message contains human-readable message indicating details about the status"
},
"status": {
"type": "string",
"title": "Status contains the AppSet's perceived status of the managed Application resource: (Waiting, Pending, Progressing, Healthy)"
},
"step": {
"type": "string",
"title": "Step tracks which step this Application should be updated in"
}
}
},
"v1alpha1ApplicationSetCondition": {
"type": "object",
"title": "ApplicationSetCondition contains details about an applicationset condition, which is usally an error or warning",
@@ -5494,6 +5821,31 @@
}
}
},
"v1alpha1ApplicationSetRolloutStep": {
"type": "object",
"properties": {
"matchExpressions": {
"type": "array",
"items": {
"$ref": "#/definitions/v1alpha1ApplicationMatchExpression"
}
},
"maxUpdate": {
"$ref": "#/definitions/intstrIntOrString"
}
}
},
"v1alpha1ApplicationSetRolloutStrategy": {
"type": "object",
"properties": {
"steps": {
"type": "array",
"items": {
"$ref": "#/definitions/v1alpha1ApplicationSetRolloutStep"
}
}
}
},
"v1alpha1ApplicationSetSpec": {
"description": "ApplicationSetSpec represents a class of application set state.",
"type": "object",
@@ -5507,6 +5859,9 @@
"goTemplate": {
"type": "boolean"
},
"strategy": {
"$ref": "#/definitions/v1alpha1ApplicationSetStrategy"
},
"syncPolicy": {
"$ref": "#/definitions/v1alpha1ApplicationSetSyncPolicy"
},
@@ -5519,6 +5874,12 @@
"type": "object",
"title": "ApplicationSetStatus defines the observed state of ApplicationSet",
"properties": {
"applicationStatus": {
"type": "array",
"items": {
"$ref": "#/definitions/v1alpha1ApplicationSetApplicationStatus"
}
},
"conditions": {
"type": "array",
"title": "INSERT ADDITIONAL STATUS FIELD - define observed state of cluster\nImportant: Run \"make\" to regenerate code after modifying this file",
@@ -5528,6 +5889,18 @@
}
}
},
"v1alpha1ApplicationSetStrategy": {
"description": "ApplicationSetStrategy configures how generated Applications are updated in sequence.",
"type": "object",
"properties": {
"rollingSync": {
"$ref": "#/definitions/v1alpha1ApplicationSetRolloutStrategy"
},
"type": {
"type": "string"
}
}
},
"v1alpha1ApplicationSetSyncPolicy": {
"description": "ApplicationSetSyncPolicy configures how generated Applications will relate to their\nApplicationSet.",
"type": "object",
@@ -5604,6 +5977,10 @@
"plugin": {
"$ref": "#/definitions/v1alpha1ApplicationSourcePlugin"
},
"ref": {
"description": "Ref is reference to another source within sources field. This field will not be used if used with a `source` tag.",
"type": "string"
},
"repoURL": {
"type": "string",
"title": "RepoURL is the URL to the repository (Git or Helm) that contains the application manifests"
@@ -5772,6 +6149,39 @@
},
"name": {
"type": "string"
},
"parameters": {
"type": "array",
"items": {
"$ref": "#/definitions/v1alpha1ApplicationSourcePluginParameter"
}
}
}
},
"v1alpha1ApplicationSourcePluginParameter": {
"type": "object",
"properties": {
"array": {
"description": "Array is the value of an array type parameter.",
"type": "array",
"items": {
"type": "string"
}
},
"map": {
"description": "Map is the value of a map type parameter.",
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"name": {
"description": "Name is the name identifying a parameter.",
"type": "string"
},
"string": {
"description": "String_ is the value of a string type parameter.",
"type": "string"
}
}
},
@@ -5808,6 +6218,13 @@
"source": {
"$ref": "#/definitions/v1alpha1ApplicationSource"
},
"sources": {
"type": "array",
"title": "Sources is a reference to the location of the application's manifests or chart",
"items": {
"$ref": "#/definitions/v1alpha1ApplicationSource"
}
},
"syncPolicy": {
"$ref": "#/definitions/v1alpha1SyncPolicy"
}
@@ -5858,6 +6275,13 @@
"type": "string",
"title": "SourceType specifies the type of this application"
},
"sourceTypes": {
"type": "array",
"title": "SourceTypes specifies the type of the sources included in the application",
"items": {
"type": "string"
}
},
"summary": {
"$ref": "#/definitions/v1alpha1ApplicationSummary"
},
@@ -6155,6 +6579,13 @@
},
"source": {
"$ref": "#/definitions/v1alpha1ApplicationSource"
},
"sources": {
"type": "array",
"title": "Sources is a reference to the application's multiple sources used for comparison",
"items": {
"$ref": "#/definitions/v1alpha1ApplicationSource"
}
}
}
},
@@ -6289,6 +6720,9 @@
"$ref": "#/definitions/v1alpha1GitFileGeneratorItem"
}
},
"pathParamPrefix": {
"type": "string"
},
"repoURL": {
"type": "string"
},
@@ -6544,6 +6978,23 @@
}
}
},
"v1alpha1ManagedNamespaceMetadata": {
"type": "object",
"properties": {
"annotations": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"labels": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
},
"v1alpha1MatrixGenerator": {
"description": "MatrixGenerator generates the cartesian product of two sets of parameters. The parameters are defined by two nested\ngenerators.",
"type": "object",
@@ -6897,6 +7348,14 @@
"type": "boolean",
"title": "EnableOCI specifies whether helm-oci support should be enabled for this repo"
},
"forceHttpBasicAuth": {
"type": "boolean",
"title": "ForceHttpBasicAuth specifies whether Argo CD should attempt to force basic auth for HTTP connections"
},
"gcpServiceAccountKey": {
"type": "string",
"title": "GCPServiceAccountKey specifies the service account key in JSON format to be used for getting credentials to Google Cloud Source repos"
},
"githubAppEnterpriseBaseUrl": {
"type": "string",
"title": "GithubAppEnterpriseBaseURL specifies the GitHub API URL for GitHub app authentication. If empty will default to https://api.github.com"
@@ -6919,6 +7378,10 @@
"type": "string",
"title": "Password for authenticating at the repo server"
},
"proxy": {
"type": "string",
"title": "Proxy specifies the HTTP/HTTPS proxy used to access repos at the repo server"
},
"sshPrivateKey": {
"type": "string",
"title": "SSHPrivateKey contains the private key data for authenticating at the repo server using SSH (only Git repos)"
@@ -6975,6 +7438,14 @@
"type": "boolean",
"title": "EnableOCI specifies whether helm-oci support should be enabled for this repo"
},
"forceHttpBasicAuth": {
"type": "boolean",
"title": "ForceHttpBasicAuth specifies whether Argo CD should attempt to force basic auth for HTTP connections"
},
"gcpServiceAccountKey": {
"type": "string",
"title": "GCPServiceAccountKey specifies the service account key in JSON format to be used for getting credentials to Google Cloud Source repos"
},
"githubAppEnterpriseBaseUrl": {
"type": "string",
"title": "GithubAppEnterpriseBaseURL specifies the base URL of GitHub Enterprise installation. If empty will default to https://api.github.com"
@@ -7465,8 +7936,22 @@
"type": "string",
"title": "Revision holds the revision the sync was performed against"
},
"revisions": {
"type": "array",
"title": "Revisions holds the revision of each source in sources field the sync was performed against",
"items": {
"type": "string"
}
},
"source": {
"$ref": "#/definitions/v1alpha1ApplicationSource"
},
"sources": {
"type": "array",
"title": "Sources is a reference to the application sources used for the sync operation",
"items": {
"$ref": "#/definitions/v1alpha1ApplicationSource"
}
}
}
},
@@ -7767,9 +8252,23 @@
"description": "Revision is the revision (Git) or chart version (Helm) which to sync the application to\nIf omitted, will use the revision specified in app spec.",
"type": "string"
},
"revisions": {
"description": "Revisions is the list of revision (Git) or chart version (Helm) which to sync each source in sources field for the application to\nIf omitted, will use the revision specified in app spec.",
"type": "array",
"items": {
"type": "string"
}
},
"source": {
"$ref": "#/definitions/v1alpha1ApplicationSource"
},
"sources": {
"type": "array",
"title": "Sources overrides the source definition set in the application.\nThis is typically set in a Rollback operation and is nil during a Sync operation",
"items": {
"$ref": "#/definitions/v1alpha1ApplicationSource"
}
},
"syncOptions": {
"type": "array",
"title": "SyncOptions provide per-sync sync-options, e.g. Validate=false",
@@ -7815,8 +8314,22 @@
"type": "string",
"title": "Revision holds the revision this sync operation was performed to"
},
"revisions": {
"type": "array",
"title": "Revisions holds the revision this sync operation was performed for respective indexed source in sources field",
"items": {
"type": "string"
}
},
"source": {
"$ref": "#/definitions/v1alpha1ApplicationSource"
},
"sources": {
"type": "array",
"title": "Source records the application source information of the sync, used for comparing auto-sync",
"items": {
"$ref": "#/definitions/v1alpha1ApplicationSource"
}
}
}
},
@@ -7827,6 +8340,9 @@
"automated": {
"$ref": "#/definitions/v1alpha1SyncPolicyAutomated"
},
"managedNamespaceMetadata": {
"$ref": "#/definitions/v1alpha1ManagedNamespaceMetadata"
},
"retry": {
"$ref": "#/definitions/v1alpha1RetryStrategy"
},
@@ -7868,6 +8384,13 @@
"type": "string",
"title": "Revision contains information about the revision the comparison has been performed to"
},
"revisions": {
"type": "array",
"title": "Revisions contains information about the revisions of multiple sources the comparison has been performed to",
"items": {
"type": "string"
}
},
"status": {
"type": "string",
"title": "Status is the sync state of the comparison"

View File

@@ -46,16 +46,17 @@ func getSubmoduleEnabled() bool {
func NewCommand() *cobra.Command {
var (
clientConfig clientcmd.ClientConfig
metricsAddr string
probeBindAddr string
webhookAddr string
enableLeaderElection bool
namespace string
argocdRepoServer string
policy string
debugLog bool
dryRun bool
clientConfig clientcmd.ClientConfig
metricsAddr string
probeBindAddr string
webhookAddr string
enableLeaderElection bool
namespace string
argocdRepoServer string
policy string
debugLog bool
dryRun bool
enableProgressiveSyncs bool
)
scheme := runtime.NewScheme()
_ = clientgoscheme.AddToScheme(scheme)
@@ -89,7 +90,7 @@ func NewCommand() *cobra.Command {
policyObj, exists := utils.Policies[policy]
if !exists {
log.Info("Policy value can be: sync, create-only, create-update")
log.Info("Policy value can be: sync, create-only, create-update, create-delete")
os.Exit(1)
}
@@ -168,15 +169,16 @@ func NewCommand() *cobra.Command {
go func() { errors.CheckError(askPassServer.Run(askpass.SocketPath)) }()
if err = (&controllers.ApplicationSetReconciler{
Generators: topLevelGenerators,
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
Recorder: mgr.GetEventRecorderFor("applicationset-controller"),
Renderer: &utils.Render{},
Policy: policyObj,
ArgoAppClientset: appSetConfig,
KubeClientset: k8sClient,
ArgoDB: argoCDDB,
Generators: topLevelGenerators,
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
Recorder: mgr.GetEventRecorderFor("applicationset-controller"),
Renderer: &utils.Render{},
Policy: policyObj,
ArgoAppClientset: appSetConfig,
KubeClientset: k8sClient,
ArgoDB: argoCDDB,
EnableProgressiveSyncs: enableProgressiveSyncs,
}).SetupWithManager(mgr); err != nil {
log.Error(err, "unable to create controller", "controller", "ApplicationSet")
os.Exit(1)
@@ -200,11 +202,12 @@ func NewCommand() *cobra.Command {
"Enabling this will ensure there is only one active controller manager.")
command.Flags().StringVar(&namespace, "namespace", env.StringFromEnv("ARGOCD_APPLICATIONSET_CONTROLLER_NAMESPACE", ""), "Argo CD repo namespace (default: argocd)")
command.Flags().StringVar(&argocdRepoServer, "argocd-repo-server", env.StringFromEnv("ARGOCD_APPLICATIONSET_CONTROLLER_REPO_SERVER", common.DefaultRepoServerAddr), "Argo CD repo server address")
command.Flags().StringVar(&policy, "policy", env.StringFromEnv("ARGOCD_APPLICATIONSET_CONTROLLER_POLICY", "sync"), "Modify how application is synced between the generator and the cluster. Default is 'sync' (create & update & delete), options: 'create-only', 'create-update' (no deletion)")
command.Flags().StringVar(&policy, "policy", env.StringFromEnv("ARGOCD_APPLICATIONSET_CONTROLLER_POLICY", "sync"), "Modify how application is synced between the generator and the cluster. Default is 'sync' (create & update & delete), options: 'create-only', 'create-update' (no deletion), 'create-delete' (no update)")
command.Flags().BoolVar(&debugLog, "debug", env.ParseBoolFromEnv("ARGOCD_APPLICATIONSET_CONTROLLER_DEBUG", false), "Print debug logs. Takes precedence over loglevel")
command.Flags().StringVar(&cmdutil.LogFormat, "logformat", env.StringFromEnv("ARGOCD_APPLICATIONSET_CONTROLLER_LOGFORMAT", "text"), "Set the logging format. One of: text|json")
command.Flags().StringVar(&cmdutil.LogLevel, "loglevel", env.StringFromEnv("ARGOCD_APPLICATIONSET_CONTROLLER_LOGLEVEL", "info"), "Set the logging level. One of: debug|info|warn|error")
command.Flags().BoolVar(&dryRun, "dry-run", env.ParseBoolFromEnv("ARGOCD_APPLICATIONSET_CONTROLLER_DRY_RUN", false), "Enable dry run mode")
command.Flags().BoolVar(&enableProgressiveSyncs, "enable-progressive-syncs", env.ParseBoolFromEnv("ARGOCD_APPLICATIONSET_CONTROLLER_ENABLE_PROGRESSIVE_SYNCS", false), "Enable use of the experimental progressive syncs feature.")
return &command
}

View File

@@ -156,7 +156,7 @@ func NewCommand() *cobra.Command {
command.Flags().StringVar(&logLevel, "loglevel", "info", "Set the logging level. One of: debug|info|warn|error")
command.Flags().StringVar(&logFormat, "logformat", "text", "Set the logging format. One of: text|json")
command.Flags().IntVar(&metricsPort, "metrics-port", defaultMetricsPort, "Metrics port")
command.Flags().StringVar(&argocdRepoServer, "argocd-repo-server", "argocd-repo-server:8081", "Argo CD repo server address")
command.Flags().StringVar(&argocdRepoServer, "argocd-repo-server", common.DefaultRepoServerAddr, "Argo CD repo server address")
command.Flags().BoolVar(&argocdRepoServerPlaintext, "argocd-repo-server-plaintext", false, "Use a plaintext client (non-TLS) to connect to repository server")
command.Flags().BoolVar(&argocdRepoServerStrictTLS, "argocd-repo-server-strict-tls", false, "Perform strict validation of TLS certificates when connecting to repo server")
command.Flags().StringVar(&configMapName, "config-map-name", "argocd-notifications-cm", "Set notifications ConfigMap name")

View File

@@ -71,6 +71,7 @@ func NewCommand() *cobra.Command {
dexServerStrictTLS bool
staticAssetsDir string
applicationNamespaces []string
enableProxyExtension bool
)
var command = &cobra.Command{
Use: cliName,
@@ -184,6 +185,7 @@ func NewCommand() *cobra.Command {
RedisClient: redisClient,
StaticAssetsDir: staticAssetsDir,
ApplicationNamespaces: applicationNamespaces,
EnableProxyExtension: enableProxyExtension,
}
stats.RegisterStackDumper()
@@ -235,6 +237,7 @@ func NewCommand() *cobra.Command {
command.Flags().BoolVar(&dexServerPlaintext, "dex-server-plaintext", env.ParseBoolFromEnv("ARGOCD_SERVER_DEX_SERVER_PLAINTEXT", false), "Use a plaintext client (non-TLS) to connect to dex server")
command.Flags().BoolVar(&dexServerStrictTLS, "dex-server-strict-tls", env.ParseBoolFromEnv("ARGOCD_SERVER_DEX_SERVER_STRICT_TLS", false), "Perform strict validation of TLS certificates when connecting to dex server")
command.Flags().StringSliceVar(&applicationNamespaces, "application-namespaces", env.StringsFromEnv("ARGOCD_APPLICATION_NAMESPACES", []string{}, ","), "List of additional namespaces where application resources can be managed in")
command.Flags().BoolVar(&enableProxyExtension, "enable-proxy-extension", env.ParseBoolFromEnv("ARGOCD_SERVER_ENABLE_PROXY_EXTENSION", false), "Enable Proxy Extension feature")
tlsConfigCustomizerSrc = tls.AddTLSFlagsToCmd(command)
cacheSrc = servercache.AddCacheFlagsToCmd(command, func(client *redis.Client) {
redisClient = client

View File

@@ -56,6 +56,7 @@ func NewAdminCommand() *cobra.Command {
command.AddCommand(NewExportCommand())
command.AddCommand(NewDashboardCommand())
command.AddCommand(NewNotificationsCommand())
command.AddCommand(NewInitialPasswordCommand())
command.Flags().StringVar(&cmdutil.LogFormat, "logformat", "text", "Set the logging format. One of: text|json")
command.Flags().StringVar(&cmdutil.LogLevel, "loglevel", "info", "Set the logging level. One of: debug|info|warn|error")

View File

@@ -401,7 +401,12 @@ func reconcileApplications(
return nil, err
}
res := appStateManager.CompareAppState(&app, proj, app.Spec.Source.TargetRevision, app.Spec.Source, false, false, nil)
sources := make([]v1alpha1.ApplicationSource, 0)
revisions := make([]string, 0)
sources = append(sources, app.Spec.GetSource())
revisions = append(revisions, app.Spec.GetSource().TargetRevision)
res := appStateManager.CompareAppState(&app, proj, revisions, sources, false, false, nil, false)
items = append(items, appReconcileResult{
Name: app.Name,
Conditions: app.Status.Conditions,

View File

@@ -80,6 +80,7 @@ func TestGetReconcileResults_Refresh(t *testing.T) {
Namespace: "default",
},
Spec: v1alpha1.ApplicationSpec{
Source: &v1alpha1.ApplicationSource{},
Project: "default",
Destination: v1alpha1.ApplicationDestination{
Server: v1alpha1.KubernetesInternalAPIServerAddr,

View File

@@ -265,9 +265,7 @@ func runClusterNamespacesCommand(ctx context.Context, clientConfig clientcmd.Cli
}
}
} else {
if app.Spec.Destination.Server == cluster.Server {
nsSet[app.Spec.Destination.Namespace] = true
}
nsSet[app.Spec.Destination.Namespace] = true
}
}
var namespaces []string

View File

@@ -0,0 +1,46 @@
package admin
import (
"context"
"fmt"
"github.com/spf13/cobra"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/tools/clientcmd"
"github.com/argoproj/argo-cd/v2/util/cli"
"github.com/argoproj/argo-cd/v2/util/errors"
)
const initialPasswordSecretName = "argocd-initial-admin-secret"
// NewInitialPasswordCommand defines a new command to retrieve Argo CD initial password.
func NewInitialPasswordCommand() *cobra.Command {
var (
clientConfig clientcmd.ClientConfig
)
var command = cobra.Command{
Use: "initial-password",
Short: "Prints initial password to log in to Argo CD for the first time",
Run: func(c *cobra.Command, args []string) {
config, err := clientConfig.ClientConfig()
errors.CheckError(err)
namespace, _, err := clientConfig.Namespace()
errors.CheckError(err)
kubeClientset := kubernetes.NewForConfigOrDie(config)
secret, err := kubeClientset.CoreV1().Secrets(namespace).Get(context.Background(), initialPasswordSecretName, v1.GetOptions{})
errors.CheckError(err)
if initialPass, ok := secret.Data["password"]; ok {
fmt.Println(string(initialPass))
fmt.Println("\n This password must be only used for first time login. We strongly recommend you update the password using `argocd account update-password`.")
}
},
}
clientConfig = cli.AddKubectlFlagsToCmd(&command)
return &command
}

View File

@@ -33,7 +33,7 @@ func NewNotificationsCommand() *cobra.Command {
var argocdService service.Service
toolsCommand := cmd.NewToolsCommand(
"notifications",
"notifications",
"argocd admin notifications",
applications,
settings.GetFactorySettings(argocdService, "argocd-notifications-secret", "argocd-notifications-cm"), func(clientConfig clientcmd.ClientConfig) {
k8sCfg, err := clientConfig.ClientConfig()
@@ -64,7 +64,7 @@ func NewNotificationsCommand() *cobra.Command {
log.Fatalf("Failed to initialize Argo CD service: %v", err)
}
})
toolsCommand.PersistentFlags().StringVar(&argocdRepoServer, "argocd-repo-server", "argocd-repo-server:8081", "Argo CD repo server address")
toolsCommand.PersistentFlags().StringVar(&argocdRepoServer, "argocd-repo-server", common.DefaultRepoServerAddr, "Argo CD repo server address")
toolsCommand.PersistentFlags().BoolVar(&argocdRepoServerPlaintext, "argocd-repo-server-plaintext", false, "Use a plaintext client (non-TLS) to connect to repository server")
toolsCommand.PersistentFlags().BoolVar(&argocdRepoServerStrictTLS, "argocd-repo-server-strict-tls", false, "Perform strict validation of TLS certificates when connecting to repo server")
return toolsCommand

View File

@@ -206,7 +206,7 @@ var validatorsByGroup = map[string]settingValidator{
}
ssoProvider = "Dex"
} else if general.OIDCConfigRAW != "" {
if _, err := settings.UnmarshalOIDCConfig(general.OIDCConfigRAW); err != nil {
if err := settings.ValidateOIDCConfig(general.OIDCConfigRAW); err != nil {
return "", fmt.Errorf("invalid oidc.config: %v", err)
}
ssoProvider = "OIDC"

View File

@@ -150,7 +150,7 @@ func NewApplicationCreateCommand(clientOpts *argocdclient.ClientOptions) *cobra.
c.HelpFunc()(c, args)
os.Exit(1)
}
if app.Spec.Source.Plugin != nil && app.Spec.Source.Plugin.Name != "" {
if app.Spec.GetSource().Plugin != nil && app.Spec.GetSource().Plugin.Name != "" {
log.Warnf(argocommon.ConfigMapPluginCLIDeprecationWarning)
}
if appNamespace != "" {
@@ -294,7 +294,7 @@ func NewApplicationGetCommand(clientOpts *argocdclient.ClientOptions) *cobra.Com
})
errors.CheckError(err)
if app.Spec.Source.Plugin != nil && app.Spec.Source.Plugin.Name != "" {
if app.Spec.GetSource().Plugin != nil && app.Spec.GetSource().Plugin.Name != "" {
log.Warnf(argocommon.ConfigMapPluginCLIDeprecationWarning)
}
@@ -440,15 +440,16 @@ func NewApplicationLogsCommand(clientOpts *argocdclient.ClientOptions) *cobra.Co
}
func printAppSummaryTable(app *argoappv1.Application, appURL string, windows *argoappv1.SyncWindows) {
source := app.Spec.GetSource()
fmt.Printf(printOpFmtStr, "Name:", app.QualifiedName())
fmt.Printf(printOpFmtStr, "Project:", app.Spec.GetProject())
fmt.Printf(printOpFmtStr, "Server:", getServer(app))
fmt.Printf(printOpFmtStr, "Namespace:", app.Spec.Destination.Namespace)
fmt.Printf(printOpFmtStr, "URL:", appURL)
fmt.Printf(printOpFmtStr, "Repo:", app.Spec.Source.RepoURL)
fmt.Printf(printOpFmtStr, "Target:", app.Spec.Source.TargetRevision)
fmt.Printf(printOpFmtStr, "Path:", app.Spec.Source.Path)
printAppSourceDetails(&app.Spec.Source)
fmt.Printf(printOpFmtStr, "Repo:", source.RepoURL)
fmt.Printf(printOpFmtStr, "Target:", source.TargetRevision)
fmt.Printf(printOpFmtStr, "Path:", source.Path)
printAppSourceDetails(&source)
var wds []string
var status string
var allow, deny, inactiveAllows bool
@@ -502,11 +503,11 @@ func printAppSummaryTable(app *argoappv1.Application, appURL string, windows *ar
syncStatusStr := string(app.Status.Sync.Status)
switch app.Status.Sync.Status {
case argoappv1.SyncStatusCodeSynced:
syncStatusStr += fmt.Sprintf(" to %s", app.Spec.Source.TargetRevision)
syncStatusStr += fmt.Sprintf(" to %s", app.Spec.GetSource().TargetRevision)
case argoappv1.SyncStatusCodeOutOfSync:
syncStatusStr += fmt.Sprintf(" from %s", app.Spec.Source.TargetRevision)
syncStatusStr += fmt.Sprintf(" from %s", app.Spec.GetSource().TargetRevision)
}
if !git.IsCommitSHA(app.Spec.Source.TargetRevision) && !git.IsTruncatedCommitSHA(app.Spec.Source.TargetRevision) && len(app.Status.Sync.Revision) > 7 {
if !git.IsCommitSHA(app.Spec.GetSource().TargetRevision) && !git.IsTruncatedCommitSHA(app.Spec.GetSource().TargetRevision) && len(app.Status.Sync.Revision) > 7 {
syncStatusStr += fmt.Sprintf(" (%s)", app.Status.Sync.Revision[0:7])
}
fmt.Printf(printOpFmtStr, "Sync Status:", syncStatusStr)
@@ -575,8 +576,8 @@ func truncateString(str string, num int) string {
// printParams prints parameters and overrides
func printParams(app *argoappv1.Application) {
if app.Spec.Source.Helm != nil {
printHelmParams(app.Spec.Source.Helm)
if app.Spec.GetSource().Helm != nil {
printHelmParams(app.Spec.GetSource().Helm)
}
}
@@ -624,7 +625,7 @@ func NewApplicationSetCommand(clientOpts *argocdclient.ClientOptions) *cobra.Com
app, err := appIf.Get(ctx, &applicationpkg.ApplicationQuery{Name: &appName, AppNamespace: &appNs})
errors.CheckError(err)
if app.Spec.Source.Plugin != nil && app.Spec.Source.Plugin.Name != "" {
if app.Spec.GetSource().Plugin != nil && app.Spec.GetSource().Plugin.Name != "" {
log.Warnf(argocommon.ConfigMapPluginCLIDeprecationWarning)
}
@@ -692,11 +693,12 @@ func NewApplicationUnsetCommand(clientOpts *argocdclient.ClientOptions) *cobra.C
app, err := appIf.Get(ctx, &applicationpkg.ApplicationQuery{Name: &appName, AppNamespace: &appNs})
errors.CheckError(err)
if app.Spec.Source.Plugin != nil && app.Spec.Source.Plugin.Name != "" {
if app.Spec.GetSource().Plugin != nil && app.Spec.GetSource().Plugin.Name != "" {
log.Warnf(argocommon.ConfigMapPluginCLIDeprecationWarning)
}
updated, nothingToUnset := unset(&app.Spec.Source, opts)
source := app.Spec.GetSource()
updated, nothingToUnset := unset(&source, opts)
if nothingToUnset {
c.HelpFunc()(c, args)
os.Exit(1)
@@ -842,18 +844,19 @@ func getLocalObjects(ctx context.Context, app *argoappv1.Application, local, loc
func getLocalObjectsString(ctx context.Context, app *argoappv1.Application, local, localRepoRoot, appLabelKey, kubeVersion string, apiVersions []string, kustomizeOptions *argoappv1.KustomizeOptions,
configManagementPlugins []*argoappv1.ConfigManagementPlugin, trackingMethod string) []string {
res, err := repository.GenerateManifests(ctx, local, localRepoRoot, app.Spec.Source.TargetRevision, &repoapiclient.ManifestRequest{
Repo: &argoappv1.Repository{Repo: app.Spec.Source.RepoURL},
source := app.Spec.GetSource()
res, err := repository.GenerateManifests(ctx, local, localRepoRoot, source.TargetRevision, &repoapiclient.ManifestRequest{
Repo: &argoappv1.Repository{Repo: source.RepoURL},
AppLabelKey: appLabelKey,
AppName: app.Name,
Namespace: app.Spec.Destination.Namespace,
ApplicationSource: &app.Spec.Source,
ApplicationSource: &source,
KustomizeOptions: kustomizeOptions,
KubeVersion: kubeVersion,
ApiVersions: apiVersions,
Plugins: configManagementPlugins,
TrackingMethod: trackingMethod,
}, true, &git.NoopCredsStore{}, resource.MustParse("0"))
}, true, &git.NoopCredsStore{}, resource.MustParse("0"), nil)
errors.CheckError(err)
return res.Manifests
@@ -930,7 +933,7 @@ func NewApplicationDiffCommand(clientOpts *argocdclient.ClientOptions) *cobra.Co
})
errors.CheckError(err)
if app.Spec.Source.Plugin != nil && app.Spec.Source.Plugin.Name != "" {
if app.Spec.GetSource().Plugin != nil && app.Spec.GetSource().Plugin.Name != "" {
log.Warnf(argocommon.ConfigMapPluginCLIDeprecationWarning)
}
@@ -964,7 +967,7 @@ func NewApplicationDiffCommand(clientOpts *argocdclient.ClientOptions) *cobra.Co
diffOption.serversideRes = res
} else {
fmt.Fprintf(os.Stderr, "Warning: local diff without --server-side-generate is deprecated and does not work with plugins. Server-side generation will be the default in v2.6.")
fmt.Fprintf(os.Stderr, "Warning: local diff without --server-side-generate is deprecated and does not work with plugins. Server-side generation will be the default in v2.7.")
conn, clusterIf := clientset.NewClusterClientOrDie()
defer argoio.Close(conn)
cluster, err := clusterIf.Get(ctx, &clusterpkg.ClusterQuery{Name: app.Spec.Destination.Name, Server: app.Spec.Destination.Server})
@@ -1247,7 +1250,7 @@ func printApplicationTable(apps []argoappv1.Application, output *string) {
formatConditionsSummary(app),
}
if *output == "wide" {
vals = append(vals, app.Spec.Source.RepoURL, app.Spec.Source.Path, app.Spec.Source.TargetRevision)
vals = append(vals, app.Spec.GetSource().RepoURL, app.Spec.GetSource().Path, app.Spec.GetSource().TargetRevision)
}
_, _ = fmt.Fprintf(w, fmtStr, vals...)
}
@@ -1300,7 +1303,7 @@ func NewApplicationListCommand(clientOpts *argocdclient.ClientOptions) *cobra.Co
}
var appsWithDeprecatedPlugins []string
for _, app := range appList {
if app.Spec.Source.Plugin != nil && app.Spec.Source.Plugin.Name != "" {
if app.Spec.GetSource().Plugin != nil && app.Spec.GetSource().Plugin.Name != "" {
appsWithDeprecatedPlugins = append(appsWithDeprecatedPlugins, app.Name)
}
}
@@ -1373,6 +1376,7 @@ const (
resourceFieldCount = 3
resourceFieldNamespaceDelimiter = "/"
resourceFieldNameWithNamespaceCount = 2
resourceExcludeIndicator = "!"
)
// resource is GROUP:KIND:NAMESPACE/NAME or GROUP:KIND:NAME
@@ -1397,6 +1401,12 @@ func parseSelectedResources(resources []string) ([]*argoappv1.SyncOperationResou
}
for _, resource := range resources {
isExcluded := false
// check if the resource flag starts with a '!'
if strings.HasPrefix(resource, resourceExcludeIndicator) {
resource = strings.TrimPrefix(resource, resourceExcludeIndicator)
isExcluded = true
}
fields := strings.Split(resource, resourceFieldDelimiter)
if len(fields) != resourceFieldCount {
return nil, fmt.Errorf("Resource should have GROUP%sKIND%sNAME, but instead got: %s", resourceFieldDelimiter, resourceFieldDelimiter, resource)
@@ -1410,6 +1420,7 @@ func parseSelectedResources(resources []string) ([]*argoappv1.SyncOperationResou
Kind: fields[1],
Name: name,
Namespace: namespace,
Exclude: isExcluded,
})
}
return selectedResources, nil
@@ -1444,6 +1455,16 @@ func NewApplicationWaitCommand(clientOpts *argocdclient.ClientOptions) *cobra.Co
# Wait for multiple apps
argocd app wait my-app other-app
# Wait for apps by resource
# Resource should be formatted as GROUP:KIND:NAME. If no GROUP is specified then :KIND:NAME.
argocd app wait my-app --resource :Service:my-service
argocd app wait my-app --resource argoproj.io:Rollout:my-rollout
argocd app wait my-app --resource '!apps:Deployment:my-service'
argocd app wait my-app --resource apps:Deployment:my-service --resource :Service:my-service
argocd app wait my-app --resource '!*:Service:*'
# Specify namespace if the application has resources with the same name in different namespaces
argocd app wait my-app --resource argoproj.io:Rollout:my-namespace/my-rollout
# Wait for apps by label, in this example we waiting for apps that are children of another app (aka app-of-apps)
argocd app wait -l app.kubernetes.io/instance=my-app
argocd app wait -l app.kubernetes.io/instance!=my-app
@@ -1482,7 +1503,7 @@ func NewApplicationWaitCommand(clientOpts *argocdclient.ClientOptions) *cobra.Co
command.Flags().BoolVar(&watch.suspended, "suspended", false, "Wait for suspended")
command.Flags().BoolVar(&watch.degraded, "degraded", false, "Wait for degraded")
command.Flags().StringVarP(&selector, "selector", "l", "", "Wait for apps by label. Supports '=', '==', '!=', in, notin, exists & not exists. Matching apps must satisfy all of the specified label constraints.")
command.Flags().StringArrayVar(&resources, "resource", []string{}, fmt.Sprintf("Sync only specific resources as GROUP%sKIND%sNAME. Fields may be blank. This option may be specified repeatedly", resourceFieldDelimiter, resourceFieldDelimiter))
command.Flags().StringArrayVar(&resources, "resource", []string{}, fmt.Sprintf("Sync only specific resources as GROUP%[1]sKIND%[1]sNAME or %[2]sGROUP%[1]sKIND%[1]sNAME. Fields may be blank and '*' can be used. This option may be specified repeatedly", resourceFieldDelimiter, resourceExcludeIndicator))
command.Flags().BoolVar(&watch.operation, "operation", false, "Wait for pending operations")
command.Flags().UintVar(&timeout, "timeout", defaultCheckTimeoutSeconds, "Time out after this many seconds")
return command
@@ -1542,6 +1563,9 @@ func NewApplicationSyncCommand(clientOpts *argocdclient.ClientOptions) *cobra.Co
# Resource should be formatted as GROUP:KIND:NAME. If no GROUP is specified then :KIND:NAME
argocd app sync my-app --resource :Service:my-service
argocd app sync my-app --resource argoproj.io:Rollout:my-rollout
argocd app sync my-app --resource '!apps:Deployment:my-service'
argocd app sync my-app --resource apps:Deployment:my-service --resource :Service:my-service
argocd app sync my-app --resource '!*:Service:*'
# Specify namespace if the application has resources with the same name in different namespaces
argocd app sync my-app --resource argoproj.io:Rollout:my-namespace/my-rollout`,
Run: func(c *cobra.Command, args []string) {
@@ -1625,14 +1649,28 @@ func NewApplicationSyncCommand(clientOpts *argocdclient.ClientOptions) *cobra.Co
var localObjsStrings []string
diffOption := &DifferenceOption{}
if local != "" {
app, err := appIf.Get(ctx, &applicationpkg.ApplicationQuery{
Name: &appName,
AppNamespace: &appNs,
})
errors.CheckError(err)
if app.Spec.Source.Plugin != nil && app.Spec.Source.Plugin.Name != "" {
app, err := appIf.Get(ctx, &applicationpkg.ApplicationQuery{
Name: &appName,
AppNamespace: &appNs,
})
errors.CheckError(err)
if app.Spec.HasMultipleSources() {
log.Fatal("argocd cli does not work on multi-source app")
return
}
// filters out only those resources that needs to be synced
filteredResources := filterAppResources(app, selectedResources)
// if resources are provided and no app resources match, then return error
if len(resources) > 0 && len(filteredResources) == 0 {
log.Fatalf("No matching app resources found for resource filter: %v", strings.Join(resources, ", "))
}
if local != "" {
if app.Spec.GetSource().Plugin != nil && app.Spec.GetSource().Plugin.Name != "" {
log.Warnf(argocommon.ConfigMapPluginCLIDeprecationWarning)
}
@@ -1681,7 +1719,7 @@ func NewApplicationSyncCommand(clientOpts *argocdclient.ClientOptions) *cobra.Co
AppNamespace: &appNs,
DryRun: &dryRun,
Revision: &revision,
Resources: selectedResources,
Resources: filteredResources,
Prune: &prune,
Manifests: localObjsStrings,
Infos: getInfos(infos),
@@ -1709,13 +1747,7 @@ func NewApplicationSyncCommand(clientOpts *argocdclient.ClientOptions) *cobra.Co
}
}
if diffChanges {
app, err := appIf.Get(ctx, &applicationpkg.ApplicationQuery{
Name: &appName,
AppNamespace: &appNs,
})
errors.CheckError(err)
if app.Spec.Source.Plugin != nil && app.Spec.Source.Plugin.Name != "" {
if app.Spec.GetSource().Plugin != nil && app.Spec.GetSource().Plugin.Name != "" {
log.Warnf(argocommon.ConfigMapPluginCLIDeprecationWarning)
}
@@ -1767,7 +1799,7 @@ func NewApplicationSyncCommand(clientOpts *argocdclient.ClientOptions) *cobra.Co
command.Flags().BoolVar(&dryRun, "dry-run", false, "Preview apply without affecting cluster")
command.Flags().BoolVar(&prune, "prune", false, "Allow deleting unexpected resources")
command.Flags().StringVar(&revision, "revision", "", "Sync to a specific revision. Preserves parameter overrides")
command.Flags().StringArrayVar(&resources, "resource", []string{}, fmt.Sprintf("Sync only specific resources as GROUP%sKIND%sNAME. Fields may be blank. This option may be specified repeatedly", resourceFieldDelimiter, resourceFieldDelimiter))
command.Flags().StringArrayVar(&resources, "resource", []string{}, fmt.Sprintf("Sync only specific resources as GROUP%[1]sKIND%[1]sNAME or %[2]sGROUP%[1]sKIND%[1]sNAME. Fields may be blank and '*' can be used. This option may be specified repeatedly", resourceFieldDelimiter, resourceExcludeIndicator))
command.Flags().StringVarP(&selector, "selector", "l", "", "Sync apps that match this label. Supports '=', '==', '!=', in, notin, exists & not exists. Matching apps must satisfy all of the specified label constraints.")
command.Flags().StringArrayVar(&labels, "label", []string{}, "Sync only specific resources with a label. This option may be specified repeatedly.")
command.Flags().UintVar(&timeout, "timeout", defaultCheckTimeoutSeconds, "Time out after this many seconds")
@@ -1892,15 +1924,9 @@ func getResourceStates(app *argoappv1.Application, selectedResources []*argoappv
}
// filter out not selected resources
if len(selectedResources) > 0 {
r := []argoappv1.SyncOperationResource{}
for _, res := range selectedResources {
if res != nil {
r = append(r, *res)
}
}
for i := len(states) - 1; i >= 0; i-- {
res := states[i]
if !argo.ContainsSyncResource(res.Name, res.Namespace, schema.GroupVersionKind{Group: res.Group, Kind: res.Kind}, r) {
if !argo.IncludeResource(res.Name, res.Namespace, schema.GroupVersionKind{Group: res.Group, Kind: res.Kind}, selectedResources) {
states = append(states[:i], states[i+1:]...)
}
}
@@ -1908,6 +1934,26 @@ func getResourceStates(app *argoappv1.Application, selectedResources []*argoappv
return states
}
// filterAppResources selects the app resources that match atleast one of the resource filters.
func filterAppResources(app *argoappv1.Application, selectedResources []*argoappv1.SyncOperationResource) []*argoappv1.SyncOperationResource {
var filteredResources []*argoappv1.SyncOperationResource
if app != nil && len(selectedResources) > 0 {
for i := range app.Status.Resources {
appResource := app.Status.Resources[i]
if (argo.IncludeResource(appResource.Name, appResource.Namespace,
schema.GroupVersionKind{Group: appResource.Group, Kind: appResource.Kind}, selectedResources)) {
filteredResources = append(filteredResources, &argoappv1.SyncOperationResource{
Group: appResource.Group,
Kind: appResource.Kind,
Name: appResource.Name,
Namespace: appResource.Namespace,
})
}
}
}
return filteredResources
}
func groupResourceStates(app *argoappv1.Application, selectedResources []*argoappv1.SyncOperationResource) map[string]*resourceState {
resStates := make(map[string]*resourceState)
for _, result := range getResourceStates(app, selectedResources) {
@@ -2087,8 +2133,9 @@ func setParameterOverrides(app *argoappv1.Application, parameters []string) {
if len(parameters) == 0 {
return
}
source := app.Spec.GetSource()
var sourceType argoappv1.ApplicationSourceType
if st, _ := app.Spec.Source.ExplicitType(); st != nil {
if st, _ := source.ExplicitType(); st != nil {
sourceType = *st
} else if app.Status.SourceType != "" {
sourceType = app.Status.SourceType
@@ -2100,8 +2147,8 @@ func setParameterOverrides(app *argoappv1.Application, parameters []string) {
switch sourceType {
case argoappv1.ApplicationSourceTypeHelm:
if app.Spec.Source.Helm == nil {
app.Spec.Source.Helm = &argoappv1.ApplicationSourceHelm{}
if source.Helm == nil {
source.Helm = &argoappv1.ApplicationSourceHelm{}
}
for _, p := range parameters {
newParam, err := argoappv1.NewHelmParameter(p, false)
@@ -2109,7 +2156,7 @@ func setParameterOverrides(app *argoappv1.Application, parameters []string) {
log.Error(err)
continue
}
app.Spec.Source.Helm.AddParameter(*newParam)
source.Helm.AddParameter(*newParam)
}
default:
log.Fatalf("Parameters can only be set against Helm applications")
@@ -2161,7 +2208,7 @@ func NewApplicationHistoryCommand(clientOpts *argocdclient.ClientOptions) *cobra
})
errors.CheckError(err)
if app.Spec.Source.Plugin != nil && app.Spec.Source.Plugin.Name != "" {
if app.Spec.GetSource().Plugin != nil && app.Spec.GetSource().Plugin.Name != "" {
log.Warnf(argocommon.ConfigMapPluginCLIDeprecationWarning)
}
@@ -2225,7 +2272,7 @@ func NewApplicationRollbackCommand(clientOpts *argocdclient.ClientOptions) *cobr
})
errors.CheckError(err)
if app.Spec.Source.Plugin != nil && app.Spec.Source.Plugin.Name != "" {
if app.Spec.GetSource().Plugin != nil && app.Spec.GetSource().Plugin.Name != "" {
log.Warnf(argocommon.ConfigMapPluginCLIDeprecationWarning)
}
@@ -2312,7 +2359,7 @@ func NewApplicationManifestsCommand(clientOpts *argocdclient.ClientOptions) *cob
app, err := appIf.Get(context.Background(), &applicationpkg.ApplicationQuery{Name: &appName})
errors.CheckError(err)
if app.Spec.Source.Plugin != nil && app.Spec.Source.Plugin.Name != "" {
if app.Spec.GetSource().Plugin != nil && app.Spec.GetSource().Plugin.Name != "" {
log.Warnf(argocommon.ConfigMapPluginCLIDeprecationWarning)
}
@@ -2415,7 +2462,7 @@ func NewApplicationEditCommand(clientOpts *argocdclient.ClientOptions) *cobra.Co
})
errors.CheckError(err)
if app.Spec.Source.Plugin != nil && app.Spec.Source.Plugin.Name != "" {
if app.Spec.GetSource().Plugin != nil && app.Spec.GetSource().Plugin.Name != "" {
log.Warnf(argocommon.ConfigMapPluginCLIDeprecationWarning)
}

View File

@@ -498,7 +498,7 @@ func TestPrintAppSummaryTable(t *testing.T) {
},
Project: "default",
Destination: v1alpha1.ApplicationDestination{Server: "local", Namespace: "argocd"},
Source: v1alpha1.ApplicationSource{
Source: &v1alpha1.ApplicationSource{
RepoURL: "test",
TargetRevision: "master",
Path: "/test",
@@ -604,7 +604,7 @@ func TestPrintParams(t *testing.T) {
output, _ := captureOutput(func() error {
app := &v1alpha1.Application{
Spec: v1alpha1.ApplicationSpec{
Source: v1alpha1.ApplicationSource{
Source: &v1alpha1.ApplicationSource{
Helm: &v1alpha1.ApplicationSourceHelm{
Parameters: []v1alpha1.HelmParameter{
{
@@ -904,11 +904,220 @@ func Test_unset_nothingToUnset(t *testing.T) {
}
}
func TestFilterAppResources(t *testing.T) {
// App resources
var (
appReplicaSet1 = v1alpha1.ResourceStatus{
Group: "apps",
Kind: "ReplicaSet",
Namespace: "default",
Name: "replicaSet-name1",
}
appReplicaSet2 = v1alpha1.ResourceStatus{
Group: "apps",
Kind: "ReplicaSet",
Namespace: "default",
Name: "replicaSet-name2",
}
appJob = v1alpha1.ResourceStatus{
Group: "batch",
Kind: "Job",
Namespace: "default",
Name: "job-name",
}
appService1 = v1alpha1.ResourceStatus{
Group: "",
Kind: "Service",
Namespace: "default",
Name: "service-name1",
}
appService2 = v1alpha1.ResourceStatus{
Group: "",
Kind: "Service",
Namespace: "default",
Name: "service-name2",
}
appDeployment = v1alpha1.ResourceStatus{
Group: "apps",
Kind: "Deployment",
Namespace: "default",
Name: "deployment-name",
}
)
app := v1alpha1.Application{
Status: v1alpha1.ApplicationStatus{
Resources: []v1alpha1.ResourceStatus{
appReplicaSet1, appReplicaSet2, appJob, appService1, appService2, appDeployment},
},
}
// Resource filters
var (
blankValues = argoappv1.SyncOperationResource{
Group: "",
Kind: "",
Name: "",
Namespace: "",
Exclude: false}
// *:*:*
includeAllResources = argoappv1.SyncOperationResource{
Group: "*",
Kind: "*",
Name: "*",
Namespace: "",
Exclude: false}
// !*:*:*
excludeAllResources = argoappv1.SyncOperationResource{
Group: "*",
Kind: "*",
Name: "*",
Namespace: "",
Exclude: true}
// *:Service:*
includeAllServiceResources = argoappv1.SyncOperationResource{
Group: "*",
Kind: "Service",
Name: "*",
Namespace: "",
Exclude: false}
// !*:Service:*
excludeAllServiceResources = argoappv1.SyncOperationResource{
Group: "*",
Kind: "Service",
Name: "*",
Namespace: "",
Exclude: true}
// apps:ReplicaSet:replicaSet-name1
includeReplicaSet1Resource = argoappv1.SyncOperationResource{
Group: "apps",
Kind: "ReplicaSet",
Name: "replicaSet-name1",
Namespace: "",
Exclude: false}
// !apps:ReplicaSet:replicaSet-name2
excludeReplicaSet2Resource = argoappv1.SyncOperationResource{
Group: "apps",
Kind: "ReplicaSet",
Name: "replicaSet-name2",
Namespace: "",
Exclude: true}
)
// Filtered resources
var (
replicaSet1 = v1alpha1.SyncOperationResource{
Group: "apps",
Kind: "ReplicaSet",
Namespace: "default",
Name: "replicaSet-name1",
}
replicaSet2 = v1alpha1.SyncOperationResource{
Group: "apps",
Kind: "ReplicaSet",
Namespace: "default",
Name: "replicaSet-name2",
}
job = v1alpha1.SyncOperationResource{
Group: "batch",
Kind: "Job",
Namespace: "default",
Name: "job-name",
}
service1 = v1alpha1.SyncOperationResource{
Group: "",
Kind: "Service",
Namespace: "default",
Name: "service-name1",
}
service2 = v1alpha1.SyncOperationResource{
Group: "",
Kind: "Service",
Namespace: "default",
Name: "service-name2",
}
deployment = v1alpha1.SyncOperationResource{
Group: "apps",
Kind: "Deployment",
Namespace: "default",
Name: "deployment-name",
}
)
tests := []struct {
testName string
selectedResources []*argoappv1.SyncOperationResource
expectedResult []*argoappv1.SyncOperationResource
}{
//--resource apps:ReplicaSet:replicaSet-name1 --resource *:Service:*
{testName: "Include ReplicaSet replicaSet-name1 resouce and all service resources",
selectedResources: []*argoappv1.SyncOperationResource{&includeAllServiceResources, &includeReplicaSet1Resource},
expectedResult: []*argoappv1.SyncOperationResource{&replicaSet1, &service1, &service2},
},
//--resource apps:ReplicaSet:replicaSet-name1 --resource !*:Service:*
{testName: "Include ReplicaSet replicaSet-name1 resouce and exclude all service resources",
selectedResources: []*argoappv1.SyncOperationResource{&excludeAllServiceResources, &includeReplicaSet1Resource},
expectedResult: []*argoappv1.SyncOperationResource{&replicaSet1, &replicaSet2, &job, &deployment},
},
// --resource !apps:ReplicaSet:replicaSet-name2 --resource !*:Service:*
{testName: "Exclude ReplicaSet replicaSet-name2 resouce and all service resources",
selectedResources: []*argoappv1.SyncOperationResource{&excludeReplicaSet2Resource, &excludeAllServiceResources},
expectedResult: []*argoappv1.SyncOperationResource{&replicaSet1, &replicaSet2, &job, &service1, &service2, &deployment},
},
// --resource !apps:ReplicaSet:replicaSet-name2
{testName: "Exclude ReplicaSet replicaSet-name2 resouce",
selectedResources: []*argoappv1.SyncOperationResource{&excludeReplicaSet2Resource},
expectedResult: []*argoappv1.SyncOperationResource{&replicaSet1, &job, &service1, &service2, &deployment},
},
// --resource apps:ReplicaSet:replicaSet-name1
{testName: "Include ReplicaSet replicaSet-name1 resouce",
selectedResources: []*argoappv1.SyncOperationResource{&includeReplicaSet1Resource},
expectedResult: []*argoappv1.SyncOperationResource{&replicaSet1},
},
// --resource !*:Service:*
{testName: "Exclude Service resouces",
selectedResources: []*argoappv1.SyncOperationResource{&excludeAllServiceResources},
expectedResult: []*argoappv1.SyncOperationResource{&replicaSet1, &replicaSet2, &job, &deployment},
},
// --resource *:Service:*
{testName: "Include Service resouces",
selectedResources: []*argoappv1.SyncOperationResource{&includeAllServiceResources},
expectedResult: []*argoappv1.SyncOperationResource{&service1, &service2},
},
// --resource !*:*:*
{testName: "Exclude all resouces",
selectedResources: []*argoappv1.SyncOperationResource{&excludeAllResources},
expectedResult: nil,
},
// --resource *:*:*
{testName: "Include all resouces",
selectedResources: []*argoappv1.SyncOperationResource{&includeAllResources},
expectedResult: []*argoappv1.SyncOperationResource{&replicaSet1, &replicaSet2, &job, &service1, &service2, &deployment},
},
{testName: "No Filters",
selectedResources: []*argoappv1.SyncOperationResource{&blankValues},
expectedResult: nil,
},
{testName: "Empty Filter",
selectedResources: []*argoappv1.SyncOperationResource{},
expectedResult: nil,
},
}
for _, test := range tests {
t.Run(test.testName, func(t *testing.T) {
filteredResources := filterAppResources(&app, test.selectedResources)
assert.Equal(t, test.expectedResult, filteredResources)
})
}
}
func TestParseSelectedResources(t *testing.T) {
resources := []string{"v1alpha:Application:test", "v1alpha:Application:namespace/test"}
resources := []string{"v1alpha:Application:test",
"v1alpha:Application:namespace/test",
"!v1alpha:Application:test",
"apps:Deployment:default/test",
"!*:*:*"}
operationResources, err := parseSelectedResources(resources)
assert.NoError(t, err)
assert.Len(t, operationResources, 2)
assert.Len(t, operationResources, 5)
assert.Equal(t, *operationResources[0], v1alpha1.SyncOperationResource{
Namespace: "",
Name: "test",
@@ -921,6 +1130,27 @@ func TestParseSelectedResources(t *testing.T) {
Kind: "Application",
Group: "v1alpha",
})
assert.Equal(t, *operationResources[2], v1alpha1.SyncOperationResource{
Namespace: "",
Name: "test",
Kind: "Application",
Group: "v1alpha",
Exclude: true,
})
assert.Equal(t, *operationResources[3], v1alpha1.SyncOperationResource{
Namespace: "default",
Name: "test",
Kind: "Deployment",
Group: "apps",
Exclude: false,
})
assert.Equal(t, *operationResources[4], v1alpha1.SyncOperationResource{
Namespace: "",
Name: "*",
Kind: "*",
Group: "*",
Exclude: true,
})
}
func TestParseSelectedResourcesIncorrect(t *testing.T) {
@@ -985,7 +1215,7 @@ func TestPrintApplicationTableWide(t *testing.T) {
Server: "http://localhost:8080",
Namespace: "default",
},
Source: v1alpha1.ApplicationSource{
Source: &v1alpha1.ApplicationSource{
RepoURL: "https://github.com/argoproj/argocd-example-apps",
Path: "guestbook",
TargetRevision: "123",
@@ -1261,7 +1491,7 @@ func testApp(name, project string, labels map[string]string, annotations map[str
Finalizers: finalizers,
},
Spec: argoappv1.ApplicationSpec{
Source: argoappv1.ApplicationSource{
Source: &argoappv1.ApplicationSource{
RepoURL: "https://github.com/argoproj/argocd-example-apps.git",
},
Project: project,

View File

@@ -95,7 +95,7 @@ func NewApplicationSetGetCommand(clientOpts *argocdclient.ClientOptions) *cobra.
fmt.Println()
}
if showParams {
printHelmParams(appSet.Spec.Template.Spec.Source.Helm)
printHelmParams(appSet.Spec.Template.Spec.GetSource().Helm)
}
default:
errors.CheckError(fmt.Errorf("unknown output format: %s", output))
@@ -317,7 +317,7 @@ func printApplicationSetTable(apps []arogappsetv1.ApplicationSet, output *string
conditions,
}
if *output == "wide" {
vals = append(vals, app.Spec.Template.Spec.Source.RepoURL, app.Spec.Template.Spec.Source.Path, app.Spec.Template.Spec.Source.TargetRevision)
vals = append(vals, app.Spec.Template.Spec.GetSource().RepoURL, app.Spec.Template.Spec.GetSource().Path, app.Spec.Template.Spec.GetSource().TargetRevision)
}
_, _ = fmt.Fprintf(w, fmtStr, vals...)
}
@@ -333,14 +333,15 @@ func getServerForAppSet(appSet *arogappsetv1.ApplicationSet) string {
}
func printAppSetSummaryTable(appSet *arogappsetv1.ApplicationSet) {
source := appSet.Spec.Template.Spec.GetSource()
fmt.Printf(printOpFmtStr, "Name:", appSet.Name)
fmt.Printf(printOpFmtStr, "Project:", appSet.Spec.Template.Spec.GetProject())
fmt.Printf(printOpFmtStr, "Server:", getServerForAppSet(appSet))
fmt.Printf(printOpFmtStr, "Namespace:", appSet.Spec.Template.Spec.Destination.Namespace)
fmt.Printf(printOpFmtStr, "Repo:", appSet.Spec.Template.Spec.Source.RepoURL)
fmt.Printf(printOpFmtStr, "Target:", appSet.Spec.Template.Spec.Source.TargetRevision)
fmt.Printf(printOpFmtStr, "Path:", appSet.Spec.Template.Spec.Source.Path)
printAppSourceDetails(&appSet.Spec.Template.Spec.Source)
fmt.Printf(printOpFmtStr, "Repo:", source.RepoURL)
fmt.Printf(printOpFmtStr, "Target:", source.TargetRevision)
fmt.Printf(printOpFmtStr, "Path:", source.Path)
printAppSourceDetails(&source)
var syncPolicy string
if appSet.Spec.SyncPolicy != nil && appSet.Spec.Template.Spec.SyncPolicy.Automated != nil {

View File

@@ -27,6 +27,17 @@ import (
"github.com/argoproj/argo-cd/v2/util/text/label"
)
const (
// type of the cluster ID is 'name'
clusterIdTypeName = "name"
// cluster field is 'name'
clusterFieldName = "name"
// cluster field is 'namespaces'
clusterFieldNamespaces = "namespaces"
// indicates managing all namespaces
allNamespaces = "*"
)
// NewClusterCommand returns a new instance of an `argocd cluster` command
func NewClusterCommand(clientOpts *argocdclient.ClientOptions, pathOpts *clientcmd.PathOptions) *cobra.Command {
var command = &cobra.Command{
@@ -47,7 +58,10 @@ func NewClusterCommand(clientOpts *argocdclient.ClientOptions, pathOpts *clientc
# Remove a target cluster context from ArgoCD
argocd cluster rm example-cluster
`,
# Set a target cluster context from ArgoCD
argocd cluster set CLUSTER_NAME --name new-cluster-name --namespace '*'
argocd cluster set CLUSTER_NAME --name new-cluster-name --namespace namespace-one --namespace namespace-two`,
}
command.AddCommand(NewClusterAddCommand(clientOpts, pathOpts))
@@ -55,6 +69,7 @@ func NewClusterCommand(clientOpts *argocdclient.ClientOptions, pathOpts *clientc
command.AddCommand(NewClusterListCommand(clientOpts))
command.AddCommand(NewClusterRemoveCommand(clientOpts, pathOpts))
command.AddCommand(NewClusterRotateAuthCommand(clientOpts))
command.AddCommand(NewClusterSetCommand(clientOpts))
return command
}
@@ -185,6 +200,72 @@ func getRestConfig(pathOpts *clientcmd.PathOptions, ctxName string) (*rest.Confi
return conf, nil
}
// NewClusterSetCommand returns a new instance of an `argocd cluster set` command
func NewClusterSetCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command {
var (
clusterOptions cmdutil.ClusterOptions
clusterName string
)
var command = &cobra.Command{
Use: "set NAME",
Short: "Set cluster information",
Example: ` # Set cluster information
argocd cluster set CLUSTER_NAME --name new-cluster-name --namespace '*'
argocd cluster set CLUSTER_NAME --name new-cluster-name --namespace namespace-one --namespace namespace-two`,
Run: func(c *cobra.Command, args []string) {
ctx := c.Context()
if len(args) != 1 {
c.HelpFunc()(c, args)
os.Exit(1)
}
// name of the cluster whose fields have to be updated.
clusterName = args[0]
conn, clusterIf := headless.NewClientOrDie(clientOpts, c).NewClusterClientOrDie()
defer io.Close(conn)
// checks the fields that needs to be updated
updatedFields := checkFieldsToUpdate(clusterOptions)
namespaces := clusterOptions.Namespaces
// check if all namespaces have to be considered
if len(namespaces) == 1 && strings.EqualFold(namespaces[0], allNamespaces) {
namespaces[0] = ""
}
if updatedFields != nil {
clusterUpdateRequest := clusterpkg.ClusterUpdateRequest{
Cluster: &argoappv1.Cluster{
Name: clusterOptions.Name,
Namespaces: namespaces,
},
UpdatedFields: updatedFields,
Id: &clusterpkg.ClusterID{
Type: clusterIdTypeName,
Value: clusterName,
},
}
_, err := clusterIf.Update(ctx, &clusterUpdateRequest)
errors.CheckError(err)
fmt.Printf("Cluster '%s' updated.\n", clusterName)
} else {
fmt.Print("Specify the cluster field to be updated.\n")
}
},
}
command.Flags().StringVar(&clusterOptions.Name, "name", "", "Overwrite the cluster name")
command.Flags().StringArrayVar(&clusterOptions.Namespaces, "namespace", nil, "List of namespaces which are allowed to manage. Specify '*' to manage all namespaces")
return command
}
// checkFieldsToUpdate returns the fields that needs to be updated
func checkFieldsToUpdate(clusterOptions cmdutil.ClusterOptions) []string {
var updatedFields []string
if clusterOptions.Name != "" {
updatedFields = append(updatedFields, clusterFieldName)
}
if clusterOptions.Namespaces != nil {
updatedFields = append(updatedFields, clusterFieldNamespaces)
}
return updatedFields
}
// NewClusterGetCommand returns a new instance of an `argocd cluster get` command
func NewClusterGetCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command {
var (

View File

@@ -146,6 +146,7 @@ __argocd_custom_func() {
;;
argocd_cluster_get | \
argocd_cluster_rm | \
argocd_cluster_set | \
argocd_login | \
argocd_cluster_add)
__argocd_list_servers

View File

@@ -202,17 +202,18 @@ func StartLocalServer(ctx context.Context, clientOpts *apiclient.ClientOptions,
}
appstateCache := appstatecache.NewCache(cache.NewCache(&forwardCacheClient{namespace: namespace, context: ctxStr}), time.Hour)
srv := server.NewServer(ctx, server.ArgoCDServerOpts{
EnableGZip: false,
Namespace: namespace,
ListenPort: *port,
AppClientset: appClientset,
DisableAuth: true,
RedisClient: redis.NewClient(&redis.Options{Addr: mr.Addr()}),
Cache: servercache.NewCache(appstateCache, 0, 0, 0),
KubeClientset: kubeClientset,
Insecure: true,
ListenHost: *address,
RepoClientset: &forwardRepoClientset{namespace: namespace, context: ctxStr},
EnableGZip: false,
Namespace: namespace,
ListenPort: *port,
AppClientset: appClientset,
DisableAuth: true,
RedisClient: redis.NewClient(&redis.Options{Addr: mr.Addr()}),
Cache: servercache.NewCache(appstateCache, 0, 0, 0),
KubeClientset: kubeClientset,
Insecure: true,
ListenHost: *address,
RepoClientset: &forwardRepoClientset{namespace: namespace, context: ctxStr},
EnableProxyExtension: false,
})
srv.Init(ctx)

View File

@@ -12,7 +12,7 @@ import (
"strings"
"time"
"github.com/coreos/go-oidc"
"github.com/coreos/go-oidc/v3/oidc"
"github.com/golang-jwt/jwt/v4"
log "github.com/sirupsen/logrus"
"github.com/skratchdot/open-golang/open"

View File

@@ -4,7 +4,7 @@ import (
"fmt"
"os"
"github.com/coreos/go-oidc"
"github.com/coreos/go-oidc/v3/oidc"
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"

View File

@@ -70,6 +70,9 @@ func NewRepoAddCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command {
# Add a private Git repository on GitHub Enterprise via GitHub App
argocd repo add https://ghe.example.com/repos/repo --github-app-id 1 --github-app-installation-id 2 --github-app-private-key-path test.private-key.pem --github-app-enterprise-base-url https://ghe.example.com/api/v3
# Add a private Git repository on Google Cloud Sources via GCP service account credentials
argocd repo add https://source.developers.google.com/p/my-google-cloud-project/r/my-repo --gcp-service-account-key-path service-account-key.json
`
var command = &cobra.Command{
@@ -135,6 +138,17 @@ func NewRepoAddCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command {
}
}
if repoOpts.GCPServiceAccountKeyPath != "" {
if git.IsHTTPSURL(repoOpts.Repo.Repo) {
gcpServiceAccountKey, err := os.ReadFile(repoOpts.GCPServiceAccountKeyPath)
errors.CheckError(err)
repoOpts.Repo.GCPServiceAccountKey = string(gcpServiceAccountKey)
} else {
err := fmt.Errorf("--gcp-service-account-key-path is only supported for HTTPS repositories")
errors.CheckError(err)
}
}
// Set repository connection properties only when creating repository, not
// when creating repository credentials.
// InsecureIgnoreHostKey is deprecated and only here for backwards compat
@@ -146,6 +160,7 @@ func NewRepoAddCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command {
repoOpts.Repo.GithubAppInstallationId = repoOpts.GithubAppInstallationId
repoOpts.Repo.GitHubAppEnterpriseBaseURL = repoOpts.GitHubAppEnterpriseBaseURL
repoOpts.Repo.Proxy = repoOpts.Proxy
repoOpts.Repo.ForceHttpBasicAuth = repoOpts.ForceHttpBasicAuth
if repoOpts.Repo.Type == "helm" && repoOpts.Repo.Name == "" {
errors.CheckError(fmt.Errorf("Must specify --name for repos of type 'helm'"))
@@ -184,6 +199,8 @@ func NewRepoAddCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command {
GithubAppEnterpriseBaseUrl: repoOpts.Repo.GitHubAppEnterpriseBaseURL,
Proxy: repoOpts.Proxy,
Project: repoOpts.Repo.Project,
GcpServiceAccountKey: repoOpts.Repo.GCPServiceAccountKey,
ForceHttpBasicAuth: repoOpts.Repo.ForceHttpBasicAuth,
}
_, err := repoIf.ValidateAccess(ctx, &repoAccessReq)
errors.CheckError(err)
@@ -294,7 +311,7 @@ func NewRepoListCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command {
},
}
command.Flags().StringVarP(&output, "output", "o", "wide", "Output format. One of: json|yaml|wide|url")
command.Flags().StringVar(&refresh, "refresh", "", "Force a cache refresh on connection status")
command.Flags().StringVar(&refresh, "refresh", "", "Force a cache refresh on connection status , must be one of: 'hard'")
return command
}
@@ -345,6 +362,6 @@ func NewRepoGetCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command {
},
}
command.Flags().StringVarP(&output, "output", "o", "wide", "Output format. One of: json|yaml|wide|url")
command.Flags().StringVar(&refresh, "refresh", "", "Force a cache refresh on connection status")
command.Flags().StringVar(&refresh, "refresh", "", "Force a cache refresh on connection status , must be one of: 'hard'")
return command
}

View File

@@ -39,12 +39,13 @@ func NewRepoCredsCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command
// NewRepoCredsAddCommand returns a new instance of an `argocd repocreds add` command
func NewRepoCredsAddCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command {
var (
repo appsv1.RepoCreds
upsert bool
sshPrivateKeyPath string
tlsClientCertPath string
tlsClientCertKeyPath string
githubAppPrivateKeyPath string
repo appsv1.RepoCreds
upsert bool
sshPrivateKeyPath string
tlsClientCertPath string
tlsClientCertKeyPath string
githubAppPrivateKeyPath string
gcpServiceAccountKeyPath string
)
// For better readability and easier formatting
@@ -62,6 +63,9 @@ func NewRepoCredsAddCommand(clientOpts *argocdclient.ClientOptions) *cobra.Comma
# Add credentials with helm oci registry so that these oci registry urls do not need to be added as repos individually.
argocd repocreds add localhost:5000/myrepo --enable-oci --type helm
# Add credentials with GCP credentials for all repositories under https://source.developers.google.com/p/my-google-cloud-project/r/
argocd repocreds add https://source.developers.google.com/p/my-google-cloud-project/r/ --gcp-service-account-key-path service-account-key.json
`
var command = &cobra.Command{
@@ -127,6 +131,18 @@ func NewRepoCredsAddCommand(clientOpts *argocdclient.ClientOptions) *cobra.Comma
}
}
// Specifying gcpServiceAccountKeyPath is only valid for HTTPS repositories
if gcpServiceAccountKeyPath != "" {
if git.IsHTTPSURL(repo.URL) {
gcpServiceAccountKey, err := os.ReadFile(gcpServiceAccountKeyPath)
errors.CheckError(err)
repo.GCPServiceAccountKey = string(gcpServiceAccountKey)
} else {
err := fmt.Errorf("--gcp-service-account-key-path is only supported for HTTPS repositories")
errors.CheckError(err)
}
}
conn, repoIf := headless.NewClientOrDie(clientOpts, c).NewRepoCredsClientOrDie()
defer io.Close(conn)
@@ -158,6 +174,8 @@ func NewRepoCredsAddCommand(clientOpts *argocdclient.ClientOptions) *cobra.Comma
command.Flags().BoolVar(&upsert, "upsert", false, "Override an existing repository with the same name even if the spec differs")
command.Flags().BoolVar(&repo.EnableOCI, "enable-oci", false, "Specifies whether helm-oci support should be enabled for this repo")
command.Flags().StringVar(&repo.Type, "type", common.DefaultRepoType, "type of the repository, \"git\" or \"helm\"")
command.Flags().StringVar(&gcpServiceAccountKeyPath, "gcp-service-account-key-path", "", "service account key for the Google Cloud Platform")
command.Flags().BoolVar(&repo.ForceHttpBasicAuth, "force-http-basic-auth", false, "whether to force basic auth when connecting via HTTP")
return command
}

View File

@@ -138,22 +138,26 @@ func SetAppSpecOptions(flags *pflag.FlagSet, spec *argoappv1.ApplicationSpec, ap
}
flags.Visit(func(f *pflag.Flag) {
visited++
source := spec.GetSourcePtr()
if source == nil {
source = &argoappv1.ApplicationSource{}
}
switch f.Name {
case "repo":
spec.Source.RepoURL = appOpts.repoURL
source.RepoURL = appOpts.repoURL
case "path":
spec.Source.Path = appOpts.appPath
source.Path = appOpts.appPath
case "helm-chart":
spec.Source.Chart = appOpts.chart
source.Chart = appOpts.chart
case "revision":
spec.Source.TargetRevision = appOpts.revision
source.TargetRevision = appOpts.revision
case "revision-history-limit":
i := int64(appOpts.revisionHistoryLimit)
spec.RevisionHistoryLimit = &i
case "values":
setHelmOpt(&spec.Source, helmOpts{valueFiles: appOpts.valuesFiles})
setHelmOpt(source, helmOpts{valueFiles: appOpts.valuesFiles})
case "ignore-missing-value-files":
setHelmOpt(&spec.Source, helmOpts{ignoreMissingValueFiles: appOpts.ignoreMissingValueFiles})
setHelmOpt(source, helmOpts{ignoreMissingValueFiles: appOpts.ignoreMissingValueFiles})
case "values-literal-file":
var data []byte
@@ -165,41 +169,41 @@ func SetAppSpecOptions(flags *pflag.FlagSet, spec *argoappv1.ApplicationSpec, ap
data, err = config.ReadRemoteFile(appOpts.values)
}
errors.CheckError(err)
setHelmOpt(&spec.Source, helmOpts{values: string(data)})
setHelmOpt(source, helmOpts{values: string(data)})
case "release-name":
setHelmOpt(&spec.Source, helmOpts{releaseName: appOpts.releaseName})
setHelmOpt(source, helmOpts{releaseName: appOpts.releaseName})
case "helm-version":
setHelmOpt(&spec.Source, helmOpts{version: appOpts.helmVersion})
setHelmOpt(source, helmOpts{version: appOpts.helmVersion})
case "helm-pass-credentials":
setHelmOpt(&spec.Source, helmOpts{passCredentials: appOpts.helmPassCredentials})
setHelmOpt(source, helmOpts{passCredentials: appOpts.helmPassCredentials})
case "helm-set":
setHelmOpt(&spec.Source, helmOpts{helmSets: appOpts.helmSets})
setHelmOpt(source, helmOpts{helmSets: appOpts.helmSets})
case "helm-set-string":
setHelmOpt(&spec.Source, helmOpts{helmSetStrings: appOpts.helmSetStrings})
setHelmOpt(source, helmOpts{helmSetStrings: appOpts.helmSetStrings})
case "helm-set-file":
setHelmOpt(&spec.Source, helmOpts{helmSetFiles: appOpts.helmSetFiles})
setHelmOpt(source, helmOpts{helmSetFiles: appOpts.helmSetFiles})
case "helm-skip-crds":
setHelmOpt(&spec.Source, helmOpts{skipCrds: appOpts.helmSkipCrds})
setHelmOpt(source, helmOpts{skipCrds: appOpts.helmSkipCrds})
case "directory-recurse":
if spec.Source.Directory != nil {
spec.Source.Directory.Recurse = appOpts.directoryRecurse
if source.Directory != nil {
source.Directory.Recurse = appOpts.directoryRecurse
} else {
spec.Source.Directory = &argoappv1.ApplicationSourceDirectory{Recurse: appOpts.directoryRecurse}
source.Directory = &argoappv1.ApplicationSourceDirectory{Recurse: appOpts.directoryRecurse}
}
case "directory-exclude":
if spec.Source.Directory != nil {
spec.Source.Directory.Exclude = appOpts.directoryExclude
if source.Directory != nil {
source.Directory.Exclude = appOpts.directoryExclude
} else {
spec.Source.Directory = &argoappv1.ApplicationSourceDirectory{Exclude: appOpts.directoryExclude}
source.Directory = &argoappv1.ApplicationSourceDirectory{Exclude: appOpts.directoryExclude}
}
case "directory-include":
if spec.Source.Directory != nil {
spec.Source.Directory.Include = appOpts.directoryInclude
if source.Directory != nil {
source.Directory.Include = appOpts.directoryInclude
} else {
spec.Source.Directory = &argoappv1.ApplicationSourceDirectory{Include: appOpts.directoryInclude}
source.Directory = &argoappv1.ApplicationSourceDirectory{Include: appOpts.directoryInclude}
}
case "config-management-plugin":
spec.Source.Plugin = &argoappv1.ApplicationSourcePlugin{Name: appOpts.configManagementPlugin}
source.Plugin = &argoappv1.ApplicationSourcePlugin{Name: appOpts.configManagementPlugin}
case "dest-name":
spec.Destination.Name = appOpts.destName
case "dest-server":
@@ -209,37 +213,37 @@ func SetAppSpecOptions(flags *pflag.FlagSet, spec *argoappv1.ApplicationSpec, ap
case "project":
spec.Project = appOpts.project
case "nameprefix":
setKustomizeOpt(&spec.Source, kustomizeOpts{namePrefix: appOpts.namePrefix})
setKustomizeOpt(source, kustomizeOpts{namePrefix: appOpts.namePrefix})
case "namesuffix":
setKustomizeOpt(&spec.Source, kustomizeOpts{nameSuffix: appOpts.nameSuffix})
setKustomizeOpt(source, kustomizeOpts{nameSuffix: appOpts.nameSuffix})
case "kustomize-image":
setKustomizeOpt(&spec.Source, kustomizeOpts{images: appOpts.kustomizeImages})
setKustomizeOpt(source, kustomizeOpts{images: appOpts.kustomizeImages})
case "kustomize-version":
setKustomizeOpt(&spec.Source, kustomizeOpts{version: appOpts.kustomizeVersion})
setKustomizeOpt(source, kustomizeOpts{version: appOpts.kustomizeVersion})
case "kustomize-common-label":
parsedLabels, err := label.Parse(appOpts.kustomizeCommonLabels)
errors.CheckError(err)
setKustomizeOpt(&spec.Source, kustomizeOpts{commonLabels: parsedLabels})
setKustomizeOpt(source, kustomizeOpts{commonLabels: parsedLabels})
case "kustomize-common-annotation":
parsedAnnotations, err := label.Parse(appOpts.kustomizeCommonAnnotations)
errors.CheckError(err)
setKustomizeOpt(&spec.Source, kustomizeOpts{commonAnnotations: parsedAnnotations})
setKustomizeOpt(source, kustomizeOpts{commonAnnotations: parsedAnnotations})
case "kustomize-force-common-label":
setKustomizeOpt(&spec.Source, kustomizeOpts{forceCommonLabels: appOpts.kustomizeForceCommonLabels})
setKustomizeOpt(source, kustomizeOpts{forceCommonLabels: appOpts.kustomizeForceCommonLabels})
case "kustomize-force-common-annotation":
setKustomizeOpt(&spec.Source, kustomizeOpts{forceCommonAnnotations: appOpts.kustomizeForceCommonAnnotations})
setKustomizeOpt(source, kustomizeOpts{forceCommonAnnotations: appOpts.kustomizeForceCommonAnnotations})
case "jsonnet-tla-str":
setJsonnetOpt(&spec.Source, appOpts.jsonnetTlaStr, false)
setJsonnetOpt(source, appOpts.jsonnetTlaStr, false)
case "jsonnet-tla-code":
setJsonnetOpt(&spec.Source, appOpts.jsonnetTlaCode, true)
setJsonnetOpt(source, appOpts.jsonnetTlaCode, true)
case "jsonnet-ext-var-str":
setJsonnetOptExtVar(&spec.Source, appOpts.jsonnetExtVarStr, false)
setJsonnetOptExtVar(source, appOpts.jsonnetExtVarStr, false)
case "jsonnet-ext-var-code":
setJsonnetOptExtVar(&spec.Source, appOpts.jsonnetExtVarCode, true)
setJsonnetOptExtVar(source, appOpts.jsonnetExtVarCode, true)
case "jsonnet-libs":
setJsonnetOptLibs(&spec.Source, appOpts.jsonnetLibs)
setJsonnetOptLibs(source, appOpts.jsonnetLibs)
case "plugin-env":
setPluginOptEnvs(&spec.Source, appOpts.pluginEnvs)
setPluginOptEnvs(source, appOpts.pluginEnvs)
case "sync-policy":
switch appOpts.syncPolicy {
case "none":
@@ -296,6 +300,7 @@ func SetAppSpecOptions(flags *pflag.FlagSet, spec *argoappv1.ApplicationSpec, ap
log.Fatalf("Invalid sync-retry-limit [%d]", appOpts.retryLimit)
}
}
spec.Source = source
})
if flags.Changed("auto-prune") {
if spec.SyncPolicy == nil || spec.SyncPolicy.Automated == nil {
@@ -473,8 +478,9 @@ func SetParameterOverrides(app *argoappv1.Application, parameters []string) {
if len(parameters) == 0 {
return
}
source := app.Spec.GetSource()
var sourceType argoappv1.ApplicationSourceType
if st, _ := app.Spec.Source.ExplicitType(); st != nil {
if st, _ := source.ExplicitType(); st != nil {
sourceType = *st
} else if app.Status.SourceType != "" {
sourceType = app.Status.SourceType
@@ -486,8 +492,8 @@ func SetParameterOverrides(app *argoappv1.Application, parameters []string) {
switch sourceType {
case argoappv1.ApplicationSourceTypeHelm:
if app.Spec.Source.Helm == nil {
app.Spec.Source.Helm = &argoappv1.ApplicationSourceHelm{}
if source.Helm == nil {
source.Helm = &argoappv1.ApplicationSourceHelm{}
}
for _, p := range parameters {
newParam, err := argoappv1.NewHelmParameter(p, false)
@@ -495,7 +501,7 @@ func SetParameterOverrides(app *argoappv1.Application, parameters []string) {
log.Error(err)
continue
}
app.Spec.Source.Helm.AddParameter(*newParam)
source.Helm.AddParameter(*newParam)
}
default:
log.Fatalf("Parameters can only be set against Helm applications")
@@ -580,6 +586,9 @@ func constructAppsBaseOnName(appName string, labels, annotations, args []string,
Name: appName,
Namespace: appNs,
},
Spec: argoappv1.ApplicationSpec{
Source: &argoappv1.ApplicationSource{},
},
}
SetAppSpecOptions(flags, &app.Spec, &appOpts)
SetParameterOverrides(app, appOpts.Parameters)

View File

@@ -149,7 +149,9 @@ func (f *appOptionsFixture) SetFlag(key, value string) error {
func newAppOptionsFixture() *appOptionsFixture {
fixture := &appOptionsFixture{
spec: &v1alpha1.ApplicationSpec{},
spec: &v1alpha1.ApplicationSpec{
Source: &v1alpha1.ApplicationSource{},
},
command: &cobra.Command{},
options: &AppOptions{},
}

View File

@@ -61,6 +61,6 @@ func readAppset(yml []byte, appsets *[]*argoprojiov1alpha1.ApplicationSet) error
*appsets = append(*appsets, &appset)
}
return fmt.Errorf("error reading app set: %w", err)
// we reach here if there is no error found while reading the Application Set
return nil
}

View File

@@ -22,6 +22,8 @@ type RepoOptions struct {
GithubAppPrivateKeyPath string
GitHubAppEnterpriseBaseURL string
Proxy string
GCPServiceAccountKeyPath string
ForceHttpBasicAuth bool
}
func AddRepoFlags(command *cobra.Command, opts *RepoOptions) {
@@ -42,4 +44,6 @@ func AddRepoFlags(command *cobra.Command, opts *RepoOptions) {
command.Flags().StringVar(&opts.GithubAppPrivateKeyPath, "github-app-private-key-path", "", "private key of the GitHub Application")
command.Flags().StringVar(&opts.GitHubAppEnterpriseBaseURL, "github-app-enterprise-base-url", "", "base url to use when using GitHub Enterprise (e.g. https://ghe.example.com/api/v3")
command.Flags().StringVar(&opts.Proxy, "proxy", "", "use proxy to access repository")
command.Flags().StringVar(&opts.GCPServiceAccountKeyPath, "gcp-service-account-key-path", "", "service account key for the Google Cloud Platform")
command.Flags().BoolVar(&opts.ForceHttpBasicAuth, "force-http-basic-auth", false, "whether to force use of basic auth when connecting repository via HTTP")
}

View File

@@ -6,6 +6,7 @@ package apiclient
import (
context "context"
fmt "fmt"
apiclient "github.com/argoproj/argo-cd/v2/reposerver/apiclient"
proto "github.com/gogo/protobuf/proto"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
@@ -317,6 +318,7 @@ func (m *ManifestResponse) GetSourceType() string {
type RepositoryResponse struct {
IsSupported bool `protobuf:"varint,1,opt,name=isSupported,proto3" json:"isSupported,omitempty"`
IsDiscoveryEnabled bool `protobuf:"varint,2,opt,name=isDiscoveryEnabled,proto3" json:"isDiscoveryEnabled,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
@@ -362,6 +364,62 @@ func (m *RepositoryResponse) GetIsSupported() bool {
return false
}
func (m *RepositoryResponse) GetIsDiscoveryEnabled() bool {
if m != nil {
return m.IsDiscoveryEnabled
}
return false
}
// ParametersAnnouncementResponse contains a list of announcements. This list represents all the parameters which a CMP
// is able to accept.
type ParametersAnnouncementResponse struct {
ParameterAnnouncements []*apiclient.ParameterAnnouncement `protobuf:"bytes,1,rep,name=parameterAnnouncements,proto3" json:"parameterAnnouncements,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ParametersAnnouncementResponse) Reset() { *m = ParametersAnnouncementResponse{} }
func (m *ParametersAnnouncementResponse) String() string { return proto.CompactTextString(m) }
func (*ParametersAnnouncementResponse) ProtoMessage() {}
func (*ParametersAnnouncementResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_b21875a7079a06ed, []int{5}
}
func (m *ParametersAnnouncementResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *ParametersAnnouncementResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_ParametersAnnouncementResponse.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *ParametersAnnouncementResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_ParametersAnnouncementResponse.Merge(m, src)
}
func (m *ParametersAnnouncementResponse) XXX_Size() int {
return m.Size()
}
func (m *ParametersAnnouncementResponse) XXX_DiscardUnknown() {
xxx_messageInfo_ParametersAnnouncementResponse.DiscardUnknown(m)
}
var xxx_messageInfo_ParametersAnnouncementResponse proto.InternalMessageInfo
func (m *ParametersAnnouncementResponse) GetParameterAnnouncements() []*apiclient.ParameterAnnouncement {
if m != nil {
return m.ParameterAnnouncements
}
return nil
}
type File struct {
Chunk []byte `protobuf:"bytes,1,opt,name=chunk,proto3" json:"chunk,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
@@ -373,7 +431,7 @@ func (m *File) Reset() { *m = File{} }
func (m *File) String() string { return proto.CompactTextString(m) }
func (*File) ProtoMessage() {}
func (*File) Descriptor() ([]byte, []int) {
return fileDescriptor_b21875a7079a06ed, []int{5}
return fileDescriptor_b21875a7079a06ed, []int{6}
}
func (m *File) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -415,44 +473,50 @@ func init() {
proto.RegisterType((*EnvEntry)(nil), "plugin.EnvEntry")
proto.RegisterType((*ManifestResponse)(nil), "plugin.ManifestResponse")
proto.RegisterType((*RepositoryResponse)(nil), "plugin.RepositoryResponse")
proto.RegisterType((*ParametersAnnouncementResponse)(nil), "plugin.ParametersAnnouncementResponse")
proto.RegisterType((*File)(nil), "plugin.File")
}
func init() { proto.RegisterFile("cmpserver/plugin/plugin.proto", fileDescriptor_b21875a7079a06ed) }
var fileDescriptor_b21875a7079a06ed = []byte{
// 483 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x53, 0xd1, 0x8e, 0x12, 0x3d,
0x14, 0xa6, 0x3f, 0xec, 0x2e, 0x1c, 0x36, 0xf9, 0x49, 0x63, 0xe2, 0x84, 0xec, 0x22, 0x99, 0x2b,
0x6e, 0x84, 0x04, 0x8d, 0x77, 0x26, 0xba, 0x66, 0x75, 0xa3, 0xc1, 0x90, 0xe2, 0x95, 0x77, 0xdd,
0x72, 0x80, 0xba, 0x33, 0x6d, 0x6d, 0x3b, 0x93, 0xe0, 0x95, 0x6f, 0xe3, 0x2b, 0xf8, 0x08, 0x5e,
0xfa, 0x08, 0x86, 0x27, 0x31, 0x53, 0x66, 0x18, 0xe2, 0x46, 0xaf, 0x38, 0xdf, 0x77, 0xce, 0xf9,
0xf8, 0xbe, 0x4e, 0x0b, 0x97, 0x22, 0x35, 0x0e, 0x6d, 0x8e, 0x76, 0x62, 0x92, 0x6c, 0x2d, 0x55,
0xf9, 0x33, 0x36, 0x56, 0x7b, 0x4d, 0x4f, 0xf7, 0x28, 0xfe, 0x4a, 0xa0, 0xf7, 0xd2, 0x98, 0x85,
0xb7, 0xc8, 0x53, 0x86, 0x9f, 0x33, 0x74, 0x9e, 0x3e, 0x87, 0x76, 0x8a, 0x9e, 0x2f, 0xb9, 0xe7,
0x11, 0x19, 0x92, 0x51, 0x77, 0xfa, 0x68, 0x5c, 0x6e, 0xcf, 0xb8, 0x92, 0x2b, 0x74, 0xbe, 0x1c,
0x9d, 0x95, 0x63, 0x37, 0x0d, 0x76, 0x58, 0xa1, 0x31, 0xb4, 0x56, 0x32, 0xc1, 0xe8, 0xbf, 0xb0,
0x7a, 0x5e, 0xad, 0xbe, 0x96, 0x09, 0xde, 0x34, 0x58, 0xe8, 0x5d, 0x75, 0xe0, 0xcc, 0xee, 0x25,
0xe2, 0x6f, 0x04, 0x1e, 0xfe, 0x45, 0x96, 0x46, 0x70, 0xc6, 0x8d, 0x79, 0xcf, 0x53, 0x0c, 0x46,
0x3a, 0xac, 0x82, 0x74, 0x00, 0xc0, 0x8d, 0x61, 0x98, 0xcc, 0xb9, 0xdf, 0x84, 0xbf, 0xea, 0xb0,
0x23, 0x86, 0xf6, 0xa1, 0x2d, 0x36, 0x28, 0xee, 0x5c, 0x96, 0x46, 0xcd, 0xd0, 0x3d, 0x60, 0x4a,
0xa1, 0xe5, 0xe4, 0x17, 0x8c, 0x5a, 0x43, 0x32, 0x6a, 0xb2, 0x50, 0xd3, 0x18, 0x9a, 0xa8, 0xf2,
0xe8, 0x64, 0xd8, 0x1c, 0x75, 0xa7, 0xbd, 0xca, 0xf3, 0xb5, 0xca, 0xaf, 0x95, 0xb7, 0x5b, 0x56,
0x34, 0xe3, 0xa7, 0xd0, 0xae, 0x88, 0x42, 0x43, 0xd5, 0xb6, 0x42, 0x4d, 0x1f, 0xc0, 0x49, 0xce,
0x93, 0x0c, 0x4b, 0x3b, 0x7b, 0x10, 0xcf, 0xa1, 0x57, 0xc7, 0x73, 0x46, 0x2b, 0x87, 0xf4, 0x02,
0x3a, 0x69, 0xc9, 0xb9, 0x88, 0x0c, 0x9b, 0xa3, 0x0e, 0xab, 0x89, 0x22, 0x9b, 0xd3, 0x99, 0x15,
0xf8, 0x61, 0x6b, 0x2a, 0xb1, 0x23, 0x26, 0x7e, 0x06, 0x94, 0xa1, 0xd1, 0x4e, 0x7a, 0x6d, 0xb7,
0x07, 0xcd, 0x21, 0x74, 0xa5, 0x5b, 0x64, 0xc6, 0x68, 0xeb, 0x71, 0x19, 0x8c, 0xb5, 0xd9, 0x31,
0x15, 0x5f, 0x40, 0xab, 0xf8, 0x08, 0x85, 0x4f, 0xb1, 0xc9, 0xd4, 0x5d, 0x98, 0x39, 0x67, 0x7b,
0x30, 0xfd, 0x4e, 0xe0, 0xf2, 0x95, 0x56, 0x2b, 0xb9, 0x9e, 0x71, 0xc5, 0xd7, 0x98, 0xa2, 0xf2,
0xf3, 0x70, 0x0c, 0x0b, 0xb4, 0xb9, 0x14, 0x48, 0xdf, 0x42, 0xef, 0x0d, 0x2a, 0xb4, 0xdc, 0x63,
0x95, 0x88, 0x46, 0xd5, 0x51, 0xfd, 0x79, 0x8b, 0xfa, 0xd1, 0xfd, 0x3b, 0xb3, 0x77, 0x1a, 0x37,
0x46, 0x84, 0xbe, 0x83, 0xff, 0x67, 0xdc, 0x8b, 0x4d, 0x1d, 0xe4, 0x1f, 0x52, 0xfd, 0xaa, 0x73,
0x3f, 0x76, 0x21, 0x76, 0xf5, 0xe2, 0xc7, 0x6e, 0x40, 0x7e, 0xee, 0x06, 0xe4, 0xd7, 0x6e, 0x40,
0x3e, 0x4e, 0xd7, 0xd2, 0x6f, 0xb2, 0xdb, 0xb1, 0xd0, 0xe9, 0x84, 0xdb, 0xb5, 0x36, 0x56, 0x7f,
0x0a, 0xc5, 0x63, 0xb1, 0x9c, 0xe4, 0xd3, 0x49, 0xfd, 0x32, 0xb8, 0x91, 0x22, 0x91, 0xa8, 0xfc,
0xed, 0x69, 0x78, 0x16, 0x4f, 0x7e, 0x07, 0x00, 0x00, 0xff, 0xff, 0x83, 0x01, 0x5e, 0x48, 0x37,
0x03, 0x00, 0x00,
// 576 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x94, 0xdd, 0x6e, 0x12, 0x4f,
0x14, 0xc0, 0xbb, 0x85, 0xb6, 0x70, 0x68, 0xf2, 0x27, 0x93, 0x7f, 0x74, 0x25, 0x2d, 0xe2, 0x5e,
0x18, 0x6e, 0x84, 0x04, 0xbd, 0x35, 0xb1, 0x55, 0x6c, 0xa3, 0xc1, 0x90, 0xa9, 0x37, 0x7a, 0x37,
0x1d, 0x0e, 0x30, 0x76, 0x77, 0x66, 0x9c, 0x99, 0xdd, 0x04, 0xbd, 0xf1, 0x3d, 0x7c, 0x00, 0x5f,
0xc5, 0x4b, 0x1f, 0xc1, 0xf4, 0x49, 0x0c, 0xb3, 0xbb, 0x40, 0x6c, 0x8b, 0x57, 0x7b, 0x3e, 0x7f,
0x7b, 0xbe, 0x32, 0x70, 0xcc, 0x13, 0x6d, 0xd1, 0x64, 0x68, 0xfa, 0x3a, 0x4e, 0x67, 0x42, 0x16,
0x9f, 0x9e, 0x36, 0xca, 0x29, 0xb2, 0x9f, 0x6b, 0xad, 0xe1, 0x4c, 0xb8, 0x79, 0x7a, 0xd9, 0xe3,
0x2a, 0xe9, 0x33, 0x33, 0x53, 0xda, 0xa8, 0x4f, 0x5e, 0x78, 0xc2, 0x27, 0xfd, 0x6c, 0xd0, 0x37,
0xa8, 0x55, 0x81, 0xf1, 0xa2, 0x70, 0xca, 0x2c, 0x36, 0xc4, 0x1c, 0x17, 0x7d, 0x0b, 0xa0, 0x79,
0xa2, 0xf5, 0x85, 0x33, 0xc8, 0x12, 0x8a, 0x9f, 0x53, 0xb4, 0x8e, 0x3c, 0x87, 0x5a, 0x82, 0x8e,
0x4d, 0x98, 0x63, 0x61, 0xd0, 0x09, 0xba, 0x8d, 0xc1, 0xc3, 0x5e, 0x51, 0xc4, 0x88, 0x49, 0x31,
0x45, 0xeb, 0x8a, 0xd0, 0x51, 0x11, 0x76, 0xbe, 0x43, 0x57, 0x29, 0x24, 0x82, 0xea, 0x54, 0xc4,
0x18, 0xee, 0xfa, 0xd4, 0xc3, 0x32, 0xf5, 0xb5, 0x88, 0xf1, 0x7c, 0x87, 0x7a, 0xdf, 0x69, 0x1d,
0x0e, 0x4c, 0x8e, 0x88, 0x7e, 0x04, 0x70, 0xff, 0x0e, 0x2c, 0x09, 0xe1, 0x80, 0x69, 0xfd, 0x8e,
0x25, 0xe8, 0x0b, 0xa9, 0xd3, 0x52, 0x25, 0x6d, 0x00, 0xa6, 0x35, 0xc5, 0x78, 0xcc, 0xdc, 0xdc,
0xff, 0xaa, 0x4e, 0x37, 0x2c, 0xa4, 0x05, 0x35, 0x3e, 0x47, 0x7e, 0x65, 0xd3, 0x24, 0xac, 0x78,
0xef, 0x4a, 0x27, 0x04, 0xaa, 0x56, 0x7c, 0xc1, 0xb0, 0xda, 0x09, 0xba, 0x15, 0xea, 0x65, 0x12,
0x41, 0x05, 0x65, 0x16, 0xee, 0x75, 0x2a, 0xdd, 0xc6, 0xa0, 0x59, 0xd6, 0x3c, 0x94, 0xd9, 0x50,
0x3a, 0xb3, 0xa0, 0x4b, 0x67, 0xf4, 0x0c, 0x6a, 0xa5, 0x61, 0xc9, 0x90, 0xeb, 0xb2, 0xbc, 0x4c,
0xfe, 0x87, 0xbd, 0x8c, 0xc5, 0x29, 0x16, 0xe5, 0xe4, 0x4a, 0x34, 0x86, 0xe6, 0xba, 0x3d, 0xab,
0x95, 0xb4, 0x48, 0x8e, 0xa0, 0x9e, 0x14, 0x36, 0x1b, 0x06, 0x9d, 0x4a, 0xb7, 0x4e, 0xd7, 0x86,
0x65, 0x6f, 0x56, 0xa5, 0x86, 0xe3, 0xfb, 0x85, 0x2e, 0x61, 0x1b, 0x96, 0x68, 0x0a, 0x84, 0xae,
0x16, 0xb9, 0x62, 0x76, 0xa0, 0x21, 0xec, 0x45, 0xaa, 0xb5, 0x32, 0x0e, 0x27, 0xbe, 0xb0, 0x1a,
0xdd, 0x34, 0x91, 0x1e, 0x10, 0x61, 0x5f, 0x09, 0xcb, 0x55, 0x86, 0x66, 0x31, 0x94, 0xec, 0x32,
0xc6, 0x89, 0xe7, 0xd7, 0xe8, 0x2d, 0x9e, 0xe8, 0x2b, 0xb4, 0xc7, 0xcc, 0xb0, 0x04, 0x1d, 0x1a,
0x7b, 0x22, 0xa5, 0x4a, 0x25, 0xc7, 0x04, 0xe5, 0xba, 0x8f, 0x0f, 0x70, 0x4f, 0x97, 0x11, 0x9b,
0x01, 0x79, 0x53, 0x8d, 0xc1, 0xa3, 0xde, 0xc6, 0xc5, 0x8d, 0x6f, 0x8b, 0xa4, 0x77, 0x00, 0xa2,
0x23, 0xa8, 0x2e, 0x2f, 0x66, 0x39, 0x54, 0x3e, 0x4f, 0xe5, 0x95, 0x6f, 0xe8, 0x90, 0xe6, 0xca,
0xe0, 0xfb, 0x2e, 0x1c, 0xbf, 0x54, 0x72, 0x2a, 0x66, 0x23, 0x26, 0xd9, 0xcc, 0xe7, 0x8c, 0xfd,
0xce, 0x2e, 0xd0, 0x64, 0x82, 0x23, 0x79, 0x03, 0xcd, 0x33, 0x94, 0x68, 0x98, 0xc3, 0x72, 0xfc,
0x24, 0x2c, 0xf7, 0xfa, 0xf7, 0xc9, 0xb7, 0xc2, 0x9b, 0x07, 0x9e, 0xb7, 0x18, 0xed, 0x74, 0x03,
0xf2, 0x16, 0xfe, 0x1b, 0x31, 0xc7, 0xe7, 0xeb, 0xa9, 0x6f, 0x41, 0xb5, 0x4a, 0xcf, 0xcd, 0x1d,
0x79, 0x18, 0x83, 0x07, 0x67, 0xe8, 0x6e, 0x1f, 0xec, 0x16, 0xec, 0xe3, 0xd2, 0xb3, 0x7d, 0x25,
0xcb, 0x5f, 0x9c, 0xbe, 0xf8, 0x79, 0xdd, 0x0e, 0x7e, 0x5d, 0xb7, 0x83, 0xdf, 0xd7, 0xed, 0xe0,
0xe3, 0xe0, 0x1f, 0x4f, 0xc5, 0xfa, 0xc1, 0x61, 0x5a, 0xf0, 0x58, 0xa0, 0x74, 0x97, 0xfb, 0xfe,
0x79, 0x78, 0xfa, 0x27, 0x00, 0x00, 0xff, 0xff, 0x23, 0x88, 0x8e, 0xd3, 0x8e, 0x04, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
@@ -472,6 +536,8 @@ type ConfigManagementPluginServiceClient interface {
GenerateManifest(ctx context.Context, opts ...grpc.CallOption) (ConfigManagementPluginService_GenerateManifestClient, error)
// MatchRepository returns whether or not the given application is supported by the plugin
MatchRepository(ctx context.Context, opts ...grpc.CallOption) (ConfigManagementPluginService_MatchRepositoryClient, error)
// GetParametersAnnouncement gets a list of parameter announcements for the given app
GetParametersAnnouncement(ctx context.Context, opts ...grpc.CallOption) (ConfigManagementPluginService_GetParametersAnnouncementClient, error)
}
type configManagementPluginServiceClient struct {
@@ -550,6 +616,40 @@ func (x *configManagementPluginServiceMatchRepositoryClient) CloseAndRecv() (*Re
return m, nil
}
func (c *configManagementPluginServiceClient) GetParametersAnnouncement(ctx context.Context, opts ...grpc.CallOption) (ConfigManagementPluginService_GetParametersAnnouncementClient, error) {
stream, err := c.cc.NewStream(ctx, &_ConfigManagementPluginService_serviceDesc.Streams[2], "/plugin.ConfigManagementPluginService/GetParametersAnnouncement", opts...)
if err != nil {
return nil, err
}
x := &configManagementPluginServiceGetParametersAnnouncementClient{stream}
return x, nil
}
type ConfigManagementPluginService_GetParametersAnnouncementClient interface {
Send(*AppStreamRequest) error
CloseAndRecv() (*ParametersAnnouncementResponse, error)
grpc.ClientStream
}
type configManagementPluginServiceGetParametersAnnouncementClient struct {
grpc.ClientStream
}
func (x *configManagementPluginServiceGetParametersAnnouncementClient) Send(m *AppStreamRequest) error {
return x.ClientStream.SendMsg(m)
}
func (x *configManagementPluginServiceGetParametersAnnouncementClient) CloseAndRecv() (*ParametersAnnouncementResponse, error) {
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
m := new(ParametersAnnouncementResponse)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// ConfigManagementPluginServiceServer is the server API for ConfigManagementPluginService service.
type ConfigManagementPluginServiceServer interface {
// GenerateManifests receive a stream containing a tgz archive with all required files necessary
@@ -557,6 +657,8 @@ type ConfigManagementPluginServiceServer interface {
GenerateManifest(ConfigManagementPluginService_GenerateManifestServer) error
// MatchRepository returns whether or not the given application is supported by the plugin
MatchRepository(ConfigManagementPluginService_MatchRepositoryServer) error
// GetParametersAnnouncement gets a list of parameter announcements for the given app
GetParametersAnnouncement(ConfigManagementPluginService_GetParametersAnnouncementServer) error
}
// UnimplementedConfigManagementPluginServiceServer can be embedded to have forward compatible implementations.
@@ -569,6 +671,9 @@ func (*UnimplementedConfigManagementPluginServiceServer) GenerateManifest(srv Co
func (*UnimplementedConfigManagementPluginServiceServer) MatchRepository(srv ConfigManagementPluginService_MatchRepositoryServer) error {
return status.Errorf(codes.Unimplemented, "method MatchRepository not implemented")
}
func (*UnimplementedConfigManagementPluginServiceServer) GetParametersAnnouncement(srv ConfigManagementPluginService_GetParametersAnnouncementServer) error {
return status.Errorf(codes.Unimplemented, "method GetParametersAnnouncement not implemented")
}
func RegisterConfigManagementPluginServiceServer(s *grpc.Server, srv ConfigManagementPluginServiceServer) {
s.RegisterService(&_ConfigManagementPluginService_serviceDesc, srv)
@@ -626,6 +731,32 @@ func (x *configManagementPluginServiceMatchRepositoryServer) Recv() (*AppStreamR
return m, nil
}
func _ConfigManagementPluginService_GetParametersAnnouncement_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(ConfigManagementPluginServiceServer).GetParametersAnnouncement(&configManagementPluginServiceGetParametersAnnouncementServer{stream})
}
type ConfigManagementPluginService_GetParametersAnnouncementServer interface {
SendAndClose(*ParametersAnnouncementResponse) error
Recv() (*AppStreamRequest, error)
grpc.ServerStream
}
type configManagementPluginServiceGetParametersAnnouncementServer struct {
grpc.ServerStream
}
func (x *configManagementPluginServiceGetParametersAnnouncementServer) SendAndClose(m *ParametersAnnouncementResponse) error {
return x.ServerStream.SendMsg(m)
}
func (x *configManagementPluginServiceGetParametersAnnouncementServer) Recv() (*AppStreamRequest, error) {
m := new(AppStreamRequest)
if err := x.ServerStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
var _ConfigManagementPluginService_serviceDesc = grpc.ServiceDesc{
ServiceName: "plugin.ConfigManagementPluginService",
HandlerType: (*ConfigManagementPluginServiceServer)(nil),
@@ -641,6 +772,11 @@ var _ConfigManagementPluginService_serviceDesc = grpc.ServiceDesc{
Handler: _ConfigManagementPluginService_MatchRepository_Handler,
ClientStreams: true,
},
{
StreamName: "GetParametersAnnouncement",
Handler: _ConfigManagementPluginService_GetParametersAnnouncement_Handler,
ClientStreams: true,
},
},
Metadata: "cmpserver/plugin/plugin.proto",
}
@@ -898,6 +1034,16 @@ func (m *RepositoryResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
}
if m.IsDiscoveryEnabled {
i--
if m.IsDiscoveryEnabled {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i--
dAtA[i] = 0x10
}
if m.IsSupported {
i--
if m.IsSupported {
@@ -911,6 +1057,47 @@ func (m *RepositoryResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
return len(dAtA) - i, nil
}
func (m *ParametersAnnouncementResponse) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *ParametersAnnouncementResponse) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *ParametersAnnouncementResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if m.XXX_unrecognized != nil {
i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
}
if len(m.ParameterAnnouncements) > 0 {
for iNdEx := len(m.ParameterAnnouncements) - 1; iNdEx >= 0; iNdEx-- {
{
size, err := m.ParameterAnnouncements[iNdEx].MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintPlugin(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0xa
}
}
return len(dAtA) - i, nil
}
func (m *File) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
@@ -1079,6 +1266,27 @@ func (m *RepositoryResponse) Size() (n int) {
if m.IsSupported {
n += 2
}
if m.IsDiscoveryEnabled {
n += 2
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *ParametersAnnouncementResponse) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if len(m.ParameterAnnouncements) > 0 {
for _, e := range m.ParameterAnnouncements {
l = e.Size()
n += 1 + l + sovPlugin(uint64(l))
}
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
@@ -1707,6 +1915,111 @@ func (m *RepositoryResponse) Unmarshal(dAtA []byte) error {
}
}
m.IsSupported = bool(v != 0)
case 2:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field IsDiscoveryEnabled", wireType)
}
var v int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowPlugin
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
v |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
m.IsDiscoveryEnabled = bool(v != 0)
default:
iNdEx = preIndex
skippy, err := skipPlugin(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthPlugin
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *ParametersAnnouncementResponse) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowPlugin
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: ParametersAnnouncementResponse: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: ParametersAnnouncementResponse: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field ParameterAnnouncements", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowPlugin
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthPlugin
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthPlugin
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.ParameterAnnouncements = append(m.ParameterAnnouncements, &apiclient.ParameterAnnouncement{})
if err := m.ParameterAnnouncements[len(m.ParameterAnnouncements)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipPlugin(dAtA[iNdEx:])

View File

@@ -7,6 +7,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/argoproj/argo-cd/v2/common"
"github.com/argoproj/argo-cd/v2/reposerver/apiclient"
configUtil "github.com/argoproj/argo-cd/v2/util/config"
)
@@ -21,10 +22,11 @@ type PluginConfig struct {
}
type PluginConfigSpec struct {
Version string `json:"version"`
Init Command `json:"init,omitempty"`
Generate Command `json:"generate"`
Discover Discover `json:"discover"`
Version string `json:"version"`
Init Command `json:"init,omitempty"`
Generate Command `json:"generate"`
Discover Discover `json:"discover"`
Parameters Parameters `yaml:"parameters"`
}
//Discover holds find and fileName
@@ -45,6 +47,17 @@ type Find struct {
Glob string `json:"glob"`
}
// Parameters holds static and dynamic configurations
type Parameters struct {
Static []*apiclient.ParameterAnnouncement `yaml:"static"`
Dynamic Command `yaml:"dynamic"`
}
// Dynamic hold the dynamic announcements for CMP's
type Dynamic struct {
Command
}
func ReadPluginConfig(filePath string) (*PluginConfig, error) {
path := fmt.Sprintf("%s/%s", strings.TrimRight(filePath, "/"), common.PluginConfigFileName)
@@ -71,9 +84,7 @@ func ValidatePluginConfig(config PluginConfig) error {
if len(config.Spec.Generate.Command) == 0 {
return fmt.Errorf("invalid plugin configuration file. spec.generate command should be non-empty")
}
if config.Spec.Discover.Find.Glob == "" && len(config.Spec.Discover.Find.Command.Command) == 0 && config.Spec.Discover.FileName == "" {
return fmt.Errorf("invalid plugin configuration file. atleast one of discover.find.command or discover.find.glob or discover.fineName should be non-empty")
}
// discovery field is optional as apps can now specify plugin names directly
return nil
}

View File

@@ -3,6 +3,7 @@ package plugin
import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"os"
@@ -13,7 +14,9 @@ import (
"github.com/argoproj/pkg/rand"
"github.com/argoproj/argo-cd/v2/cmpserver/apiclient"
"github.com/argoproj/argo-cd/v2/common"
repoclient "github.com/argoproj/argo-cd/v2/reposerver/apiclient"
"github.com/argoproj/argo-cd/v2/util/buffered_context"
"github.com/argoproj/argo-cd/v2/util/cmp"
"github.com/argoproj/argo-cd/v2/util/io/files"
@@ -21,8 +24,6 @@ import (
"github.com/argoproj/gitops-engine/pkg/utils/kube"
"github.com/mattn/go-zglob"
log "github.com/sirupsen/logrus"
"github.com/argoproj/argo-cd/v2/cmpserver/apiclient"
)
// cmpTimeoutBuffer is the amount of time before the request deadline to timeout server-side work. It makes sure there's
@@ -45,15 +46,14 @@ func NewService(initConstants CMPServerInitConstants) *Service {
}
}
func (s *Service) Init() error {
workDir := common.GetCMPWorkDir()
func (s *Service) Init(workDir string) error {
err := os.RemoveAll(workDir)
if err != nil {
return fmt.Errorf("error removing workdir %q: %s", workDir, err)
return fmt.Errorf("error removing workdir %q: %w", workDir, err)
}
err = os.MkdirAll(workDir, 0700)
if err != nil {
return fmt.Errorf("error creating workdir %q: %s", workDir, err)
return fmt.Errorf("error creating workdir %q: %w", workDir, err)
}
return nil
}
@@ -143,24 +143,50 @@ func environ(envVars []*apiclient.EnvEntry) []string {
return environ
}
// getTempDirMustCleanup creates a temporary directory and returns a cleanup function.
func getTempDirMustCleanup(baseDir string) (workDir string, cleanup func(), err error) {
workDir, err = files.CreateTempDir(baseDir)
if err != nil {
return "", nil, fmt.Errorf("error creating temp dir: %w", err)
}
cleanup = func() {
if err := os.RemoveAll(workDir); err != nil {
log.WithFields(map[string]interface{}{
common.SecurityField: common.SecurityHigh,
common.SecurityCWEField: 459,
}).Errorf("Failed to clean up temp directory: %s", err)
}
}
return workDir, cleanup, nil
}
type Stream interface {
Recv() (*apiclient.AppStreamRequest, error)
Context() context.Context
}
type GenerateManifestStream interface {
Stream
SendAndClose(response *apiclient.ManifestResponse) error
}
// GenerateManifest runs generate command from plugin config file and returns generated manifest files
func (s *Service) GenerateManifest(stream apiclient.ConfigManagementPluginService_GenerateManifestServer) error {
return s.generateManifestGeneric(stream)
}
func (s *Service) generateManifestGeneric(stream GenerateManifestStream) error {
ctx, cancel := buffered_context.WithEarlierDeadline(stream.Context(), cmpTimeoutBuffer)
defer cancel()
workDir, err := files.CreateTempDir(common.GetCMPWorkDir())
workDir, cleanup, err := getTempDirMustCleanup(common.GetCMPWorkDir())
if err != nil {
return fmt.Errorf("error creating temp dir: %s", err)
return fmt.Errorf("error creating workdir for manifest generation: %w", err)
}
defer func() {
if err := os.RemoveAll(workDir); err != nil {
// we panic here as the workDir may contain sensitive information
panic(fmt.Sprintf("error removing generate manifest workdir: %s", err))
}
}()
defer cleanup()
metadata, err := cmp.ReceiveRepoStream(ctx, stream, workDir)
if err != nil {
return fmt.Errorf("generate manifest error receiving stream: %s", err)
return fmt.Errorf("generate manifest error receiving stream: %w", err)
}
appPath := filepath.Clean(filepath.Join(workDir, metadata.AppRelPath))
@@ -169,11 +195,11 @@ func (s *Service) GenerateManifest(stream apiclient.ConfigManagementPluginServic
}
response, err := s.generateManifest(ctx, appPath, metadata.GetEnv())
if err != nil {
return fmt.Errorf("error generating manifests: %s", err)
return fmt.Errorf("error generating manifests: %w", err)
}
err = stream.SendAndClose(response)
if err != nil {
return fmt.Errorf("error sending manifest response: %s", err)
return fmt.Errorf("error sending manifest response: %w", err)
}
return nil
}
@@ -203,6 +229,11 @@ func (s *Service) generateManifest(ctx context.Context, appDir string, envEntrie
manifests, err := kube.SplitYAMLToString([]byte(out))
if err != nil {
sanitizedManifests := manifests
if len(sanitizedManifests) > 1000 {
sanitizedManifests = manifests[:1000]
}
log.Debugf("Failed to split generated manifests. Beginning of generated manifests: %q", sanitizedManifests)
return &apiclient.ManifestResponse{}, err
}
@@ -211,58 +242,63 @@ func (s *Service) generateManifest(ctx context.Context, appDir string, envEntrie
}, err
}
type MatchRepositoryStream interface {
Stream
SendAndClose(response *apiclient.RepositoryResponse) error
}
// MatchRepository receives the application stream and checks whether
// its repository type is supported by the config management plugin
// server.
//The checks are implemented in the following order:
// 1. If spec.Discover.FileName is provided it finds for a name match in Applications files
// 2. If spec.Discover.Find.Glob is provided if finds for a glob match in Applications files
// 3. Otherwise it runs the spec.Discover.Find.Command
// The checks are implemented in the following order:
// 1. If spec.Discover.FileName is provided it finds for a name match in Applications files
// 2. If spec.Discover.Find.Glob is provided if finds for a glob match in Applications files
// 3. Otherwise it runs the spec.Discover.Find.Command
func (s *Service) MatchRepository(stream apiclient.ConfigManagementPluginService_MatchRepositoryServer) error {
return s.matchRepositoryGeneric(stream)
}
func (s *Service) matchRepositoryGeneric(stream MatchRepositoryStream) error {
bufferedCtx, cancel := buffered_context.WithEarlierDeadline(stream.Context(), cmpTimeoutBuffer)
defer cancel()
workDir, err := files.CreateTempDir(common.GetCMPWorkDir())
workDir, cleanup, err := getTempDirMustCleanup(common.GetCMPWorkDir())
if err != nil {
return fmt.Errorf("error creating match repository workdir: %s", err)
return fmt.Errorf("error creating workdir for repository matching: %w", err)
}
defer func() {
if err := os.RemoveAll(workDir); err != nil {
// we panic here as the workDir may contain sensitive information
panic(fmt.Sprintf("error removing match repository workdir: %s", err))
}
}()
defer cleanup()
metadata, err := cmp.ReceiveRepoStream(bufferedCtx, stream, workDir)
if err != nil {
return fmt.Errorf("match repository error receiving stream: %s", err)
return fmt.Errorf("match repository error receiving stream: %w", err)
}
isSupported, err := s.matchRepository(bufferedCtx, workDir, metadata.GetEnv())
isSupported, isDiscoveryEnabled, err := s.matchRepository(bufferedCtx, workDir, metadata.GetEnv())
if err != nil {
return fmt.Errorf("match repository error: %s", err)
return fmt.Errorf("match repository error: %w", err)
}
repoResponse := &apiclient.RepositoryResponse{IsSupported: isSupported}
repoResponse := &apiclient.RepositoryResponse{IsSupported: isSupported, IsDiscoveryEnabled: isDiscoveryEnabled}
err = stream.SendAndClose(repoResponse)
if err != nil {
return fmt.Errorf("error sending match repository response: %s", err)
return fmt.Errorf("error sending match repository response: %w", err)
}
return nil
}
func (s *Service) matchRepository(ctx context.Context, workdir string, envEntries []*apiclient.EnvEntry) (bool, error) {
func (s *Service) matchRepository(ctx context.Context, workdir string, envEntries []*apiclient.EnvEntry) (isSupported bool, isDiscoveryEnabled bool, err error) {
config := s.initConstants.PluginConfig
if config.Spec.Discover.FileName != "" {
log.Debugf("config.Spec.Discover.FileName is provided")
pattern := filepath.Join(workdir, config.Spec.Discover.FileName)
matches, err := filepath.Glob(pattern)
if err != nil {
e := fmt.Errorf("error finding filename match for pattern %q: %s", pattern, err)
e := fmt.Errorf("error finding filename match for pattern %q: %w", pattern, err)
log.Debug(e)
return false, e
return false, true, e
}
return len(matches) > 0, nil
return len(matches) > 0, true, nil
}
if config.Spec.Discover.Find.Glob != "" {
@@ -272,27 +308,86 @@ func (s *Service) matchRepository(ctx context.Context, workdir string, envEntrie
// https://github.com/golang/go/issues/11862
matches, err := zglob.Glob(pattern)
if err != nil {
e := fmt.Errorf("error finding glob match for pattern %q: %s", pattern, err)
e := fmt.Errorf("error finding glob match for pattern %q: %w", pattern, err)
log.Debug(e)
return false, e
return false, true, e
}
if len(matches) > 0 {
return true, nil
return len(matches) > 0, true, nil
}
if len(config.Spec.Discover.Find.Command.Command) > 0 {
log.Debugf("Going to try runCommand.")
env := append(os.Environ(), environ(envEntries)...)
find, err := runCommand(ctx, config.Spec.Discover.Find.Command, workdir, env)
if err != nil {
return false, true, fmt.Errorf("error running find command: %w", err)
}
return false, nil
return find != "", true, nil
}
log.Debugf("Going to try runCommand.")
env := append(os.Environ(), environ(envEntries)...)
find, err := runCommand(ctx, config.Spec.Discover.Find.Command, workdir, env)
if err != nil {
return false, fmt.Errorf("error running find command: %s", err)
}
if find != "" {
return true, nil
}
return false, nil
return false, false, nil
}
// ParametersAnnouncementStream defines an interface able to send/receive a stream of parameter announcements.
type ParametersAnnouncementStream interface {
Stream
SendAndClose(response *apiclient.ParametersAnnouncementResponse) error
}
// GetParametersAnnouncement gets parameter announcements for a given Application and repo contents.
func (s *Service) GetParametersAnnouncement(stream apiclient.ConfigManagementPluginService_GetParametersAnnouncementServer) error {
bufferedCtx, cancel := buffered_context.WithEarlierDeadline(stream.Context(), cmpTimeoutBuffer)
defer cancel()
workDir, cleanup, err := getTempDirMustCleanup(common.GetCMPWorkDir())
if err != nil {
return fmt.Errorf("error creating workdir for generating parameter announcements: %w", err)
}
defer cleanup()
metadata, err := cmp.ReceiveRepoStream(bufferedCtx, stream, workDir)
if err != nil {
return fmt.Errorf("parameters announcement error receiving stream: %w", err)
}
appPath := filepath.Clean(filepath.Join(workDir, metadata.AppRelPath))
if !strings.HasPrefix(appPath, workDir) {
return fmt.Errorf("illegal appPath: out of workDir bound")
}
repoResponse, err := getParametersAnnouncement(bufferedCtx, appPath, s.initConstants.PluginConfig.Spec.Parameters.Static, s.initConstants.PluginConfig.Spec.Parameters.Dynamic)
if err != nil {
return fmt.Errorf("get parameters announcement error: %w", err)
}
err = stream.SendAndClose(repoResponse)
if err != nil {
return fmt.Errorf("error sending parameters announcement response: %w", err)
}
return nil
}
func getParametersAnnouncement(ctx context.Context, appDir string, announcements []*repoclient.ParameterAnnouncement, command Command) (*apiclient.ParametersAnnouncementResponse, error) {
augmentedAnnouncements := announcements
if len(command.Command) > 0 {
stdout, err := runCommand(ctx, command, appDir, os.Environ())
if err != nil {
return nil, fmt.Errorf("error executing dynamic parameter output command: %w", err)
}
var dynamicParamAnnouncements []*repoclient.ParameterAnnouncement
err = json.Unmarshal([]byte(stdout), &dynamicParamAnnouncements)
if err != nil {
return nil, fmt.Errorf("error unmarshaling dynamic parameter output into ParametersAnnouncementResponse: %w", err)
}
// dynamic goes first, because static should take precedence by being later.
augmentedAnnouncements = append(dynamicParamAnnouncements, announcements...)
}
repoResponse := &apiclient.ParametersAnnouncementResponse{
ParameterAnnouncements: augmentedAnnouncements,
}
return repoResponse, nil
}

View File

@@ -3,6 +3,8 @@ option go_package = "github.com/argoproj/argo-cd/v2/cmpserver/apiclient";
package plugin;
import "github.com/argoproj/argo-cd/v2/reposerver/repository/repository.proto";
// AppStreamRequest is the request object used to send the application's
// files over a stream.
message AppStreamRequest {
@@ -42,6 +44,13 @@ message ManifestResponse {
message RepositoryResponse {
bool isSupported = 1;
bool isDiscoveryEnabled = 2;
}
// ParametersAnnouncementResponse contains a list of announcements. This list represents all the parameters which a CMP
// is able to accept.
message ParametersAnnouncementResponse {
repeated repository.ParameterAnnouncement parameterAnnouncements = 1;
}
message File {
@@ -58,4 +67,8 @@ service ConfigManagementPluginService {
// MatchRepository returns whether or not the given application is supported by the plugin
rpc MatchRepository(stream AppStreamRequest) returns (RepositoryResponse) {
}
// GetParametersAnnouncement gets a list of parameter announcements for the given app
rpc GetParametersAnnouncement(stream AppStreamRequest) returns (ParametersAnnouncementResponse) {
}
}

View File

@@ -1,17 +1,27 @@
package plugin
import (
"bytes"
"context"
"fmt"
"io"
"os"
"path"
"path/filepath"
"testing"
"time"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"google.golang.org/grpc/metadata"
"gopkg.in/yaml.v2"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/argoproj/argo-cd/v2/cmpserver/apiclient"
repoclient "github.com/argoproj/argo-cd/v2/reposerver/apiclient"
"github.com/argoproj/argo-cd/v2/test"
"github.com/argoproj/argo-cd/v2/util/cmp"
"github.com/argoproj/argo-cd/v2/util/tgzstream"
)
func newService(configFilePath string) (*Service, error) {
@@ -30,6 +40,11 @@ func newService(configFilePath string) (*Service, error) {
return service, nil
}
func (s *Service) WithGenerateCommand(command Command) *Service {
s.initConstants.PluginConfig.Spec.Generate = command
return s
}
type pluginOpt func(*CMPServerInitConstants)
func withDiscover(d Discover) pluginOpt {
@@ -84,11 +99,12 @@ func TestMatchRepository(t *testing.T) {
f := setup(t, withDiscover(d))
// when
match, err := f.service.matchRepository(context.Background(), f.path, f.env)
match, discovery, err := f.service.matchRepository(context.Background(), f.path, f.env)
// then
assert.NoError(t, err)
assert.True(t, match)
assert.True(t, discovery)
})
t.Run("will not match plugin by filename if file not found", func(t *testing.T) {
// given
@@ -98,11 +114,25 @@ func TestMatchRepository(t *testing.T) {
f := setup(t, withDiscover(d))
// when
match, err := f.service.matchRepository(context.Background(), f.path, f.env)
match, discovery, err := f.service.matchRepository(context.Background(), f.path, f.env)
// then
assert.NoError(t, err)
assert.False(t, match)
assert.True(t, discovery)
})
t.Run("will not match a pattern with a syntax error", func(t *testing.T) {
// given
d := Discover{
FileName: "[",
}
f := setup(t, withDiscover(d))
// when
_, _, err := f.service.matchRepository(context.Background(), f.path, f.env)
// then
assert.ErrorContains(t, err, "syntax error")
})
t.Run("will match plugin by glob", func(t *testing.T) {
// given
@@ -114,11 +144,12 @@ func TestMatchRepository(t *testing.T) {
f := setup(t, withDiscover(d))
// when
match, err := f.service.matchRepository(context.Background(), f.path, f.env)
match, discovery, err := f.service.matchRepository(context.Background(), f.path, f.env)
// then
assert.NoError(t, err)
assert.True(t, match)
assert.True(t, discovery)
})
t.Run("will not match plugin by glob if not found", func(t *testing.T) {
// given
@@ -130,11 +161,27 @@ func TestMatchRepository(t *testing.T) {
f := setup(t, withDiscover(d))
// when
match, err := f.service.matchRepository(context.Background(), f.path, f.env)
match, discovery, err := f.service.matchRepository(context.Background(), f.path, f.env)
// then
assert.NoError(t, err)
assert.False(t, match)
assert.True(t, discovery)
})
t.Run("will throw an error for a bad pattern", func(t *testing.T) {
// given
d := Discover{
Find: Find{
Glob: "does-not-exist",
},
}
f := setup(t, withDiscover(d))
// when
_, _, err := f.service.matchRepository(context.Background(), f.path, f.env)
// then
assert.ErrorContains(t, err, "error finding glob match for pattern")
})
t.Run("will match plugin by command when returns any output", func(t *testing.T) {
// given
@@ -148,11 +195,12 @@ func TestMatchRepository(t *testing.T) {
f := setup(t, withDiscover(d))
// when
match, err := f.service.matchRepository(context.Background(), f.path, f.env)
match, discovery, err := f.service.matchRepository(context.Background(), f.path, f.env)
// then
assert.NoError(t, err)
assert.True(t, match)
assert.True(t, discovery)
})
t.Run("will not match plugin by command when returns no output", func(t *testing.T) {
// given
@@ -166,11 +214,11 @@ func TestMatchRepository(t *testing.T) {
f := setup(t, withDiscover(d))
// when
match, err := f.service.matchRepository(context.Background(), f.path, f.env)
match, discovery, err := f.service.matchRepository(context.Background(), f.path, f.env)
// then
assert.NoError(t, err)
assert.False(t, match)
assert.True(t, discovery)
})
t.Run("will match plugin because env var defined", func(t *testing.T) {
// given
@@ -184,11 +232,12 @@ func TestMatchRepository(t *testing.T) {
f := setup(t, withDiscover(d))
// when
match, err := f.service.matchRepository(context.Background(), f.path, f.env)
match, discovery, err := f.service.matchRepository(context.Background(), f.path, f.env)
// then
assert.NoError(t, err)
assert.True(t, match)
assert.True(t, discovery)
})
t.Run("will not match plugin because no env var defined", func(t *testing.T) {
// given
@@ -203,11 +252,12 @@ func TestMatchRepository(t *testing.T) {
f := setup(t, withDiscover(d))
// when
match, err := f.service.matchRepository(context.Background(), f.path, f.env)
match, discovery, err := f.service.matchRepository(context.Background(), f.path, f.env)
// then
assert.NoError(t, err)
assert.False(t, match)
assert.True(t, discovery)
})
t.Run("will not match plugin by command when command fails", func(t *testing.T) {
// given
@@ -221,11 +271,25 @@ func TestMatchRepository(t *testing.T) {
f := setup(t, withDiscover(d))
// when
match, err := f.service.matchRepository(context.Background(), f.path, f.env)
match, discovery, err := f.service.matchRepository(context.Background(), f.path, f.env)
// then
assert.Error(t, err)
assert.False(t, match)
assert.True(t, discovery)
})
t.Run("will not match plugin as discovery is not set", func(t *testing.T) {
// given
d := Discover{}
f := setup(t, withDiscover(d))
// when
match, discovery, err := f.service.matchRepository(context.Background(), f.path, f.env)
// then
assert.NoError(t, err)
assert.False(t, match)
assert.False(t, discovery)
})
}
@@ -238,17 +302,49 @@ func Test_Negative_ConfigFile_DoesnotExist(t *testing.T) {
func TestGenerateManifest(t *testing.T) {
configFilePath := "./testdata/kustomize/config"
t.Run("successful generate", func(t *testing.T) {
service, err := newService(configFilePath)
require.NoError(t, err)
res1, err := service.generateManifest(context.Background(), "testdata/kustomize", nil)
require.NoError(t, err)
require.NotNil(t, res1)
expectedOutput := "{\"apiVersion\":\"v1\",\"data\":{\"foo\":\"bar\"},\"kind\":\"ConfigMap\",\"metadata\":{\"name\":\"my-map\"}}"
if res1 != nil {
require.Equal(t, expectedOutput, res1.Manifests[0])
}
})
t.Run("bad generate command", func(t *testing.T) {
service, err := newService(configFilePath)
require.NoError(t, err)
service.WithGenerateCommand(Command{Command: []string{"bad-command"}})
res, err := service.generateManifest(context.Background(), "testdata/kustomize", nil)
assert.ErrorContains(t, err, "executable file not found")
assert.Nil(t, res.Manifests)
})
t.Run("bad yaml output", func(t *testing.T) {
service, err := newService(configFilePath)
require.NoError(t, err)
service.WithGenerateCommand(Command{Command: []string{"echo", "invalid yaml: }"}})
res, err := service.generateManifest(context.Background(), "testdata/kustomize", nil)
assert.ErrorContains(t, err, "failed to unmarshal manifest")
assert.Nil(t, res.Manifests)
})
}
func TestGenerateManifest_deadline_exceeded(t *testing.T) {
configFilePath := "./testdata/kustomize/config"
service, err := newService(configFilePath)
require.NoError(t, err)
res1, err := service.generateManifest(context.Background(), "", nil)
require.NoError(t, err)
require.NotNil(t, res1)
expectedOutput := "{\"apiVersion\":\"v1\",\"data\":{\"foo\":\"bar\"},\"kind\":\"ConfigMap\",\"metadata\":{\"name\":\"my-map\"}}"
if res1 != nil {
require.Equal(t, expectedOutput, res1.Manifests[0])
}
expiredCtx, cancel := context.WithTimeout(context.Background(), time.Second*0)
defer cancel()
_, err = service.generateManifest(expiredCtx, "", nil)
assert.ErrorContains(t, err, "context deadline exceeded")
}
// TestRunCommandContextTimeout makes sure the command dies at timeout rather than sleeping past the timeout.
@@ -266,3 +362,388 @@ func TestRunCommandContextTimeout(t *testing.T) {
assert.Error(t, err) // The command should time out, causing an error.
assert.Less(t, after.Sub(before), 1*time.Second)
}
func TestRunCommandEmptyCommand(t *testing.T) {
_, err := runCommand(context.Background(), Command{}, "", nil)
assert.ErrorContains(t, err, "Command is empty")
}
func Test_getParametersAnnouncement_empty_command(t *testing.T) {
staticYAML := `
- name: static-a
- name: static-b
`
static := &[]*repoclient.ParameterAnnouncement{}
err := yaml.Unmarshal([]byte(staticYAML), static)
require.NoError(t, err)
command := Command{
Command: []string{"echo"},
Args: []string{`[]`},
}
res, err := getParametersAnnouncement(context.Background(), "", *static, command)
require.NoError(t, err)
assert.Equal(t, []*repoclient.ParameterAnnouncement{{Name: "static-a"}, {Name: "static-b"}}, res.ParameterAnnouncements)
}
func Test_getParametersAnnouncement_no_command(t *testing.T) {
staticYAML := `
- name: static-a
- name: static-b
`
static := &[]*repoclient.ParameterAnnouncement{}
err := yaml.Unmarshal([]byte(staticYAML), static)
require.NoError(t, err)
command := Command{}
res, err := getParametersAnnouncement(context.Background(), "", *static, command)
require.NoError(t, err)
assert.Equal(t, []*repoclient.ParameterAnnouncement{{Name: "static-a"}, {Name: "static-b"}}, res.ParameterAnnouncements)
}
func Test_getParametersAnnouncement_static_and_dynamic(t *testing.T) {
staticYAML := `
- name: static-a
- name: static-b
`
static := &[]*repoclient.ParameterAnnouncement{}
err := yaml.Unmarshal([]byte(staticYAML), static)
require.NoError(t, err)
command := Command{
Command: []string{"echo"},
Args: []string{`[{"name": "dynamic-a"}, {"name": "dynamic-b"}]`},
}
res, err := getParametersAnnouncement(context.Background(), "", *static, command)
require.NoError(t, err)
expected := []*repoclient.ParameterAnnouncement{
{Name: "dynamic-a"},
{Name: "dynamic-b"},
{Name: "static-a"},
{Name: "static-b"},
}
assert.Equal(t, expected, res.ParameterAnnouncements)
}
func Test_getParametersAnnouncement_invalid_json(t *testing.T) {
command := Command{
Command: []string{"echo"},
Args: []string{`[`},
}
_, err := getParametersAnnouncement(context.Background(), "", []*repoclient.ParameterAnnouncement{}, command)
assert.Error(t, err)
assert.Contains(t, err.Error(), "unexpected end of JSON input")
}
func Test_getParametersAnnouncement_bad_command(t *testing.T) {
command := Command{
Command: []string{"exit"},
Args: []string{"1"},
}
_, err := getParametersAnnouncement(context.Background(), "", []*repoclient.ParameterAnnouncement{}, command)
assert.Error(t, err)
assert.Contains(t, err.Error(), "error executing dynamic parameter output command")
}
func Test_getTempDirMustCleanup(t *testing.T) {
tempDir := t.TempDir()
// Induce a directory create error to verify error handling.
err := os.Chmod(tempDir, 0000)
require.NoError(t, err)
_, _, err = getTempDirMustCleanup(path.Join(tempDir, "test"))
assert.ErrorContains(t, err, "error creating temp dir")
err = os.Chmod(tempDir, 0700)
require.NoError(t, err)
workDir, cleanup, err := getTempDirMustCleanup(tempDir)
require.NoError(t, err)
require.DirExists(t, workDir)
cleanup()
assert.NoDirExists(t, workDir)
}
func TestService_Init(t *testing.T) {
// Set up a base directory containing a test directory and a test file.
tempDir := t.TempDir()
workDir := path.Join(tempDir, "workDir")
err := os.MkdirAll(workDir, 0700)
require.NoError(t, err)
testfile := path.Join(workDir, "testfile")
file, err := os.Create(testfile)
require.NoError(t, err)
err = file.Close()
require.NoError(t, err)
// Make the base directory read-only so Init's cleanup fails.
err = os.Chmod(tempDir, 0000)
require.NoError(t, err)
s := NewService(CMPServerInitConstants{PluginConfig: PluginConfig{}})
err = s.Init(workDir)
assert.ErrorContains(t, err, "error removing workdir", "Init must throw an error if it can't remove the work directory")
// Make the base directory writable so Init's cleanup succeeds.
err = os.Chmod(tempDir, 0700)
require.NoError(t, err)
err = s.Init(workDir)
assert.NoError(t, err)
assert.DirExists(t, workDir)
assert.NoFileExists(t, testfile)
}
func TestEnviron(t *testing.T) {
t.Run("empty environ", func(t *testing.T) {
env := environ([]*apiclient.EnvEntry{})
assert.Nil(t, env)
})
t.Run("env vars with empty names or values", func(t *testing.T) {
env := environ([]*apiclient.EnvEntry{
{Value: "test"},
{Name: "test"},
})
assert.Nil(t, env)
})
t.Run("proper env vars", func(t *testing.T) {
env := environ([]*apiclient.EnvEntry{
{Name: "name1", Value: "value1"},
{Name: "name2", Value: "value2"},
})
assert.Equal(t, []string{"name1=value1", "name2=value2"}, env)
})
}
type MockGenerateManifestStream struct {
metadataSent bool
fileSent bool
metadataRequest *apiclient.AppStreamRequest
fileRequest *apiclient.AppStreamRequest
response *apiclient.ManifestResponse
}
func NewMockGenerateManifestStream(repoPath, appPath string, env []string) (*MockGenerateManifestStream, error) {
tgz, mr, err := cmp.GetCompressedRepoAndMetadata(repoPath, appPath, env, nil, nil)
if err != nil {
return nil, err
}
defer tgzstream.CloseAndDelete(tgz)
tgzBuffer := bytes.NewBuffer(nil)
_, err = io.Copy(tgzBuffer, tgz)
if err != nil {
return nil, fmt.Errorf("failed to copy manifest targz to a byte buffer: %w", err)
}
return &MockGenerateManifestStream{
metadataRequest: mr,
fileRequest: cmp.AppFileRequest(tgzBuffer.Bytes()),
}, nil
}
func (m *MockGenerateManifestStream) SendAndClose(response *apiclient.ManifestResponse) error {
m.response = response
return nil
}
func (m *MockGenerateManifestStream) Recv() (*apiclient.AppStreamRequest, error) {
if !m.metadataSent {
m.metadataSent = true
return m.metadataRequest, nil
}
if !m.fileSent {
m.fileSent = true
return m.fileRequest, nil
}
return nil, io.EOF
}
func (m *MockGenerateManifestStream) Context() context.Context {
return context.Background()
}
func TestService_GenerateManifest(t *testing.T) {
configFilePath := "./testdata/kustomize/config"
service, err := newService(configFilePath)
require.NoError(t, err)
t.Run("successful generate", func(t *testing.T) {
s, err := NewMockGenerateManifestStream("./testdata/kustomize", "./testdata/kustomize", nil)
require.NoError(t, err)
err = service.generateManifestGeneric(s)
require.NoError(t, err)
require.NotNil(t, s.response)
assert.Equal(t, []string{"{\"apiVersion\":\"v1\",\"data\":{\"foo\":\"bar\"},\"kind\":\"ConfigMap\",\"metadata\":{\"name\":\"my-map\"}}"}, s.response.Manifests)
})
t.Run("out-of-bounds app path", func(t *testing.T) {
s, err := NewMockGenerateManifestStream("./testdata/kustomize", "./testdata/kustomize", nil)
require.NoError(t, err)
// set a malicious app path on the metadata
s.metadataRequest.Request.(*apiclient.AppStreamRequest_Metadata).Metadata.AppRelPath = "../out-of-bounds"
err = service.generateManifestGeneric(s)
require.ErrorContains(t, err, "illegal appPath")
assert.Nil(t, s.response)
})
}
type MockMatchRepositoryStream struct {
metadataSent bool
fileSent bool
metadataRequest *apiclient.AppStreamRequest
fileRequest *apiclient.AppStreamRequest
response *apiclient.RepositoryResponse
}
func NewMockMatchRepositoryStream(repoPath, appPath string, env []string) (*MockMatchRepositoryStream, error) {
tgz, mr, err := cmp.GetCompressedRepoAndMetadata(repoPath, appPath, env, nil, nil)
if err != nil {
return nil, err
}
defer tgzstream.CloseAndDelete(tgz)
tgzBuffer := bytes.NewBuffer(nil)
_, err = io.Copy(tgzBuffer, tgz)
if err != nil {
return nil, fmt.Errorf("failed to copy manifest targz to a byte buffer: %w", err)
}
return &MockMatchRepositoryStream{
metadataRequest: mr,
fileRequest: cmp.AppFileRequest(tgzBuffer.Bytes()),
}, nil
}
func (m *MockMatchRepositoryStream) SendAndClose(response *apiclient.RepositoryResponse) error {
m.response = response
return nil
}
func (m *MockMatchRepositoryStream) Recv() (*apiclient.AppStreamRequest, error) {
if !m.metadataSent {
m.metadataSent = true
return m.metadataRequest, nil
}
if !m.fileSent {
m.fileSent = true
return m.fileRequest, nil
}
return nil, io.EOF
}
func (m *MockMatchRepositoryStream) Context() context.Context {
return context.Background()
}
func TestService_MatchRepository(t *testing.T) {
configFilePath := "./testdata/kustomize/config"
service, err := newService(configFilePath)
require.NoError(t, err)
t.Run("supported app", func(t *testing.T) {
s, err := NewMockMatchRepositoryStream("./testdata/kustomize", "./testdata/kustomize", nil)
require.NoError(t, err)
err = service.matchRepositoryGeneric(s)
require.NoError(t, err)
require.NotNil(t, s.response)
assert.True(t, s.response.IsSupported)
})
t.Run("unsupported app", func(t *testing.T) {
s, err := NewMockMatchRepositoryStream("./testdata/ksonnet", "./testdata/ksonnet", nil)
require.NoError(t, err)
err = service.matchRepositoryGeneric(s)
require.NoError(t, err)
require.NotNil(t, s.response)
assert.False(t, s.response.IsSupported)
})
}
type MockParametersAnnouncementStream struct {
metadataSent bool
fileSent bool
metadataRequest *apiclient.AppStreamRequest
fileRequest *apiclient.AppStreamRequest
response *apiclient.ParametersAnnouncementResponse
}
func NewMockParametersAnnouncementStream(repoPath, appPath string, env []string) (*MockParametersAnnouncementStream, error) {
tgz, mr, err := cmp.GetCompressedRepoAndMetadata(repoPath, appPath, env, nil, nil)
if err != nil {
return nil, err
}
defer tgzstream.CloseAndDelete(tgz)
tgzBuffer := bytes.NewBuffer(nil)
_, err = io.Copy(tgzBuffer, tgz)
if err != nil {
return nil, fmt.Errorf("failed to copy manifest targz to a byte buffer: %w", err)
}
return &MockParametersAnnouncementStream{
metadataRequest: mr,
fileRequest: cmp.AppFileRequest(tgzBuffer.Bytes()),
}, nil
}
func (m *MockParametersAnnouncementStream) SendAndClose(response *apiclient.ParametersAnnouncementResponse) error {
m.response = response
return nil
}
func (m *MockParametersAnnouncementStream) Recv() (*apiclient.AppStreamRequest, error) {
if !m.metadataSent {
m.metadataSent = true
return m.metadataRequest, nil
}
if !m.fileSent {
m.fileSent = true
return m.fileRequest, nil
}
return nil, io.EOF
}
func (m *MockParametersAnnouncementStream) SetHeader(metadata.MD) error {
return nil
}
func (m *MockParametersAnnouncementStream) SendHeader(metadata.MD) error {
return nil
}
func (m *MockParametersAnnouncementStream) SetTrailer(metadata.MD) {}
func (m *MockParametersAnnouncementStream) Context() context.Context {
return context.Background()
}
func (m *MockParametersAnnouncementStream) SendMsg(interface{}) error {
return nil
}
func (m *MockParametersAnnouncementStream) RecvMsg(interface{}) error {
return nil
}
func TestService_GetParametersAnnouncement(t *testing.T) {
configFilePath := "./testdata/kustomize/config"
service, err := newService(configFilePath)
require.NoError(t, err)
t.Run("successful response", func(t *testing.T) {
s, err := NewMockParametersAnnouncementStream("./testdata/kustomize", "./testdata/kustomize", nil)
require.NoError(t, err)
err = service.GetParametersAnnouncement(s)
require.NoError(t, err)
require.NotNil(t, s.response)
require.Len(t, s.response.ParameterAnnouncements, 1)
assert.Equal(t, repoclient.ParameterAnnouncement{Name: "test-param", String_: "test-value"}, *s.response.ParameterAnnouncements[0])
})
t.Run("out of bounds app", func(t *testing.T) {
s, err := NewMockParametersAnnouncementStream("./testdata/kustomize", "./testdata/kustomize", nil)
require.NoError(t, err)
// set a malicious app path on the metadata
s.metadataRequest.Request.(*apiclient.AppStreamRequest_Metadata).Metadata.AppRelPath = "../out-of-bounds"
err = service.GetParametersAnnouncement(s)
require.ErrorContains(t, err, "illegal appPath")
require.Nil(t, s.response)
})
}

View File

@@ -7,8 +7,12 @@ spec:
init:
command: [kustomize, version]
generate:
command: [sh, -c, "cd testdata/kustomize && kustomize build"]
command: [sh, -c, "kustomize build"]
discover:
find:
command: [sh, -c, find . -name kustomization.yaml]
glob: "**/*/kustomization.yaml"
glob: "**/kustomization.yaml"
parameters:
static:
- name: test-param
string: test-value

View File

@@ -108,7 +108,7 @@ func (a *ArgoCDCMPServer) CreateGRPC() (*grpc.Server, error) {
return true, nil
}))
pluginService := plugin.NewService(a.initConstants)
err := pluginService.Init()
err := pluginService.Init(common.GetCMPWorkDir())
if err != nil {
return nil, fmt.Errorf("error initializing plugin service: %s", err)
}

View File

@@ -1,6 +1,7 @@
package common
import (
"errors"
"os"
"path/filepath"
"strconv"
@@ -316,3 +317,8 @@ const (
SecurityMedium = 2 // Could indicate malicious events, but has a high likelihood of being user/system error (i.e. access denied)
SecurityLow = 1 // Unexceptional entries (i.e. successful access logs)
)
// Common error messages
const TokenVerificationError = "failed to verify the token"
var TokenVerificationErr = errors.New(TokenVerificationError)

View File

@@ -335,7 +335,7 @@ func (ctrl *ApplicationController) handleObjectUpdated(managedByApp map[string]b
}
if !ctrl.canProcessApp(obj) {
// Don't force refresh app if app belongs to a different controller shard
// Don't force refresh app if app belongs to a different controller shard or is outside the allowed namespaces.
continue
}
@@ -415,33 +415,32 @@ func isKnownOrphanedResourceExclusion(key kube.ResourceKey, proj *appv1.AppProje
func (ctrl *ApplicationController) getResourceTree(a *appv1.Application, managedResources []*appv1.ResourceDiff) (*appv1.ApplicationTree, error) {
nodes := make([]appv1.ResourceNode, 0)
proj, err := ctrl.getAppProj(a)
if err != nil {
return nil, err
return nil, fmt.Errorf("failed to get project: %w", err)
}
orphanedNodesMap := make(map[kube.ResourceKey]appv1.ResourceNode)
warnOrphaned := true
if proj.Spec.OrphanedResources != nil {
orphanedNodesMap, err = ctrl.stateCache.GetNamespaceTopLevelResources(a.Spec.Destination.Server, a.Spec.Destination.Namespace)
if err != nil {
return nil, err
return nil, fmt.Errorf("failed to get namespace top-level resources: %w", err)
}
warnOrphaned = proj.Spec.OrphanedResources.IsWarn()
}
for i := range managedResources {
managedResource := managedResources[i]
delete(orphanedNodesMap, kube.NewResourceKey(managedResource.Group, managedResource.Kind, managedResource.Namespace, managedResource.Name))
var live = &unstructured.Unstructured{}
err := json.Unmarshal([]byte(managedResource.LiveState), &live)
if err != nil {
return nil, err
return nil, fmt.Errorf("failed to unmarshal live state of managed resources: %w", err)
}
var target = &unstructured.Unstructured{}
err = json.Unmarshal([]byte(managedResource.TargetState), &target)
if err != nil {
return nil, err
return nil, fmt.Errorf("failed to unmarshal target state of managed resources: %w", err)
}
if live == nil {
@@ -457,7 +456,11 @@ func (ctrl *ApplicationController) getResourceTree(a *appv1.Application, managed
} else {
err := ctrl.stateCache.IterateHierarchy(a.Spec.Destination.Server, kube.GetResourceKey(live), func(child appv1.ResourceNode, appName string) bool {
permitted, _ := proj.IsResourcePermitted(schema.GroupKind{Group: child.ResourceRef.Group, Kind: child.ResourceRef.Kind}, child.Namespace, a.Spec.Destination, func(project string) ([]*appv1.Cluster, error) {
return ctrl.db.GetProjectClusters(context.TODO(), project)
clusters, err := ctrl.db.GetProjectClusters(context.TODO(), project)
if err != nil {
return nil, fmt.Errorf("failed to get project clusters: %w", err)
}
return clusters, nil
})
if !permitted {
return false
@@ -466,7 +469,7 @@ func (ctrl *ApplicationController) getResourceTree(a *appv1.Application, managed
return true
})
if err != nil {
return nil, err
return nil, fmt.Errorf("failed to iterate resource hierarchy: %w", err)
}
}
}
@@ -515,7 +518,7 @@ func (ctrl *ApplicationController) getResourceTree(a *appv1.Application, managed
hosts, err := ctrl.getAppHosts(a, nodes)
if err != nil {
return nil, err
return nil, fmt.Errorf("failed to get app hosts: %w", err)
}
return &appv1.ApplicationTree{Nodes: nodes, OrphanedNodes: orphanedNodes, Hosts: hosts}, nil
}
@@ -751,6 +754,7 @@ func (ctrl *ApplicationController) Run(ctx context.Context, statusProcessors int
// needs to be the qualified name of the application, i.e. <namespace>/<name>.
func (ctrl *ApplicationController) requestAppRefresh(appName string, compareWith *CompareWith, after *time.Duration) {
key := ctrl.toAppKey(appName)
if compareWith != nil && after != nil {
ctrl.appComparisonTypeRefreshQueue.AddAfter(fmt.Sprintf("%s/%d", key, compareWith), *after)
} else {
@@ -1313,7 +1317,6 @@ func (ctrl *ApplicationController) processAppRefreshQueueItem() (processNext boo
}
ctrl.appRefreshQueue.Done(appKey)
}()
obj, exists, err := ctrl.appInformer.GetIndexer().GetByKey(appKey.(string))
if err != nil {
log.Errorf("Failed to get application '%s' from informer index: %+v", appKey, err)
@@ -1334,9 +1337,9 @@ func (ctrl *ApplicationController) processAppRefreshQueueItem() (processNext boo
if !needRefresh {
return
}
app := origApp.DeepCopy()
logCtx := log.WithFields(log.Fields{"application": app.QualifiedName()})
startTime := time.Now()
defer func() {
reconcileDuration := time.Since(startTime)
@@ -1357,7 +1360,7 @@ func (ctrl *ApplicationController) processAppRefreshQueueItem() (processNext boo
} else {
var tree *appv1.ApplicationTree
if tree, err = ctrl.getResourceTree(app, managedResources); err == nil {
app.Status.Summary = tree.GetSummary()
app.Status.Summary = tree.GetSummary(app)
if err := ctrl.cache.SetAppResourcesTree(app.InstanceName(ctrl.namespace), tree); err != nil {
logCtx.Errorf("Failed to cache resources tree: %v", err)
return
@@ -1389,15 +1392,38 @@ func (ctrl *ApplicationController) processAppRefreshQueueItem() (processNext boo
localManifests = opState.Operation.Sync.Manifests
}
revision := app.Spec.Source.TargetRevision
if comparisonLevel == CompareWithRecent {
revision = app.Status.Sync.Revision
}
revisions := make([]string, 0)
sources := make([]appv1.ApplicationSource, 0)
hasMultipleSources := app.Spec.HasMultipleSources()
// If we have multiple sources, we use all the sources under `sources` field and ignore source under `source` field.
// else we use the source under the source field.
if hasMultipleSources {
for _, source := range app.Spec.Sources {
// We do not perform any filtering of duplicate sources.
// Argo CD will apply and update the resources generated from the sources automatically
// based on the order in which manifests were generated
sources = append(sources, source)
revisions = append(revisions, source.TargetRevision)
}
if comparisonLevel == CompareWithRecent {
revisions = app.Status.Sync.Revisions
}
} else {
revision := app.Spec.GetSource().TargetRevision
if comparisonLevel == CompareWithRecent {
revision = app.Status.Sync.Revision
}
revisions = append(revisions, revision)
sources = append(sources, app.Spec.GetSource())
}
now := metav1.Now()
compareResult := ctrl.appStateManager.CompareAppState(app, project, revision, app.Spec.Source,
compareResult := ctrl.appStateManager.CompareAppState(app, project, revisions, sources,
refreshType == appv1.RefreshTypeHard,
comparisonLevel == CompareWithLatestForceResolve, localManifests)
comparisonLevel == CompareWithLatestForceResolve, localManifests, hasMultipleSources)
for k, v := range compareResult.timings {
logCtx = logCtx.WithField(k, v.Milliseconds())
}
@@ -1408,7 +1434,7 @@ func (ctrl *ApplicationController) processAppRefreshQueueItem() (processNext boo
if err != nil {
logCtx.Errorf("Failed to cache app resources: %v", err)
} else {
app.Status.Summary = tree.GetSummary()
app.Status.Summary = tree.GetSummary(app)
}
if project.Spec.SyncWindows.Matches(app).CanSync(false) {
@@ -1438,6 +1464,7 @@ func (ctrl *ApplicationController) processAppRefreshQueueItem() (processNext boo
return resourceStatusKey(app.Status.Resources[i]) < resourceStatusKey(app.Status.Resources[j])
})
app.Status.SourceType = compareResult.appSourceType
app.Status.SourceTypes = compareResult.appSourceTypes
ctrl.persistAppStatus(origApp, &app.Status)
return
}
@@ -1463,27 +1490,34 @@ func (ctrl *ApplicationController) needRefreshAppStatus(app *appv1.Application,
// user requested app refresh.
refreshType = requestedType
reason = fmt.Sprintf("%s refresh requested", refreshType)
} else if !app.Spec.Source.Equals(app.Status.Sync.ComparedTo.Source) {
reason = "spec.source differs"
compareWith = CompareWithLatestForceResolve
} else if hardExpired || softExpired {
// The commented line below mysteriously crashes if app.Status.ReconciledAt is nil
// reason = fmt.Sprintf("comparison expired. reconciledAt: %v, expiry: %v", app.Status.ReconciledAt, statusRefreshTimeout)
//TODO: find existing Golang bug or create a new one
reconciledAtStr := "never"
if app.Status.ReconciledAt != nil {
reconciledAtStr = app.Status.ReconciledAt.String()
} else {
if app.Spec.HasMultipleSources() {
if (len(app.Spec.Sources) != len(app.Status.Sync.ComparedTo.Sources)) || !reflect.DeepEqual(app.Spec.Sources, app.Status.Sync.ComparedTo.Sources) {
reason = "atleast one of the spec.sources differs"
compareWith = CompareWithLatestForceResolve
}
} else if !app.Spec.Source.Equals(app.Status.Sync.ComparedTo.Source) {
reason = "spec.source differs"
compareWith = CompareWithLatestForceResolve
} else if hardExpired || softExpired {
// The commented line below mysteriously crashes if app.Status.ReconciledAt is nil
// reason = fmt.Sprintf("comparison expired. reconciledAt: %v, expiry: %v", app.Status.ReconciledAt, statusRefreshTimeout)
//TODO: find existing Golang bug or create a new one
reconciledAtStr := "never"
if app.Status.ReconciledAt != nil {
reconciledAtStr = app.Status.ReconciledAt.String()
}
reason = fmt.Sprintf("comparison expired, requesting refresh. reconciledAt: %v, expiry: %v", reconciledAtStr, statusRefreshTimeout)
if hardExpired {
reason = fmt.Sprintf("comparison expired, requesting hard refresh. reconciledAt: %v, expiry: %v", reconciledAtStr, statusHardRefreshTimeout)
refreshType = appv1.RefreshTypeHard
}
} else if !app.Spec.Destination.Equals(app.Status.Sync.ComparedTo.Destination) {
reason = "spec.destination differs"
} else if requested, level := ctrl.isRefreshRequested(app.QualifiedName()); requested {
compareWith = level
reason = "controller refresh requested"
}
reason = fmt.Sprintf("comparison expired, requesting refresh. reconciledAt: %v, expiry: %v", reconciledAtStr, statusRefreshTimeout)
if hardExpired {
reason = fmt.Sprintf("comparison expired, requesting hard refresh. reconciledAt: %v, expiry: %v", reconciledAtStr, statusHardRefreshTimeout)
refreshType = appv1.RefreshTypeHard
}
} else if !app.Spec.Destination.Equals(app.Status.Sync.ComparedTo.Destination) {
reason = "spec.destination differs"
} else if requested, level := ctrl.isRefreshRequested(app.QualifiedName()); requested {
compareWith = level
reason = "controller refresh requested"
}
if reason != "" {
@@ -1497,17 +1531,7 @@ func (ctrl *ApplicationController) refreshAppConditions(app *appv1.Application)
errorConditions := make([]appv1.ApplicationCondition, 0)
proj, err := ctrl.getAppProj(app)
if err != nil {
if apierr.IsNotFound(err) {
errorConditions = append(errorConditions, appv1.ApplicationCondition{
Type: appv1.ApplicationConditionInvalidSpecError,
Message: fmt.Sprintf("Application referencing project %s which does not exist", app.Spec.Project),
})
} else {
errorConditions = append(errorConditions, appv1.ApplicationCondition{
Type: appv1.ApplicationConditionUnknownError,
Message: err.Error(),
})
}
errorConditions = append(errorConditions, ctrl.projectErrorToCondition(err, app))
} else {
specConditions, err := argo.ValidatePermissions(context.Background(), &app.Spec, proj, ctrl.db)
if err != nil {
@@ -1530,7 +1554,9 @@ func (ctrl *ApplicationController) refreshAppConditions(app *appv1.Application)
func (ctrl *ApplicationController) normalizeApplication(orig, app *appv1.Application) {
logCtx := log.WithFields(log.Fields{"application": app.QualifiedName()})
app.Spec = *argo.NormalizeApplicationSpec(&app.Spec)
patch, modified, err := diff.CreateTwoWayMergePatch(orig, app, appv1.Application{})
if err != nil {
logCtx.Errorf("error constructing app spec patch: %v", err)
} else if modified {
@@ -1574,7 +1600,6 @@ func (ctrl *ApplicationController) persistAppStatus(orig *appv1.Application, new
logCtx.Infof("No status changes. Skipping patch")
return
}
logCtx.Debugf("patch: %s", string(patch))
appClient := ctrl.applicationClientset.ArgoprojV1alpha1().Applications(orig.Namespace)
_, err = appClient.Patch(context.Background(), orig.Name, types.MergePatchType, patch, metav1.PatchOptions{})
if err != nil {
@@ -1590,6 +1615,7 @@ func (ctrl *ApplicationController) autoSync(app *appv1.Application, syncStatus *
return nil
}
logCtx := log.WithFields(log.Fields{"application": app.QualifiedName()})
if app.Operation != nil {
logCtx.Infof("Skipping auto-sync: another operation is in progress")
return nil
@@ -1621,13 +1647,15 @@ func (ctrl *ApplicationController) autoSync(app *appv1.Application, syncStatus *
}
desiredCommitSHA := syncStatus.Revision
alreadyAttempted, attemptPhase := alreadyAttemptedSync(app, desiredCommitSHA)
desiredCommitSHAsMS := syncStatus.Revisions
alreadyAttempted, attemptPhase := alreadyAttemptedSync(app, desiredCommitSHA, desiredCommitSHAsMS, app.Spec.HasMultipleSources())
selfHeal := app.Spec.SyncPolicy.Automated.SelfHeal
op := appv1.Operation{
Sync: &appv1.SyncOperation{
Revision: desiredCommitSHA,
Prune: app.Spec.SyncPolicy.Automated.Prune,
SyncOptions: app.Spec.SyncPolicy.SyncOptions,
Revisions: desiredCommitSHAsMS,
},
InitiatedBy: appv1.OperationInitiator{Automated: true},
Retry: appv1.RetryStrategy{Limit: 5},
@@ -1679,7 +1707,6 @@ func (ctrl *ApplicationController) autoSync(app *appv1.Application, syncStatus *
return &appv1.ApplicationCondition{Type: appv1.ApplicationConditionSyncError, Message: message}
}
}
appIf := ctrl.applicationClientset.ArgoprojV1alpha1().Applications(app.Namespace)
_, err := argo.SetAppOperation(appIf, app.Name, &op)
if err != nil {
@@ -1694,20 +1721,41 @@ func (ctrl *ApplicationController) autoSync(app *appv1.Application, syncStatus *
// alreadyAttemptedSync returns whether or not the most recent sync was performed against the
// commitSHA and with the same app source config which are currently set in the app
func alreadyAttemptedSync(app *appv1.Application, commitSHA string) (bool, synccommon.OperationPhase) {
func alreadyAttemptedSync(app *appv1.Application, commitSHA string, commitSHAsMS []string, hasMultipleSources bool) (bool, synccommon.OperationPhase) {
if app.Status.OperationState == nil || app.Status.OperationState.Operation.Sync == nil || app.Status.OperationState.SyncResult == nil {
return false, ""
}
if app.Status.OperationState.SyncResult.Revision != commitSHA {
return false, ""
if hasMultipleSources {
if !reflect.DeepEqual(app.Status.OperationState.SyncResult.Revisions, commitSHAsMS) {
return false, ""
}
} else {
if app.Status.OperationState.SyncResult.Revision != commitSHA {
return false, ""
}
}
if hasMultipleSources {
// Ignore differences in target revision, since we already just verified commitSHAs are equal,
// and we do not want to trigger auto-sync due to things like HEAD != master
specSources := app.Spec.Sources.DeepCopy()
syncSources := app.Status.OperationState.SyncResult.Sources.DeepCopy()
for _, source := range specSources {
source.TargetRevision = ""
}
for _, source := range syncSources {
source.TargetRevision = ""
}
return reflect.DeepEqual(app.Spec.Sources, app.Status.OperationState.SyncResult.Sources), app.Status.OperationState.Phase
} else {
// Ignore differences in target revision, since we already just verified commitSHAs are equal,
// and we do not want to trigger auto-sync due to things like HEAD != master
specSource := app.Spec.Source.DeepCopy()
specSource.TargetRevision = ""
syncResSource := app.Status.OperationState.SyncResult.Source.DeepCopy()
syncResSource.TargetRevision = ""
return reflect.DeepEqual(app.Spec.GetSource(), app.Status.OperationState.SyncResult.Source), app.Status.OperationState.Phase
}
// Ignore differences in target revision, since we already just verified commitSHAs are equal,
// and we do not want to trigger auto-sync due to things like HEAD != master
specSource := app.Spec.Source.DeepCopy()
specSource.TargetRevision = ""
syncResSource := app.Status.OperationState.SyncResult.Source.DeepCopy()
syncResSource.TargetRevision = ""
return reflect.DeepEqual(app.Spec.Source, app.Status.OperationState.SyncResult.Source), app.Status.OperationState.Phase
}
func (ctrl *ApplicationController) shouldSelfHeal(app *appv1.Application) (bool, time.Duration) {
@@ -1729,6 +1777,13 @@ func (ctrl *ApplicationController) canProcessApp(obj interface{}) bool {
if !ok {
return false
}
// Only process given app if it exists in a watched namespace, or in the
// control plane's namespace.
if app.Namespace != ctrl.namespace && !glob.MatchStringInList(ctrl.applicationNamespaces, app.Namespace, false) {
return false
}
if ctrl.clusterFilter != nil {
cluster, err := ctrl.db.GetCluster(context.Background(), app.Spec.Destination.Server)
if err != nil {
@@ -1737,12 +1792,6 @@ func (ctrl *ApplicationController) canProcessApp(obj interface{}) bool {
return ctrl.clusterFilter(cluster)
}
// Only process given app if it exists in a watched namespace, or in the
// control plane's namespace.
if app.Namespace != ctrl.namespace && !glob.MatchStringInList(ctrl.applicationNamespaces, app.Namespace, false) {
return false
}
return true
}
@@ -1798,7 +1847,7 @@ func (ctrl *ApplicationController) newApplicationInformerAndLister() (cache.Shar
// If the application is not allowed to use the project,
// log an error.
if _, err := ctrl.getAppProj(app); err != nil {
ctrl.setAppCondition(app, appv1.ApplicationCondition{Type: appv1.ApplicationConditionUnknownError, Message: err.Error()})
ctrl.setAppCondition(app, ctrl.projectErrorToCondition(err, app))
}
}
@@ -1869,6 +1918,19 @@ func (ctrl *ApplicationController) newApplicationInformerAndLister() (cache.Shar
return informer, lister
}
func (ctrl *ApplicationController) projectErrorToCondition(err error, app *appv1.Application) appv1.ApplicationCondition {
var condition appv1.ApplicationCondition
if apierr.IsNotFound(err) {
condition = appv1.ApplicationCondition{
Type: appv1.ApplicationConditionInvalidSpecError,
Message: fmt.Sprintf("Application referencing project %s which does not exist", app.Spec.Project),
}
} else {
condition = appv1.ApplicationCondition{Type: appv1.ApplicationConditionUnknownError, Message: err.Error()}
}
return condition
}
func (ctrl *ApplicationController) RegisterClusterSecretUpdater(ctx context.Context) {
updater := NewClusterInfoUpdater(ctrl.stateCache, ctrl.db, ctrl.appLister.Applications(""), ctrl.cache, ctrl.clusterFilter, ctrl.getAppProj, ctrl.namespace)
go updater.Run(ctx)

View File

@@ -865,7 +865,7 @@ func TestNeedRefreshAppStatus(t *testing.T) {
app.Status.Sync = argoappv1.SyncStatus{
Status: argoappv1.SyncStatusCodeSynced,
ComparedTo: argoappv1.ComparedTo{
Source: app.Spec.Source,
Source: app.Spec.GetSource(),
Destination: app.Spec.Destination,
},
}
@@ -909,7 +909,7 @@ func TestNeedRefreshAppStatus(t *testing.T) {
app.Status.Sync = argoappv1.SyncStatus{
Status: argoappv1.SyncStatusCodeSynced,
ComparedTo: argoappv1.ComparedTo{
Source: app.Spec.Source,
Source: app.Spec.GetSource(),
Destination: app.Spec.Destination,
},
}
@@ -1012,7 +1012,7 @@ func TestUpdateReconciledAt(t *testing.T) {
app := newFakeApp()
reconciledAt := metav1.NewTime(time.Now().Add(-1 * time.Second))
app.Status = argoappv1.ApplicationStatus{ReconciledAt: &reconciledAt}
app.Status.Sync = argoappv1.SyncStatus{ComparedTo: argoappv1.ComparedTo{Source: app.Spec.Source, Destination: app.Spec.Destination}}
app.Status.Sync = argoappv1.SyncStatus{ComparedTo: argoappv1.ComparedTo{Source: app.Spec.GetSource(), Destination: app.Spec.Destination}}
ctrl := newFakeController(&fakeData{
apps: []runtime.Object{app, &defaultProj},
manifestResponse: &apiclient.ManifestResponse{
@@ -1068,6 +1068,34 @@ func TestUpdateReconciledAt(t *testing.T) {
}
func TestProjectErrorToCondition(t *testing.T) {
app := newFakeApp()
app.Spec.Project = "wrong project"
ctrl := newFakeController(&fakeData{
apps: []runtime.Object{app, &defaultProj},
manifestResponse: &apiclient.ManifestResponse{
Manifests: []string{},
Namespace: test.FakeDestNamespace,
Server: test.FakeClusterURL,
Revision: "abc123",
},
managedLiveObjs: make(map[kube.ResourceKey]*unstructured.Unstructured),
})
key, _ := cache.MetaNamespaceKeyFunc(app)
ctrl.appRefreshQueue.Add(key)
ctrl.requestAppRefresh(app.Name, CompareWithRecent.Pointer(), nil)
ctrl.processAppRefreshQueueItem()
obj, ok, err := ctrl.appInformer.GetIndexer().GetByKey(key)
assert.True(t, ok)
assert.NoError(t, err)
updatedApp := obj.(*argoappv1.Application)
assert.Equal(t, argoappv1.ApplicationConditionInvalidSpecError, updatedApp.Status.Conditions[0].Type)
assert.Equal(t, "Application referencing project wrong project which does not exist", updatedApp.Status.Conditions[0].Message)
assert.Equal(t, argoappv1.ApplicationConditionInvalidSpecError, updatedApp.Status.Conditions[0].Type)
}
func TestFinalizeProjectDeletion_HasApplications(t *testing.T) {
app := newFakeApp()
proj := &argoappv1.AppProject{ObjectMeta: metav1.ObjectMeta{Name: "default", Namespace: test.FakeArgoCDNamespace}}
@@ -1345,3 +1373,31 @@ func TestToAppKey(t *testing.T) {
})
}
}
func Test_canProcessApp(t *testing.T) {
app := newFakeApp()
ctrl := newFakeController(&fakeData{apps: []runtime.Object{app}})
ctrl.applicationNamespaces = []string{"good"}
t.Run("without cluster filter, good namespace", func(t *testing.T) {
app.Namespace = "good"
canProcess := ctrl.canProcessApp(app)
assert.True(t, canProcess)
})
t.Run("without cluster filter, bad namespace", func(t *testing.T) {
app.Namespace = "bad"
canProcess := ctrl.canProcessApp(app)
assert.False(t, canProcess)
})
t.Run("with cluster filter, good namespace", func(t *testing.T) {
app.Namespace = "good"
ctrl.clusterFilter = func(_ *argoappv1.Cluster) bool { return true }
canProcess := ctrl.canProcessApp(app)
assert.True(t, canProcess)
})
t.Run("with cluster filter, bad namespace", func(t *testing.T) {
app.Namespace = "bad"
ctrl.clusterFilter = func(_ *argoappv1.Cluster) bool { return true }
canProcess := ctrl.canProcessApp(app)
assert.False(t, canProcess)
})
}

View File

@@ -220,10 +220,10 @@ func asResourceNode(r *clustercache.Resource) appv1.ResourceNode {
gv = schema.GroupVersion{}
}
parentRefs := make([]appv1.ResourceRef, len(r.OwnerRefs))
for _, ownerRef := range r.OwnerRefs {
for i, ownerRef := range r.OwnerRefs {
ownerGvk := schema.FromAPIVersionAndKind(ownerRef.APIVersion, ownerRef.Kind)
ownerKey := kube.NewResourceKey(ownerGvk.Group, ownerRef.Kind, r.Ref.Namespace, ownerRef.Name)
parentRefs[0] = appv1.ResourceRef{Name: ownerRef.Name, Kind: ownerKey.Kind, Namespace: r.Ref.Namespace, Group: ownerKey.Group, UID: string(ownerRef.UID)}
parentRefs[i] = appv1.ResourceRef{Name: ownerRef.Name, Kind: ownerKey.Kind, Namespace: r.Ref.Namespace, Group: ownerKey.Group, UID: string(ownerRef.UID)}
}
var resHealth *appv1.HealthStatus
resourceInfo := resInfo(r)
@@ -389,6 +389,11 @@ func (c *liveStateCache) getCluster(server string) (clustercache.ClusterCache, e
return nil, fmt.Errorf("controller is configured to ignore cluster %s", cluster.Server)
}
resourceCustomLabels, err := c.settingsMgr.GetResourceCustomLabels()
if err != nil {
return nil, fmt.Errorf("error getting custom label: %w", err)
}
clusterCacheOpts := []clustercache.UpdateSettingsFunc{
clustercache.SetListSemaphore(semaphore.NewWeighted(clusterCacheListSemaphoreSize)),
clustercache.SetListPageSize(clusterCacheListPageSize),
@@ -400,7 +405,7 @@ func (c *liveStateCache) getCluster(server string) (clustercache.ClusterCache, e
clustercache.SetClusterResources(cluster.ClusterResources),
clustercache.SetPopulateResourceInfoHandler(func(un *unstructured.Unstructured, isRoot bool) (interface{}, bool) {
res := &ResourceInfo{}
populateNodeInfo(un, res)
populateNodeInfo(un, res, resourceCustomLabels)
c.lock.RLock()
cacheSettings := c.cacheSettings
c.lock.RUnlock()

View File

@@ -6,10 +6,11 @@ import (
"net/url"
"testing"
apierr "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/runtime/schema"
"github.com/stretchr/testify/assert"
"k8s.io/api/core/v1"
apierr "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
"github.com/argoproj/gitops-engine/pkg/cache"
"github.com/argoproj/gitops-engine/pkg/cache/mocks"
@@ -153,3 +154,51 @@ func TestIsRetryableError(t *testing.T) {
assert.True(t, isRetryableError(connectionReset))
})
}
func Test_asResourceNode_owner_refs(t *testing.T) {
resNode := asResourceNode(&cache.Resource{
ResourceVersion: "",
Ref: v1.ObjectReference{
APIVersion: "v1",
},
OwnerRefs: []metav1.OwnerReference{
{
APIVersion: "v1",
Kind: "ConfigMap",
Name: "cm-1",
},
{
APIVersion: "v1",
Kind: "ConfigMap",
Name: "cm-2",
},
},
CreationTimestamp: nil,
Info: nil,
Resource: nil,
})
expected := appv1.ResourceNode{
ResourceRef: appv1.ResourceRef{
Version: "v1",
},
ParentRefs: []appv1.ResourceRef{
{
Group: "",
Kind: "ConfigMap",
Name: "cm-1",
},
{
Group: "",
Kind: "ConfigMap",
Name: "cm-2",
},
},
Info: nil,
NetworkingInfo: nil,
ResourceVersion: "",
Images: nil,
Health: nil,
CreatedAt: nil,
}
assert.Equal(t, expected, resNode)
}

View File

@@ -19,12 +19,21 @@ import (
"github.com/argoproj/argo-cd/v2/util/resource"
)
func populateNodeInfo(un *unstructured.Unstructured, res *ResourceInfo) {
func populateNodeInfo(un *unstructured.Unstructured, res *ResourceInfo, customLabels []string) {
gvk := un.GroupVersionKind()
revision := resource.GetRevision(un)
if revision > 0 {
res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: fmt.Sprintf("Rev:%v", revision)})
}
if len(customLabels) > 0 {
if labels := un.GetLabels(); labels != nil {
for _, customLabel := range customLabels {
if value, ok := labels[customLabel]; ok {
res.Info = append(res.Info, v1alpha1.InfoItem{Name: customLabel, Value: value})
}
}
}
}
switch gvk.Group {
case "":
switch gvk.Kind {

View File

@@ -271,7 +271,7 @@ func TestGetPodInfo(t *testing.T) {
`)
info := &ResourceInfo{}
populateNodeInfo(pod, info)
populateNodeInfo(pod, info, []string{})
assert.Equal(t, []v1alpha1.InfoItem{
{Name: "Node", Value: "minikube"},
{Name: "Containers", Value: "0/1"},
@@ -302,7 +302,7 @@ status:
`)
info := &ResourceInfo{}
populateNodeInfo(node, info)
populateNodeInfo(node, info, []string{})
assert.Equal(t, &NodeInfo{
Name: "minikube",
Capacity: v1.ResourceList{v1.ResourceMemory: resource.MustParse("6091320Ki"), v1.ResourceCPU: resource.MustParse("6")},
@@ -312,7 +312,7 @@ status:
func TestGetServiceInfo(t *testing.T) {
info := &ResourceInfo{}
populateNodeInfo(testService, info)
populateNodeInfo(testService, info, []string{})
assert.Equal(t, 0, len(info.Info))
assert.Equal(t, &v1alpha1.ResourceNetworkingInfo{
TargetLabels: map[string]string{"app": "guestbook"},
@@ -322,7 +322,7 @@ func TestGetServiceInfo(t *testing.T) {
func TestGetLinkAnnotatedServiceInfo(t *testing.T) {
info := &ResourceInfo{}
populateNodeInfo(testLinkAnnotatedService, info)
populateNodeInfo(testLinkAnnotatedService, info, []string{})
assert.Equal(t, 0, len(info.Info))
assert.Equal(t, &v1alpha1.ResourceNetworkingInfo{
TargetLabels: map[string]string{"app": "guestbook"},
@@ -333,7 +333,7 @@ func TestGetLinkAnnotatedServiceInfo(t *testing.T) {
func TestGetIstioVirtualServiceInfo(t *testing.T) {
info := &ResourceInfo{}
populateNodeInfo(testIstioVirtualService, info)
populateNodeInfo(testIstioVirtualService, info, []string{})
assert.Equal(t, 0, len(info.Info))
require.NotNil(t, info.NetworkingInfo)
require.NotNil(t, info.NetworkingInfo.TargetRefs)
@@ -363,7 +363,7 @@ func TestGetIngressInfo(t *testing.T) {
}
for _, tc := range tests {
info := &ResourceInfo{}
populateNodeInfo(tc.Ingress, info)
populateNodeInfo(tc.Ingress, info, []string{})
assert.Equal(t, 0, len(info.Info))
sort.Slice(info.NetworkingInfo.TargetRefs, func(i, j int) bool {
return strings.Compare(info.NetworkingInfo.TargetRefs[j].Name, info.NetworkingInfo.TargetRefs[i].Name) < 0
@@ -388,7 +388,7 @@ func TestGetIngressInfo(t *testing.T) {
func TestGetLinkAnnotatedIngressInfo(t *testing.T) {
info := &ResourceInfo{}
populateNodeInfo(testLinkAnnotatedIngress, info)
populateNodeInfo(testLinkAnnotatedIngress, info, []string{})
assert.Equal(t, 0, len(info.Info))
sort.Slice(info.NetworkingInfo.TargetRefs, func(i, j int) bool {
return strings.Compare(info.NetworkingInfo.TargetRefs[j].Name, info.NetworkingInfo.TargetRefs[i].Name) < 0
@@ -412,7 +412,7 @@ func TestGetLinkAnnotatedIngressInfo(t *testing.T) {
func TestGetIngressInfoWildCardPath(t *testing.T) {
info := &ResourceInfo{}
populateNodeInfo(testIngressWildCardPath, info)
populateNodeInfo(testIngressWildCardPath, info, []string{})
assert.Equal(t, 0, len(info.Info))
sort.Slice(info.NetworkingInfo.TargetRefs, func(i, j int) bool {
return strings.Compare(info.NetworkingInfo.TargetRefs[j].Name, info.NetworkingInfo.TargetRefs[i].Name) < 0
@@ -436,7 +436,7 @@ func TestGetIngressInfoWildCardPath(t *testing.T) {
func TestGetIngressInfoWithoutTls(t *testing.T) {
info := &ResourceInfo{}
populateNodeInfo(testIngressWithoutTls, info)
populateNodeInfo(testIngressWithoutTls, info, []string{})
assert.Equal(t, 0, len(info.Info))
sort.Slice(info.NetworkingInfo.TargetRefs, func(i, j int) bool {
return strings.Compare(info.NetworkingInfo.TargetRefs[j].Name, info.NetworkingInfo.TargetRefs[i].Name) < 0
@@ -481,7 +481,7 @@ func TestGetIngressInfoWithHost(t *testing.T) {
- ip: 107.178.210.11`)
info := &ResourceInfo{}
populateNodeInfo(ingress, info)
populateNodeInfo(ingress, info, []string{})
assert.Equal(t, &v1alpha1.ResourceNetworkingInfo{
Ingress: []v1.LoadBalancerIngress{{IP: "107.178.210.11"}},
@@ -514,7 +514,7 @@ func TestGetIngressInfoNoHost(t *testing.T) {
`)
info := &ResourceInfo{}
populateNodeInfo(ingress, info)
populateNodeInfo(ingress, info, []string{})
assert.Equal(t, &v1alpha1.ResourceNetworkingInfo{
TargetRefs: []v1alpha1.ResourceRef{{
@@ -549,7 +549,7 @@ func TestExternalUrlWithSubPath(t *testing.T) {
- ip: 107.178.210.11`)
info := &ResourceInfo{}
populateNodeInfo(ingress, info)
populateNodeInfo(ingress, info, []string{})
expectedExternalUrls := []string{"https://107.178.210.11/my/sub/path/"}
assert.Equal(t, expectedExternalUrls, info.NetworkingInfo.ExternalURLs)
@@ -585,7 +585,7 @@ func TestExternalUrlWithMultipleSubPaths(t *testing.T) {
- ip: 107.178.210.11`)
info := &ResourceInfo{}
populateNodeInfo(ingress, info)
populateNodeInfo(ingress, info, []string{})
expectedExternalUrls := []string{"https://helm-guestbook.com/my/sub/path/", "https://helm-guestbook.com/my/sub/path/2", "https://helm-guestbook.com"}
actualURLs := info.NetworkingInfo.ExternalURLs
@@ -615,7 +615,7 @@ func TestExternalUrlWithNoSubPath(t *testing.T) {
- ip: 107.178.210.11`)
info := &ResourceInfo{}
populateNodeInfo(ingress, info)
populateNodeInfo(ingress, info, []string{})
expectedExternalUrls := []string{"https://107.178.210.11"}
assert.Equal(t, expectedExternalUrls, info.NetworkingInfo.ExternalURLs)
@@ -643,8 +643,54 @@ func TestExternalUrlWithNetworkingApi(t *testing.T) {
- ip: 107.178.210.11`)
info := &ResourceInfo{}
populateNodeInfo(ingress, info)
populateNodeInfo(ingress, info, []string{})
expectedExternalUrls := []string{"https://107.178.210.11"}
assert.Equal(t, expectedExternalUrls, info.NetworkingInfo.ExternalURLs)
}
func TestCustomLabel(t *testing.T) {
configmap := strToUnstructured(`
apiVersion: v1
kind: ConfigMap
metadata:
name: cm`)
info := &ResourceInfo{}
populateNodeInfo(configmap, info, []string{"my-label"})
assert.Equal(t, 0, len(info.Info))
configmap = strToUnstructured(`
apiVersion: v1
kind: ConfigMap
metadata:
name: cm
labels:
my-label: value`)
info = &ResourceInfo{}
populateNodeInfo(configmap, info, []string{"my-label", "other-label"})
assert.Equal(t, 1, len(info.Info))
assert.Equal(t, "my-label", info.Info[0].Name)
assert.Equal(t, "value", info.Info[0].Value)
configmap = strToUnstructured(`
apiVersion: v1
kind: ConfigMap
metadata:
name: cm
labels:
my-label: value
other-label: value2`)
info = &ResourceInfo{}
populateNodeInfo(configmap, info, []string{"my-label", "other-label"})
assert.Equal(t, 2, len(info.Info))
assert.Equal(t, "my-label", info.Info[0].Name)
assert.Equal(t, "value", info.Info[0].Value)
assert.Equal(t, "other-label", info.Info[1].Name)
assert.Equal(t, "value2", info.Info[1].Value)
}

View File

@@ -117,7 +117,7 @@ func (c *clusterInfoUpdater) updateClusterInfo(cluster appv1.Cluster, info *cach
}
if info != nil {
clusterInfo.ServerVersion = info.K8SVersion
clusterInfo.APIVersions = argo.APIResourcesToStrings(info.APIResources, false)
clusterInfo.APIVersions = argo.APIResourcesToStrings(info.APIResources, true)
if info.LastCacheSyncTime == nil {
clusterInfo.ConnectionState.Status = appv1.ConnectionStatusUnknown
} else if info.SyncError == nil {

View File

@@ -381,7 +381,7 @@ func (c *appCollector) collectApps(ch chan<- prometheus.Metric, app *argoappv1.A
healthStatus = health.HealthStatusUnknown
}
addGauge(descAppInfo, 1, git.NormalizeGitURL(app.Spec.Source.RepoURL), app.Spec.Destination.Server, app.Spec.Destination.Namespace, string(syncStatus), string(healthStatus), operation)
addGauge(descAppInfo, 1, git.NormalizeGitURL(app.Spec.GetSource().RepoURL), app.Spec.Destination.Server, app.Spec.Destination.Namespace, string(syncStatus), string(healthStatus), operation)
if len(c.appLabels) > 0 {
labelValues := []string{}

View File

@@ -62,7 +62,7 @@ type managedResource struct {
// AppStateManager defines methods which allow to compare application spec and actual application state.
type AppStateManager interface {
CompareAppState(app *v1alpha1.Application, project *appv1.AppProject, revision string, source v1alpha1.ApplicationSource, noCache bool, noRevisionCache bool, localObjects []string) *comparisonResult
CompareAppState(app *v1alpha1.Application, project *appv1.AppProject, revisions []string, sources []v1alpha1.ApplicationSource, noCache bool, noRevisionCache bool, localObjects []string, hasMultipleSources bool) *comparisonResult
SyncAppState(app *v1alpha1.Application, state *v1alpha1.OperationState)
}
@@ -75,6 +75,8 @@ type comparisonResult struct {
reconciliationResult sync.ReconciliationResult
diffConfig argodiff.DiffConfig
appSourceType v1alpha1.ApplicationSourceType
// appSourceTypes stores the SourceType for each application source under sources field
appSourceTypes []v1alpha1.ApplicationSourceType
// timings maps phases of comparison to the duration it took to complete (for statistical purposes)
timings map[string]time.Duration
diffResultList *diff.DiffResultList
@@ -105,7 +107,8 @@ type appStateManager struct {
persistResourceHealth bool
}
func (m *appStateManager) getRepoObjs(app *v1alpha1.Application, source v1alpha1.ApplicationSource, appLabelKey, revision string, noCache, noRevisionCache, verifySignature bool, proj *v1alpha1.AppProject) ([]*unstructured.Unstructured, *apiclient.ManifestResponse, error) {
func (m *appStateManager) getRepoObjs(app *v1alpha1.Application, sources []v1alpha1.ApplicationSource, appLabelKey string, revisions []string, noCache, noRevisionCache, verifySignature bool, proj *v1alpha1.AppProject) ([]*unstructured.Unstructured, map[*v1alpha1.ApplicationSource]*apiclient.ManifestResponse, error) {
ts := stats.NewTimingStats()
helmRepos, err := m.db.ListHelmRepositories(context.Background())
if err != nil {
@@ -115,11 +118,7 @@ func (m *appStateManager) getRepoObjs(app *v1alpha1.Application, source v1alpha1
if err != nil {
return nil, nil, err
}
ts.AddCheckpoint("helm_ms")
repo, err := m.db.GetRepository(context.Background(), source.RepoURL)
if err != nil {
return nil, nil, err
}
ts.AddCheckpoint("repo_ms")
helmRepositoryCredentials, err := m.db.GetAllHelmRepositoryCredentials(context.Background())
if err != nil {
@@ -129,15 +128,6 @@ func (m *appStateManager) getRepoObjs(app *v1alpha1.Application, source v1alpha1
if err != nil {
return nil, nil, err
}
conn, repoClient, err := m.repoClientset.NewRepoServerClient()
if err != nil {
return nil, nil, err
}
defer io.Close(conn)
if revision == "" {
revision = source.TargetRevision
}
plugins, err := m.settingsMgr.GetConfigManagementPlugins()
if err != nil {
@@ -158,48 +148,87 @@ func (m *appStateManager) getRepoObjs(app *v1alpha1.Application, source v1alpha1
return nil, nil, err
}
kustomizeOptions, err := kustomizeSettings.GetOptions(app.Spec.Source)
if err != nil {
return nil, nil, err
}
helmOptions, err := m.settingsMgr.GetHelmSettings()
if err != nil {
return nil, nil, err
}
ts.AddCheckpoint("build_options_ms")
serverVersion, apiResources, err := m.liveStateCache.GetVersionsInfo(app.Spec.Destination.Server)
if err != nil {
return nil, nil, err
}
ts.AddCheckpoint("version_ms")
manifestInfo, err := repoClient.GenerateManifest(context.Background(), &apiclient.ManifestRequest{
Repo: repo,
Repos: permittedHelmRepos,
Revision: revision,
NoCache: noCache,
NoRevisionCache: noRevisionCache,
AppLabelKey: appLabelKey,
AppName: app.InstanceName(m.namespace),
Namespace: app.Spec.Destination.Namespace,
ApplicationSource: &source,
Plugins: tools,
KustomizeOptions: kustomizeOptions,
KubeVersion: serverVersion,
ApiVersions: argo.APIResourcesToStrings(apiResources, true),
VerifySignature: verifySignature,
HelmRepoCreds: permittedHelmCredentials,
TrackingMethod: string(argo.GetTrackingMethod(m.settingsMgr)),
EnabledSourceTypes: enabledSourceTypes,
HelmOptions: helmOptions,
})
conn, repoClient, err := m.repoClientset.NewRepoServerClient()
if err != nil {
return nil, nil, err
}
targetObjs, err := unmarshalManifests(manifestInfo.Manifests)
defer io.Close(conn)
manifestInfoMap := make(map[*v1alpha1.ApplicationSource]*apiclient.ManifestResponse)
targetObjs := make([]*unstructured.Unstructured, 0)
// Store the map of all sources having ref field into a map for applications with sources field
refSources, err := argo.GetRefSources(context.Background(), app.Spec, m.db)
if err != nil {
return nil, nil, err
return nil, nil, fmt.Errorf("failed to get ref sources: %v", err)
}
for i, source := range sources {
if len(revisions) < len(sources) || revisions[i] == "" {
revisions[i] = source.TargetRevision
}
ts.AddCheckpoint("helm_ms")
repo, err := m.db.GetRepository(context.Background(), source.RepoURL)
if err != nil {
return nil, nil, err
}
kustomizeOptions, err := kustomizeSettings.GetOptions(source)
if err != nil {
return nil, nil, err
}
ts.AddCheckpoint("version_ms")
log.Debugf("Generating Manifest for source %s revision %s", source, revisions[i])
manifestInfo, err := repoClient.GenerateManifest(context.Background(), &apiclient.ManifestRequest{
Repo: repo,
Repos: permittedHelmRepos,
Revision: revisions[i],
NoCache: noCache,
NoRevisionCache: noRevisionCache,
AppLabelKey: appLabelKey,
AppName: app.InstanceName(m.namespace),
Namespace: app.Spec.Destination.Namespace,
ApplicationSource: &source,
Plugins: tools,
KustomizeOptions: kustomizeOptions,
KubeVersion: serverVersion,
ApiVersions: argo.APIResourcesToStrings(apiResources, true),
VerifySignature: verifySignature,
HelmRepoCreds: permittedHelmCredentials,
TrackingMethod: string(argo.GetTrackingMethod(m.settingsMgr)),
EnabledSourceTypes: enabledSourceTypes,
HelmOptions: helmOptions,
HasMultipleSources: app.Spec.HasMultipleSources(),
RefSources: refSources,
})
if err != nil {
return nil, nil, err
}
// GenerateManifest can return empty ManifestResponse without error if app has multiple sources
// and if any of the source does not have path and chart field not specified.
// In that scenario, we continue to the next source
if app.Spec.HasMultipleSources() && len(manifestInfo.Manifests) == 0 {
continue
}
targetObj, err := unmarshalManifests(manifestInfo.Manifests)
if err != nil {
return nil, nil, err
}
targetObjs = append(targetObjs, targetObj...)
manifestInfoMap[&source] = manifestInfo
}
ts.AddCheckpoint("unmarshal_ms")
@@ -209,7 +238,7 @@ func (m *appStateManager) getRepoObjs(app *v1alpha1.Application, source v1alpha1
}
logCtx = logCtx.WithField("time_ms", time.Since(ts.StartTime).Milliseconds())
logCtx.Info("getRepoObjs stats")
return targetObjs, manifestInfo, nil
return targetObjs, manifestInfoMap, nil
}
func unmarshalManifests(manifests []string) ([]*unstructured.Unstructured, error) {
@@ -325,7 +354,7 @@ func verifyGnuPGSignature(revision string, project *appv1.AppProject, manifestIn
// CompareAppState compares application git state to the live app state, using the specified
// revision and supplied source. If revision or overrides are empty, then compares against
// revision and overrides in the app spec.
func (m *appStateManager) CompareAppState(app *v1alpha1.Application, project *appv1.AppProject, revision string, source v1alpha1.ApplicationSource, noCache bool, noRevisionCache bool, localManifests []string) *comparisonResult {
func (m *appStateManager) CompareAppState(app *v1alpha1.Application, project *appv1.AppProject, revisions []string, sources []v1alpha1.ApplicationSource, noCache bool, noRevisionCache bool, localManifests []string, hasMultipleSources bool) *comparisonResult {
ts := stats.NewTimingStats()
appLabelKey, resourceOverrides, resFilter, err := m.getComparisonSettings()
@@ -333,12 +362,24 @@ func (m *appStateManager) CompareAppState(app *v1alpha1.Application, project *ap
// return unknown comparison result if basic comparison settings cannot be loaded
if err != nil {
return &comparisonResult{
syncStatus: &v1alpha1.SyncStatus{
ComparedTo: appv1.ComparedTo{Source: source, Destination: app.Spec.Destination},
Status: appv1.SyncStatusCodeUnknown,
},
healthStatus: &appv1.HealthStatus{Status: health.HealthStatusUnknown},
if hasMultipleSources {
return &comparisonResult{
syncStatus: &v1alpha1.SyncStatus{
ComparedTo: appv1.ComparedTo{Destination: app.Spec.Destination, Sources: sources},
Status: appv1.SyncStatusCodeUnknown,
Revisions: revisions,
},
healthStatus: &appv1.HealthStatus{Status: health.HealthStatusUnknown},
}
} else {
return &comparisonResult{
syncStatus: &v1alpha1.SyncStatus{
ComparedTo: appv1.ComparedTo{Source: sources[0], Destination: app.Spec.Destination},
Status: appv1.SyncStatusCodeUnknown,
Revision: revisions[0],
},
healthStatus: &appv1.HealthStatus{Status: health.HealthStatusUnknown},
}
}
}
@@ -356,11 +397,21 @@ func (m *appStateManager) CompareAppState(app *v1alpha1.Application, project *ap
logCtx.Infof("Comparing app state (cluster: %s, namespace: %s)", app.Spec.Destination.Server, app.Spec.Destination.Namespace)
var targetObjs []*unstructured.Unstructured
var manifestInfo *apiclient.ManifestResponse
now := metav1.Now()
var manifestInfoMap map[*v1alpha1.ApplicationSource]*apiclient.ManifestResponse
if len(localManifests) == 0 {
targetObjs, manifestInfo, err = m.getRepoObjs(app, source, appLabelKey, revision, noCache, noRevisionCache, verifySignature, project)
// If the length of revisions is not same as the length of sources,
// we take the revisions from the sources directly for all the sources.
if len(revisions) != len(sources) {
revisions = make([]string, 0)
for _, source := range sources {
revisions = append(revisions, source.TargetRevision)
}
}
targetObjs, manifestInfoMap, err = m.getRepoObjs(app, sources, appLabelKey, revisions, noCache, noRevisionCache, verifySignature, project)
if err != nil {
targetObjs = make([]*unstructured.Unstructured, 0)
conditions = append(conditions, v1alpha1.ApplicationCondition{Type: v1alpha1.ApplicationConditionComparisonError, Message: err.Error(), LastTransitionTime: &now})
@@ -382,7 +433,10 @@ func (m *appStateManager) CompareAppState(app *v1alpha1.Application, project *ap
failedToLoadObjs = true
}
}
manifestInfo = nil
// empty out manifestInfoMap
for as := range manifestInfoMap {
delete(manifestInfoMap, as)
}
}
ts.AddCheckpoint("git_ms")
@@ -416,6 +470,7 @@ func (m *appStateManager) CompareAppState(app *v1alpha1.Application, project *ap
conditions = append(conditions, v1alpha1.ApplicationCondition{Type: v1alpha1.ApplicationConditionComparisonError, Message: err.Error(), LastTransitionTime: &now})
failedToLoadObjs = true
}
logCtx.Debugf("Retrieved lived manifests")
// filter out all resources which are not permitted in the application project
@@ -459,10 +514,16 @@ func (m *appStateManager) CompareAppState(app *v1alpha1.Application, project *ap
log.Warnf("Could not get compare options from ConfigMap (assuming defaults): %v", err)
compareOptions = settings.GetDefaultDiffOptions()
}
manifestRevisions := make([]string, 0)
for _, manifestInfo := range manifestInfoMap {
manifestRevisions = append(manifestRevisions, manifestInfo.Revision)
}
// restore comparison using cached diff result if previous comparison was performed for the same revision
revisionChanged := manifestInfo == nil || app.Status.Sync.Revision != manifestInfo.Revision
specChanged := !reflect.DeepEqual(app.Status.Sync.ComparedTo, appv1.ComparedTo{Source: app.Spec.Source, Destination: app.Spec.Destination})
revisionChanged := len(manifestInfoMap) != len(sources) || !reflect.DeepEqual(app.Status.Sync.Revisions, manifestRevisions)
specChanged := !reflect.DeepEqual(app.Status.Sync.ComparedTo, appv1.ComparedTo{Source: app.Spec.GetSource(), Destination: app.Spec.Destination, Sources: sources})
_, refreshRequested := app.IsRefreshRequested()
noCache = noCache || refreshRequested || app.Status.Expired(m.statusRefreshTimeout) || specChanged || revisionChanged
@@ -514,7 +575,7 @@ func (m *appStateManager) CompareAppState(app *v1alpha1.Application, project *ap
}
gvk := obj.GroupVersionKind()
isSelfReferencedObj := m.isSelfReferencedObj(liveObj, appLabelKey, trackingMethod)
isSelfReferencedObj := m.isSelfReferencedObj(liveObj, targetObj, app.GetName(), appLabelKey, trackingMethod)
resState := v1alpha1.ResourceStatus{
Namespace: obj.GetNamespace(),
@@ -591,16 +652,32 @@ func (m *appStateManager) CompareAppState(app *v1alpha1.Application, project *ap
if failedToLoadObjs {
syncCode = v1alpha1.SyncStatusCodeUnknown
}
syncStatus := v1alpha1.SyncStatus{
ComparedTo: appv1.ComparedTo{
Source: source,
Destination: app.Spec.Destination,
},
Status: syncCode,
var revision string
if !hasMultipleSources && len(manifestRevisions) > 0 {
revision = manifestRevisions[0]
}
if manifestInfo != nil {
syncStatus.Revision = manifestInfo.Revision
var syncStatus v1alpha1.SyncStatus
if hasMultipleSources {
syncStatus = v1alpha1.SyncStatus{
ComparedTo: appv1.ComparedTo{
Destination: app.Spec.Destination,
Sources: sources,
},
Status: syncCode,
Revisions: manifestRevisions,
}
} else {
syncStatus = v1alpha1.SyncStatus{
ComparedTo: appv1.ComparedTo{
Destination: app.Spec.Destination,
Source: app.Spec.GetSource(),
},
Status: syncCode,
Revision: revision,
}
}
ts.AddCheckpoint("sync_ms")
healthStatus, err := setApplicationHealth(managedResources, resourceSummaries, resourceOverrides, app, m.persistResourceHealth)
@@ -611,8 +688,10 @@ func (m *appStateManager) CompareAppState(app *v1alpha1.Application, project *ap
// Git has already performed the signature verification via its GPG interface, and the result is available
// in the manifest info received from the repository server. We now need to form our opinion about the result
// and stop processing if we do not agree about the outcome.
if gpg.IsGPGEnabled() && verifySignature && manifestInfo != nil {
conditions = append(conditions, verifyGnuPGSignature(revision, project, manifestInfo)...)
for _, manifestInfo := range manifestInfoMap {
if gpg.IsGPGEnabled() && verifySignature && manifestInfo != nil {
conditions = append(conditions, verifyGnuPGSignature(manifestInfo.Revision, project, manifestInfo)...)
}
}
compRes := comparisonResult{
@@ -624,9 +703,18 @@ func (m *appStateManager) CompareAppState(app *v1alpha1.Application, project *ap
diffConfig: diffConfig,
diffResultList: diffResults,
}
if manifestInfo != nil {
compRes.appSourceType = v1alpha1.ApplicationSourceType(manifestInfo.SourceType)
if hasMultipleSources {
for _, manifestInfo := range manifestInfoMap {
compRes.appSourceTypes = append(compRes.appSourceTypes, appv1.ApplicationSourceType(manifestInfo.SourceType))
}
} else {
for _, manifestInfo := range manifestInfoMap {
compRes.appSourceType = v1alpha1.ApplicationSourceType(manifestInfo.SourceType)
break
}
}
app.Status.SetConditions(conditions, map[appv1.ApplicationConditionType]bool{
appv1.ApplicationConditionComparisonError: true,
appv1.ApplicationConditionSharedResourceWarning: true,
@@ -638,18 +726,29 @@ func (m *appStateManager) CompareAppState(app *v1alpha1.Application, project *ap
return &compRes
}
func (m *appStateManager) persistRevisionHistory(app *v1alpha1.Application, revision string, source v1alpha1.ApplicationSource, startedAt metav1.Time) error {
func (m *appStateManager) persistRevisionHistory(app *v1alpha1.Application, revision string, source v1alpha1.ApplicationSource, revisions []string, sources []v1alpha1.ApplicationSource, hasMultipleSources bool, startedAt metav1.Time) error {
var nextID int64
if len(app.Status.History) > 0 {
nextID = app.Status.History.LastRevisionHistory().ID + 1
}
app.Status.History = append(app.Status.History, v1alpha1.RevisionHistory{
Revision: revision,
DeployedAt: metav1.NewTime(time.Now().UTC()),
DeployStartedAt: &startedAt,
ID: nextID,
Source: source,
})
if hasMultipleSources {
app.Status.History = append(app.Status.History, v1alpha1.RevisionHistory{
DeployedAt: metav1.NewTime(time.Now().UTC()),
DeployStartedAt: &startedAt,
ID: nextID,
Sources: sources,
Revisions: revisions,
})
} else {
app.Status.History = append(app.Status.History, v1alpha1.RevisionHistory{
Revision: revision,
DeployedAt: metav1.NewTime(time.Now().UTC()),
DeployStartedAt: &startedAt,
ID: nextID,
Source: source,
})
}
app.Status.History = app.Status.History.Trunc(app.Spec.GetRevisionHistoryLimit())
@@ -699,12 +798,13 @@ func NewAppStateManager(
}
// isSelfReferencedObj returns whether the given obj is managed by the application
// according to the values in the tracking annotation. It returns true when all
// of the properties in the annotation (name, namespace, group and kind) match
// the properties of the inspected object, or if the tracking method used does
// not provide the required properties for matching.
func (m *appStateManager) isSelfReferencedObj(obj *unstructured.Unstructured, appLabelKey string, trackingMethod v1alpha1.TrackingMethod) bool {
if obj == nil {
// according to the values of the tracking id (aka app instance value) annotation.
// It returns true when all of the properties of the tracking id (app name, namespace,
// group and kind) match the properties of the live object, or if the tracking method
// used does not provide the required properties for matching.
// Reference: https://github.com/argoproj/argo-cd/issues/8683
func (m *appStateManager) isSelfReferencedObj(live, config *unstructured.Unstructured, appName, appLabelKey string, trackingMethod v1alpha1.TrackingMethod) bool {
if live == nil {
return true
}
@@ -714,17 +814,42 @@ func (m *appStateManager) isSelfReferencedObj(obj *unstructured.Unstructured, ap
return true
}
// In order for us to assume obj to be managed by this application, the
// values from the annotation have to match the properties from the live
// object. Cluster scoped objects carry the app's destination namespace
// in the tracking annotation, but are unique in GVK + name combination.
appInstance := m.resourceTracking.GetAppInstance(obj, appLabelKey, trackingMethod)
if appInstance != nil {
return (obj.GetNamespace() == appInstance.Namespace || obj.GetNamespace() == "") &&
obj.GetName() == appInstance.Name &&
obj.GetObjectKind().GroupVersionKind().Group == appInstance.Group &&
obj.GetObjectKind().GroupVersionKind().Kind == appInstance.Kind
// config != nil is the best-case scenario for constructing an accurate
// Tracking ID. `config` is the "desired state" (from git/helm/etc.).
// Using the desired state is important when there is an ApiGroup upgrade.
// When upgrading, the comparison must be made with the new tracking ID.
// Example:
// live resource annotation will be:
// ingress-app:extensions/Ingress:default/some-ingress
// when it should be:
// ingress-app:networking.k8s.io/Ingress:default/some-ingress
// More details in: https://github.com/argoproj/argo-cd/pull/11012
var aiv argo.AppInstanceValue
if config != nil {
aiv = argo.UnstructuredToAppInstanceValue(config, appName, "")
return isSelfReferencedObj(live, aiv)
}
// If config is nil then compare the live resource with the value
// of the annotation. In this case, in order to validate if obj is
// managed by this application, the values from the annotation have
// to match the properties from the live object. Cluster scoped objects
// carry the app's destination namespace in the tracking annotation,
// but are unique in GVK + name combination.
appInstance := m.resourceTracking.GetAppInstance(live, appLabelKey, trackingMethod)
if appInstance != nil {
return isSelfReferencedObj(live, *appInstance)
}
return true
}
// isSelfReferencedObj returns true if the given Tracking ID (`aiv`) matches
// the given object. It returns false when the ID doesn't match. This sometimes
// happens when a tracking label or annotation gets accidentally copied to a
// different resource.
func isSelfReferencedObj(obj *unstructured.Unstructured, aiv argo.AppInstanceValue) bool {
return (obj.GetNamespace() == aiv.Namespace || obj.GetNamespace() == "") &&
obj.GetName() == aiv.Name &&
obj.GetObjectKind().GroupVersionKind().Group == aiv.Group &&
obj.GetObjectKind().GroupVersionKind().Kind == aiv.Kind
}

View File

@@ -13,6 +13,7 @@ import (
"github.com/stretchr/testify/assert"
v1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
networkingv1 "k8s.io/api/networking/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
@@ -37,7 +38,11 @@ func TestCompareAppStateEmpty(t *testing.T) {
managedLiveObjs: make(map[kube.ResourceKey]*unstructured.Unstructured),
}
ctrl := newFakeController(&data)
compRes := ctrl.appStateManager.CompareAppState(app, &defaultProj, "", app.Spec.Source, false, false, nil)
sources := make([]argoappv1.ApplicationSource, 0)
sources = append(sources, app.Spec.GetSource())
revisions := make([]string, 0)
revisions = append(revisions, "")
compRes := ctrl.appStateManager.CompareAppState(app, &defaultProj, revisions, sources, false, false, nil, false)
assert.NotNil(t, compRes)
assert.NotNil(t, compRes.syncStatus)
assert.Equal(t, argoappv1.SyncStatusCodeSynced, compRes.syncStatus.Status)
@@ -60,7 +65,11 @@ func TestCompareAppStateMissing(t *testing.T) {
managedLiveObjs: make(map[kube.ResourceKey]*unstructured.Unstructured),
}
ctrl := newFakeController(&data)
compRes := ctrl.appStateManager.CompareAppState(app, &defaultProj, "", app.Spec.Source, false, false, nil)
sources := make([]argoappv1.ApplicationSource, 0)
sources = append(sources, app.Spec.GetSource())
revisions := make([]string, 0)
revisions = append(revisions, "")
compRes := ctrl.appStateManager.CompareAppState(app, &defaultProj, revisions, sources, false, false, nil, false)
assert.NotNil(t, compRes)
assert.NotNil(t, compRes.syncStatus)
assert.Equal(t, argoappv1.SyncStatusCodeOutOfSync, compRes.syncStatus.Status)
@@ -87,7 +96,11 @@ func TestCompareAppStateExtra(t *testing.T) {
},
}
ctrl := newFakeController(&data)
compRes := ctrl.appStateManager.CompareAppState(app, &defaultProj, "", app.Spec.Source, false, false, nil)
sources := make([]argoappv1.ApplicationSource, 0)
sources = append(sources, app.Spec.GetSource())
revisions := make([]string, 0)
revisions = append(revisions, "")
compRes := ctrl.appStateManager.CompareAppState(app, &defaultProj, revisions, sources, false, false, nil, false)
assert.NotNil(t, compRes)
assert.Equal(t, argoappv1.SyncStatusCodeOutOfSync, compRes.syncStatus.Status)
assert.Equal(t, 1, len(compRes.resources))
@@ -113,7 +126,11 @@ func TestCompareAppStateHook(t *testing.T) {
managedLiveObjs: make(map[kube.ResourceKey]*unstructured.Unstructured),
}
ctrl := newFakeController(&data)
compRes := ctrl.appStateManager.CompareAppState(app, &defaultProj, "", app.Spec.Source, false, false, nil)
sources := make([]argoappv1.ApplicationSource, 0)
sources = append(sources, app.Spec.GetSource())
revisions := make([]string, 0)
revisions = append(revisions, "")
compRes := ctrl.appStateManager.CompareAppState(app, &defaultProj, revisions, sources, false, false, nil, false)
assert.NotNil(t, compRes)
assert.Equal(t, argoappv1.SyncStatusCodeSynced, compRes.syncStatus.Status)
assert.Equal(t, 0, len(compRes.resources))
@@ -140,7 +157,11 @@ func TestCompareAppStateSkipHook(t *testing.T) {
managedLiveObjs: make(map[kube.ResourceKey]*unstructured.Unstructured),
}
ctrl := newFakeController(&data)
compRes := ctrl.appStateManager.CompareAppState(app, &defaultProj, "", app.Spec.Source, false, false, nil)
sources := make([]argoappv1.ApplicationSource, 0)
sources = append(sources, app.Spec.GetSource())
revisions := make([]string, 0)
revisions = append(revisions, "")
compRes := ctrl.appStateManager.CompareAppState(app, &defaultProj, revisions, sources, false, false, nil, false)
assert.NotNil(t, compRes)
assert.Equal(t, argoappv1.SyncStatusCodeSynced, compRes.syncStatus.Status)
assert.Equal(t, 1, len(compRes.resources))
@@ -166,7 +187,11 @@ func TestCompareAppStateCompareOptionIgnoreExtraneous(t *testing.T) {
}
ctrl := newFakeController(&data)
compRes := ctrl.appStateManager.CompareAppState(app, &defaultProj, "", app.Spec.Source, false, false, nil)
sources := make([]argoappv1.ApplicationSource, 0)
sources = append(sources, app.Spec.GetSource())
revisions := make([]string, 0)
revisions = append(revisions, "")
compRes := ctrl.appStateManager.CompareAppState(app, &defaultProj, revisions, sources, false, false, nil, false)
assert.NotNil(t, compRes)
assert.Equal(t, argoappv1.SyncStatusCodeSynced, compRes.syncStatus.Status)
@@ -194,7 +219,11 @@ func TestCompareAppStateExtraHook(t *testing.T) {
},
}
ctrl := newFakeController(&data)
compRes := ctrl.appStateManager.CompareAppState(app, &defaultProj, "", app.Spec.Source, false, false, nil)
sources := make([]argoappv1.ApplicationSource, 0)
sources = append(sources, app.Spec.GetSource())
revisions := make([]string, 0)
revisions = append(revisions, "")
compRes := ctrl.appStateManager.CompareAppState(app, &defaultProj, revisions, sources, false, false, nil, false)
assert.NotNil(t, compRes)
assert.Equal(t, argoappv1.SyncStatusCodeSynced, compRes.syncStatus.Status)
@@ -237,7 +266,11 @@ func TestCompareAppStateDuplicatedNamespacedResources(t *testing.T) {
},
}
ctrl := newFakeController(&data)
compRes := ctrl.appStateManager.CompareAppState(app, &defaultProj, "", app.Spec.Source, false, false, nil)
sources := make([]argoappv1.ApplicationSource, 0)
sources = append(sources, app.Spec.GetSource())
revisions := make([]string, 0)
revisions = append(revisions, "")
compRes := ctrl.appStateManager.CompareAppState(app, &defaultProj, revisions, sources, false, false, nil, false)
assert.NotNil(t, compRes)
assert.Equal(t, 1, len(app.Status.Conditions))
@@ -288,7 +321,11 @@ func TestSetHealth(t *testing.T) {
},
})
compRes := ctrl.appStateManager.CompareAppState(app, &defaultProj, "", app.Spec.Source, false, false, nil)
sources := make([]argoappv1.ApplicationSource, 0)
sources = append(sources, app.Spec.GetSource())
revisions := make([]string, 0)
revisions = append(revisions, "")
compRes := ctrl.appStateManager.CompareAppState(app, &defaultProj, revisions, sources, false, false, nil, false)
assert.Equal(t, health.HealthStatusHealthy, compRes.healthStatus.Status)
}
@@ -320,7 +357,11 @@ func TestSetHealthSelfReferencedApp(t *testing.T) {
},
})
compRes := ctrl.appStateManager.CompareAppState(app, &defaultProj, "", app.Spec.Source, false, false, nil)
sources := make([]argoappv1.ApplicationSource, 0)
sources = append(sources, app.Spec.GetSource())
revisions := make([]string, 0)
revisions = append(revisions, "")
compRes := ctrl.appStateManager.CompareAppState(app, &defaultProj, revisions, sources, false, false, nil, false)
assert.Equal(t, health.HealthStatusHealthy, compRes.healthStatus.Status)
}
@@ -390,7 +431,11 @@ func TestReturnUnknownComparisonStateOnSettingLoadError(t *testing.T) {
},
})
compRes := ctrl.appStateManager.CompareAppState(app, &defaultProj, "", app.Spec.Source, false, false, nil)
sources := make([]argoappv1.ApplicationSource, 0)
sources = append(sources, app.Spec.GetSource())
revisions := make([]string, 0)
revisions = append(revisions, "")
compRes := ctrl.appStateManager.CompareAppState(app, &defaultProj, revisions, sources, false, false, nil, false)
assert.Equal(t, health.HealthStatusUnknown, compRes.healthStatus.Status)
assert.Equal(t, argoappv1.SyncStatusCodeUnknown, compRes.syncStatus.Status)
@@ -437,7 +482,7 @@ func Test_appStateManager_persistRevisionHistory(t *testing.T) {
app.Spec.RevisionHistoryLimit = &i
}
addHistory := func() {
err := manager.persistRevisionHistory(app, "my-revision", argoappv1.ApplicationSource{}, metav1.Time{})
err := manager.persistRevisionHistory(app, "my-revision", argoappv1.ApplicationSource{}, []string{}, []argoappv1.ApplicationSource{}, false, metav1.Time{})
assert.NoError(t, err)
}
addHistory()
@@ -473,7 +518,7 @@ func Test_appStateManager_persistRevisionHistory(t *testing.T) {
assert.Len(t, app.Status.History, 9)
metav1NowTime := metav1.NewTime(time.Now())
err := manager.persistRevisionHistory(app, "my-revision", argoappv1.ApplicationSource{}, metav1NowTime)
err := manager.persistRevisionHistory(app, "my-revision", argoappv1.ApplicationSource{}, []string{}, []argoappv1.ApplicationSource{}, false, metav1NowTime)
assert.NoError(t, err)
assert.Equal(t, app.Status.History.LastRevisionHistory().DeployStartedAt, &metav1NowTime)
}
@@ -527,7 +572,11 @@ func TestSignedResponseNoSignatureRequired(t *testing.T) {
managedLiveObjs: make(map[kube.ResourceKey]*unstructured.Unstructured),
}
ctrl := newFakeController(&data)
compRes := ctrl.appStateManager.CompareAppState(app, &defaultProj, "", app.Spec.Source, false, false, nil)
sources := make([]argoappv1.ApplicationSource, 0)
sources = append(sources, app.Spec.GetSource())
revisions := make([]string, 0)
revisions = append(revisions, "")
compRes := ctrl.appStateManager.CompareAppState(app, &defaultProj, revisions, sources, false, false, nil, false)
assert.NotNil(t, compRes)
assert.NotNil(t, compRes.syncStatus)
assert.Equal(t, argoappv1.SyncStatusCodeSynced, compRes.syncStatus.Status)
@@ -549,7 +598,11 @@ func TestSignedResponseNoSignatureRequired(t *testing.T) {
managedLiveObjs: make(map[kube.ResourceKey]*unstructured.Unstructured),
}
ctrl := newFakeController(&data)
compRes := ctrl.appStateManager.CompareAppState(app, &defaultProj, "", app.Spec.Source, false, false, nil)
sources := make([]argoappv1.ApplicationSource, 0)
sources = append(sources, app.Spec.GetSource())
revisions := make([]string, 0)
revisions = append(revisions, "")
compRes := ctrl.appStateManager.CompareAppState(app, &defaultProj, revisions, sources, false, false, nil, false)
assert.NotNil(t, compRes)
assert.NotNil(t, compRes.syncStatus)
assert.Equal(t, argoappv1.SyncStatusCodeSynced, compRes.syncStatus.Status)
@@ -578,7 +631,11 @@ func TestSignedResponseSignatureRequired(t *testing.T) {
managedLiveObjs: make(map[kube.ResourceKey]*unstructured.Unstructured),
}
ctrl := newFakeController(&data)
compRes := ctrl.appStateManager.CompareAppState(app, &signedProj, "", app.Spec.Source, false, false, nil)
sources := make([]argoappv1.ApplicationSource, 0)
sources = append(sources, app.Spec.GetSource())
revisions := make([]string, 0)
revisions = append(revisions, "")
compRes := ctrl.appStateManager.CompareAppState(app, &signedProj, revisions, sources, false, false, nil, false)
assert.NotNil(t, compRes)
assert.NotNil(t, compRes.syncStatus)
assert.Equal(t, argoappv1.SyncStatusCodeSynced, compRes.syncStatus.Status)
@@ -600,7 +657,11 @@ func TestSignedResponseSignatureRequired(t *testing.T) {
managedLiveObjs: make(map[kube.ResourceKey]*unstructured.Unstructured),
}
ctrl := newFakeController(&data)
compRes := ctrl.appStateManager.CompareAppState(app, &signedProj, "abc123", app.Spec.Source, false, false, nil)
sources := make([]argoappv1.ApplicationSource, 0)
sources = append(sources, app.Spec.GetSource())
revisions := make([]string, 0)
revisions = append(revisions, "abc123")
compRes := ctrl.appStateManager.CompareAppState(app, &signedProj, revisions, sources, false, false, nil, false)
assert.NotNil(t, compRes)
assert.NotNil(t, compRes.syncStatus)
assert.Equal(t, argoappv1.SyncStatusCodeSynced, compRes.syncStatus.Status)
@@ -622,7 +683,11 @@ func TestSignedResponseSignatureRequired(t *testing.T) {
managedLiveObjs: make(map[kube.ResourceKey]*unstructured.Unstructured),
}
ctrl := newFakeController(&data)
compRes := ctrl.appStateManager.CompareAppState(app, &signedProj, "abc123", app.Spec.Source, false, false, nil)
sources := make([]argoappv1.ApplicationSource, 0)
sources = append(sources, app.Spec.GetSource())
revisions := make([]string, 0)
revisions = append(revisions, "abc123")
compRes := ctrl.appStateManager.CompareAppState(app, &signedProj, revisions, sources, false, false, nil, false)
assert.NotNil(t, compRes)
assert.NotNil(t, compRes.syncStatus)
assert.Equal(t, argoappv1.SyncStatusCodeSynced, compRes.syncStatus.Status)
@@ -644,7 +709,11 @@ func TestSignedResponseSignatureRequired(t *testing.T) {
managedLiveObjs: make(map[kube.ResourceKey]*unstructured.Unstructured),
}
ctrl := newFakeController(&data)
compRes := ctrl.appStateManager.CompareAppState(app, &signedProj, "abc123", app.Spec.Source, false, false, nil)
sources := make([]argoappv1.ApplicationSource, 0)
sources = append(sources, app.Spec.GetSource())
revisions := make([]string, 0)
revisions = append(revisions, "abc123")
compRes := ctrl.appStateManager.CompareAppState(app, &signedProj, revisions, sources, false, false, nil, false)
assert.NotNil(t, compRes)
assert.NotNil(t, compRes.syncStatus)
assert.Equal(t, argoappv1.SyncStatusCodeSynced, compRes.syncStatus.Status)
@@ -669,7 +738,11 @@ func TestSignedResponseSignatureRequired(t *testing.T) {
ctrl := newFakeController(&data)
testProj := signedProj
testProj.Spec.SignatureKeys[0].KeyID = "4AEE18F83AFDEB24"
compRes := ctrl.appStateManager.CompareAppState(app, &testProj, "abc123", app.Spec.Source, false, false, nil)
sources := make([]argoappv1.ApplicationSource, 0)
sources = append(sources, app.Spec.GetSource())
revisions := make([]string, 0)
revisions = append(revisions, "abc123")
compRes := ctrl.appStateManager.CompareAppState(app, &testProj, revisions, sources, false, false, nil, false)
assert.NotNil(t, compRes)
assert.NotNil(t, compRes.syncStatus)
assert.Equal(t, argoappv1.SyncStatusCodeSynced, compRes.syncStatus.Status)
@@ -694,7 +767,11 @@ func TestSignedResponseSignatureRequired(t *testing.T) {
// it doesn't matter for our test whether local manifests are valid
localManifests := []string{"foobar"}
ctrl := newFakeController(&data)
compRes := ctrl.appStateManager.CompareAppState(app, &signedProj, "abc123", app.Spec.Source, false, false, localManifests)
sources := make([]argoappv1.ApplicationSource, 0)
sources = append(sources, app.Spec.GetSource())
revisions := make([]string, 0)
revisions = append(revisions, "abc123")
compRes := ctrl.appStateManager.CompareAppState(app, &signedProj, revisions, sources, false, false, localManifests, false)
assert.NotNil(t, compRes)
assert.NotNil(t, compRes.syncStatus)
assert.Equal(t, argoappv1.SyncStatusCodeUnknown, compRes.syncStatus.Status)
@@ -719,7 +796,11 @@ func TestSignedResponseSignatureRequired(t *testing.T) {
managedLiveObjs: make(map[kube.ResourceKey]*unstructured.Unstructured),
}
ctrl := newFakeController(&data)
compRes := ctrl.appStateManager.CompareAppState(app, &signedProj, "abc123", app.Spec.Source, false, false, nil)
sources := make([]argoappv1.ApplicationSource, 0)
sources = append(sources, app.Spec.GetSource())
revisions := make([]string, 0)
revisions = append(revisions, "abc123")
compRes := ctrl.appStateManager.CompareAppState(app, &signedProj, revisions, sources, false, false, nil, false)
assert.NotNil(t, compRes)
assert.NotNil(t, compRes.syncStatus)
assert.Equal(t, argoappv1.SyncStatusCodeSynced, compRes.syncStatus.Status)
@@ -728,7 +809,7 @@ func TestSignedResponseSignatureRequired(t *testing.T) {
assert.Len(t, app.Status.Conditions, 0)
}
// Signature required and local manifests supplied and GPG subystem is disabled - sync
// Signature required and local manifests supplied and GPG subsystem is disabled - sync
{
app := newFakeApp()
data := fakeData{
@@ -744,7 +825,11 @@ func TestSignedResponseSignatureRequired(t *testing.T) {
// it doesn't matter for our test whether local manifests are valid
localManifests := []string{""}
ctrl := newFakeController(&data)
compRes := ctrl.appStateManager.CompareAppState(app, &signedProj, "abc123", app.Spec.Source, false, false, localManifests)
sources := make([]argoappv1.ApplicationSource, 0)
sources = append(sources, app.Spec.GetSource())
revisions := make([]string, 0)
revisions = append(revisions, "abc123")
compRes := ctrl.appStateManager.CompareAppState(app, &signedProj, revisions, sources, false, false, localManifests, false)
assert.NotNil(t, compRes)
assert.NotNil(t, compRes.syncStatus)
assert.Equal(t, argoappv1.SyncStatusCodeSynced, compRes.syncStatus.Status)
@@ -852,6 +937,19 @@ func TestIsLiveResourceManaged(t *testing.T) {
},
},
})
managedWrongAPIGroup := kube.MustToUnstructured(&networkingv1.Ingress{
TypeMeta: metav1.TypeMeta{
APIVersion: "networking.k8s.io/v1",
Kind: "Ingress",
},
ObjectMeta: metav1.ObjectMeta{
Name: "some-ingress",
Namespace: "default",
Annotations: map[string]string{
common.AnnotationKeyAppInstance: "guestbook:extensions/Ingress:default/some-ingress",
},
},
})
ctrl := newFakeController(&fakeData{
apps: []runtime.Object{app, &defaultProj},
manifestResponse: &apiclient.ManifestResponse{
@@ -870,30 +968,69 @@ func TestIsLiveResourceManaged(t *testing.T) {
})
manager := ctrl.appStateManager.(*appStateManager)
appName := "guestbook"
// Managed resource w/ annotations
assert.True(t, manager.isSelfReferencedObj(managedObj, common.AnnotationKeyAppInstance, argo.TrackingMethodLabel))
assert.True(t, manager.isSelfReferencedObj(managedObj, common.AnnotationKeyAppInstance, argo.TrackingMethodAnnotation))
t.Run("will return true if trackingid matches the resource", func(t *testing.T) {
// given
t.Parallel()
configObj := managedObj.DeepCopy()
// Managed resource w/ label
assert.True(t, manager.isSelfReferencedObj(managedObjWithLabel, common.AnnotationKeyAppInstance, argo.TrackingMethodLabel))
// then
assert.True(t, manager.isSelfReferencedObj(managedObj, configObj, appName, common.AnnotationKeyAppInstance, argo.TrackingMethodLabel))
assert.True(t, manager.isSelfReferencedObj(managedObj, configObj, appName, common.AnnotationKeyAppInstance, argo.TrackingMethodAnnotation))
})
t.Run("will return true if tracked with label", func(t *testing.T) {
// given
t.Parallel()
configObj := managedObjWithLabel.DeepCopy()
// Wrong resource name
assert.True(t, manager.isSelfReferencedObj(unmanagedObjWrongName, common.AnnotationKeyAppInstance, argo.TrackingMethodLabel))
assert.False(t, manager.isSelfReferencedObj(unmanagedObjWrongName, common.AnnotationKeyAppInstance, argo.TrackingMethodAnnotation))
// then
assert.True(t, manager.isSelfReferencedObj(managedObjWithLabel, configObj, appName, common.AnnotationKeyAppInstance, argo.TrackingMethodLabel))
})
t.Run("will handle if trackingId has wrong resource name and config is nil", func(t *testing.T) {
// given
t.Parallel()
// Wrong resource group
assert.True(t, manager.isSelfReferencedObj(unmanagedObjWrongGroup, common.AnnotationKeyAppInstance, argo.TrackingMethodLabel))
assert.False(t, manager.isSelfReferencedObj(unmanagedObjWrongGroup, common.AnnotationKeyAppInstance, argo.TrackingMethodAnnotation))
// then
assert.True(t, manager.isSelfReferencedObj(unmanagedObjWrongName, nil, appName, common.AnnotationKeyAppInstance, argo.TrackingMethodLabel))
assert.False(t, manager.isSelfReferencedObj(unmanagedObjWrongName, nil, appName, common.AnnotationKeyAppInstance, argo.TrackingMethodAnnotation))
})
t.Run("will handle if trackingId has wrong resource group and config is nil", func(t *testing.T) {
// given
t.Parallel()
// Wrong resource kind
assert.True(t, manager.isSelfReferencedObj(unmanagedObjWrongKind, common.AnnotationKeyAppInstance, argo.TrackingMethodLabel))
assert.False(t, manager.isSelfReferencedObj(unmanagedObjWrongKind, common.AnnotationKeyAppInstance, argo.TrackingMethodAnnotation))
// then
assert.True(t, manager.isSelfReferencedObj(unmanagedObjWrongGroup, nil, appName, common.AnnotationKeyAppInstance, argo.TrackingMethodLabel))
assert.False(t, manager.isSelfReferencedObj(unmanagedObjWrongGroup, nil, appName, common.AnnotationKeyAppInstance, argo.TrackingMethodAnnotation))
})
t.Run("will handle if trackingId has wrong kind and config is nil", func(t *testing.T) {
// given
t.Parallel()
// Wrong resource namespace
assert.True(t, manager.isSelfReferencedObj(unmanagedObjWrongNamespace, common.AnnotationKeyAppInstance, argo.TrackingMethodLabel))
assert.False(t, manager.isSelfReferencedObj(unmanagedObjWrongNamespace, common.AnnotationKeyAppInstance, argo.TrackingMethodAnnotationAndLabel))
// then
assert.True(t, manager.isSelfReferencedObj(unmanagedObjWrongKind, nil, appName, common.AnnotationKeyAppInstance, argo.TrackingMethodLabel))
assert.False(t, manager.isSelfReferencedObj(unmanagedObjWrongKind, nil, appName, common.AnnotationKeyAppInstance, argo.TrackingMethodAnnotation))
})
t.Run("will handle if trackingId has wrong namespace and config is nil", func(t *testing.T) {
// given
t.Parallel()
// Nil resource
assert.True(t, manager.isSelfReferencedObj(nil, common.AnnotationKeyAppInstance, argo.TrackingMethodAnnotation))
// then
assert.True(t, manager.isSelfReferencedObj(unmanagedObjWrongNamespace, nil, appName, common.AnnotationKeyAppInstance, argo.TrackingMethodLabel))
assert.False(t, manager.isSelfReferencedObj(unmanagedObjWrongNamespace, nil, appName, common.AnnotationKeyAppInstance, argo.TrackingMethodAnnotationAndLabel))
})
t.Run("will return true if live is nil", func(t *testing.T) {
t.Parallel()
assert.True(t, manager.isSelfReferencedObj(nil, nil, appName, common.AnnotationKeyAppInstance, argo.TrackingMethodAnnotation))
})
t.Run("will handle upgrade in desired state APIGroup", func(t *testing.T) {
// given
t.Parallel()
config := managedWrongAPIGroup.DeepCopy()
delete(config.GetAnnotations(), common.AnnotationKeyAppInstance)
// then
assert.True(t, manager.isSelfReferencedObj(managedWrongAPIGroup, config, appName, common.AnnotationKeyAppInstance, argo.TrackingMethodAnnotation))
})
}

View File

@@ -9,6 +9,8 @@ import (
"sync/atomic"
"time"
cdcommon "github.com/argoproj/argo-cd/v2/common"
"github.com/argoproj/gitops-engine/pkg/sync"
"github.com/argoproj/gitops-engine/pkg/sync/common"
"github.com/argoproj/gitops-engine/pkg/utils/kube"
@@ -20,7 +22,6 @@ import (
"k8s.io/apimachinery/pkg/util/managedfields"
"k8s.io/kubectl/pkg/util/openapi"
cdcommon "github.com/argoproj/argo-cd/v2/common"
"github.com/argoproj/argo-cd/v2/controller/metrics"
"github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
listersv1alpha1 "github.com/argoproj/argo-cd/v2/pkg/client/listers/application/v1alpha1"
@@ -65,6 +66,8 @@ func (m *appStateManager) SyncAppState(app *v1alpha1.Application, state *v1alpha
var syncOp v1alpha1.SyncOperation
var syncRes *v1alpha1.SyncOperationResult
var source v1alpha1.ApplicationSource
var sources []v1alpha1.ApplicationSource
revisions := make([]string, 0)
if state.Operation.Sync == nil {
state.Phase = common.OperationFailed
@@ -82,31 +85,53 @@ func (m *appStateManager) SyncAppState(app *v1alpha1.Application, state *v1alpha
return
}
if syncOp.Source == nil {
// normal sync case (where source is taken from app.spec.source)
source = app.Spec.Source
if syncOp.Source == nil || (syncOp.Sources != nil && len(syncOp.Sources) > 0) {
// normal sync case (where source is taken from app.spec.sources)
if app.Spec.HasMultipleSources() {
sources = app.Spec.Sources
} else {
// normal sync case (where source is taken from app.spec.source)
source = app.Spec.GetSource()
sources = make([]v1alpha1.ApplicationSource, 0)
}
} else {
// rollback case
source = *state.Operation.Sync.Source
if app.Spec.HasMultipleSources() {
sources = state.Operation.Sync.Sources
} else {
source = *state.Operation.Sync.Source
sources = make([]v1alpha1.ApplicationSource, 0)
}
}
if state.SyncResult != nil {
syncRes = state.SyncResult
revision = state.SyncResult.Revision
revisions = append(revisions, state.SyncResult.Revisions...)
} else {
syncRes = &v1alpha1.SyncOperationResult{}
// status.operationState.syncResult.source. must be set properly since auto-sync relies
// on this information to decide if it should sync (if source is different than the last
// sync attempt)
syncRes.Source = source
if app.Spec.HasMultipleSources() {
syncRes.Sources = sources
} else {
syncRes.Source = source
}
state.SyncResult = syncRes
}
if revision == "" {
// if we get here, it means we did not remember a commit SHA which we should be syncing to.
// This typically indicates we are just about to begin a brand new sync/rollback operation.
// Take the value in the requested operation. We will resolve this to a SHA later.
revision = syncOp.Revision
// if we get here, it means we did not remember a commit SHA which we should be syncing to.
// This typically indicates we are just about to begin a brand new sync/rollback operation.
// Take the value in the requested operation. We will resolve this to a SHA later.
if app.Spec.HasMultipleSources() {
if len(revisions) != len(sources) {
revisions = syncOp.Revisions
}
} else {
if revision == "" {
revision = syncOp.Revision
}
}
proj, err := argo.GetAppProject(app, listersv1alpha1.NewAppProjectLister(m.projInformer.GetIndexer()), m.namespace, m.settingsMgr, m.db, context.TODO())
@@ -116,10 +141,23 @@ func (m *appStateManager) SyncAppState(app *v1alpha1.Application, state *v1alpha
return
}
compareResult := m.CompareAppState(app, proj, revision, source, false, true, syncOp.Manifests)
if app.Spec.HasMultipleSources() {
revisions = syncRes.Revisions
} else {
revisions = append(revisions, revision)
}
if !app.Spec.HasMultipleSources() {
sources = []v1alpha1.ApplicationSource{source}
revisions = []string{revision}
}
compareResult := m.CompareAppState(app, proj, revisions, sources, false, true, syncOp.Manifests, app.Spec.HasMultipleSources())
// We now have a concrete commit SHA. Save this in the sync result revision so that we remember
// what we should be syncing to when resuming operations.
syncRes.Revision = compareResult.syncStatus.Revision
syncRes.Revisions = compareResult.syncStatus.Revisions
// If there are any comparison or spec errors error conditions do not perform the operation
if errConditions := app.Status.GetConditions(map[v1alpha1.ApplicationConditionType]bool{
@@ -212,14 +250,7 @@ func (m *appStateManager) SyncAppState(app *v1alpha1.Application, state *v1alpha
}
trackingMethod := argo.GetTrackingMethod(m.settingsMgr)
syncCtx, cleanup, err := sync.NewSyncContext(
compareResult.syncStatus.Revision,
reconciliationResult,
restConfig,
rawConfig,
m.kubectl,
app.Spec.Destination.Namespace,
openAPISchema,
opts := []sync.SyncOpt{
sync.WithLogr(logutils.NewLogrusLogger(logEntry)),
sync.WithHealthOverride(lua.ResourceHealthOverrides(resourceOverrides)),
sync.WithPermissionValidator(func(un *unstructured.Unstructured, res *v1.APIResource) error {
@@ -246,16 +277,9 @@ func (m *appStateManager) SyncAppState(app *v1alpha1.Application, state *v1alpha
sync.WithResourcesFilter(func(key kube.ResourceKey, target *unstructured.Unstructured, live *unstructured.Unstructured) bool {
return (len(syncOp.Resources) == 0 ||
argo.ContainsSyncResource(key.Name, key.Namespace, schema.GroupVersionKind{Kind: key.Kind, Group: key.Group}, syncOp.Resources)) &&
m.isSelfReferencedObj(live, appLabelKey, trackingMethod)
m.isSelfReferencedObj(live, target, app.GetName(), appLabelKey, trackingMethod)
}),
sync.WithManifestValidation(!syncOp.SyncOptions.HasOption(common.SyncOptionsDisableValidation)),
sync.WithNamespaceCreation(syncOp.SyncOptions.HasOption("CreateNamespace=true"), func(un *unstructured.Unstructured) bool {
if un != nil && kube.GetAppInstanceLabel(un, cdcommon.LabelKeyAppInstance) != "" {
kube.UnsetLabel(un, cdcommon.LabelKeyAppInstance)
return true
}
return false
}),
sync.WithSyncWaveHook(delayBetweenSyncWaves),
sync.WithPruneLast(syncOp.SyncOptions.HasOption(common.SyncOptionPruneLast)),
sync.WithResourceModificationChecker(syncOp.SyncOptions.HasOption("ApplyOutOfSyncOnly=true"), compareResult.diffResultList),
@@ -263,6 +287,21 @@ func (m *appStateManager) SyncAppState(app *v1alpha1.Application, state *v1alpha
sync.WithReplace(syncOp.SyncOptions.HasOption(common.SyncOptionReplace)),
sync.WithServerSideApply(syncOp.SyncOptions.HasOption(common.SyncOptionServerSideApply)),
sync.WithServerSideApplyManager(cdcommon.ArgoCDSSAManager),
}
if syncOp.SyncOptions.HasOption("CreateNamespace=true") {
opts = append(opts, sync.WithNamespaceModifier(syncNamespace(m.resourceTracking, appLabelKey, trackingMethod, app.Name, app.Spec.SyncPolicy)))
}
syncCtx, cleanup, err := sync.NewSyncContext(
compareResult.syncStatus.Revision,
reconciliationResult,
restConfig,
rawConfig,
m.kubectl,
app.Spec.Destination.Namespace,
openAPISchema,
opts...,
)
if err != nil {
@@ -301,7 +340,7 @@ func (m *appStateManager) SyncAppState(app *v1alpha1.Application, state *v1alpha
logEntry.WithField("duration", time.Since(start)).Info("sync/terminate complete")
if !syncOp.DryRun && len(syncOp.Resources) == 0 && state.Phase.Successful() {
err := m.persistRevisionHistory(app, compareResult.syncStatus.Revision, source, state.StartedAt)
err := m.persistRevisionHistory(app, compareResult.syncStatus.Revision, source, compareResult.syncStatus.Revisions, compareResult.syncStatus.ComparedTo.Sources, app.Spec.HasMultipleSources(), state.StartedAt)
if err != nil {
state.Phase = common.OperationError
state.Message = fmt.Sprintf("failed to record sync to history: %v", err)

View File

@@ -0,0 +1,55 @@
package controller
import (
"github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
"github.com/argoproj/argo-cd/v2/util/argo"
gitopscommon "github.com/argoproj/gitops-engine/pkg/sync/common"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
)
// syncNamespace determine if Argo CD should create and/or manage the namespace
// where the application will be deployed.
func syncNamespace(resourceTracking argo.ResourceTracking, appLabelKey string, trackingMethod v1alpha1.TrackingMethod, appName string, syncPolicy *v1alpha1.SyncPolicy) func(m, l *unstructured.Unstructured) (bool, error) {
// This function must return true for the managed namespace to be synced.
return func(managedNs, liveNs *unstructured.Unstructured) (bool, error) {
if managedNs == nil {
return false, nil
}
isNewNamespace := liveNs == nil
isManagedNamespace := syncPolicy != nil && syncPolicy.ManagedNamespaceMetadata != nil
// should only sync the namespace if it doesn't exist in k8s or if
// syncPolicy is defined to manage the metadata
if !isManagedNamespace && !isNewNamespace {
return false, nil
}
if isManagedNamespace {
managedNamespaceMetadata := syncPolicy.ManagedNamespaceMetadata
managedNs.SetLabels(managedNamespaceMetadata.Labels)
// managedNamespaceMetadata relies on SSA in order to avoid overriding
// existing labels and annotations in namespaces
managedNs.SetAnnotations(appendSSAAnnotation(managedNamespaceMetadata.Annotations))
}
// TODO: https://github.com/argoproj/argo-cd/issues/11196
// err := resourceTracking.SetAppInstance(managedNs, appLabelKey, appName, "", trackingMethod)
// if err != nil {
// return false, fmt.Errorf("failed to set app instance tracking on the namespace %s: %s", managedNs.GetName(), err)
// }
return true, nil
}
}
// appendSSAAnnotation will set the managed namespace to be synced
// with server-side apply
func appendSSAAnnotation(in map[string]string) map[string]string {
r := map[string]string{}
for k, v := range in {
r[k] = v
}
r[gitopscommon.AnnotationSyncOptions] = gitopscommon.SyncOptionServerSideApply
return r
}

View File

@@ -0,0 +1,261 @@
package controller
import (
"github.com/argoproj/argo-cd/v2/common"
"github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
"github.com/argoproj/argo-cd/v2/util/argo"
"github.com/stretchr/testify/assert"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/types"
"testing"
)
func createFakeNamespace(uid string, resourceVersion string, labels map[string]string, annotations map[string]string) *unstructured.Unstructured {
un := unstructured.Unstructured{}
un.SetUID(types.UID(uid))
un.SetResourceVersion(resourceVersion)
un.SetLabels(labels)
un.SetAnnotations(annotations)
un.SetKind("Namespace")
un.SetName("some-namespace")
return &un
}
func Test_shouldNamespaceSync(t *testing.T) {
tests := []struct {
name string
syncPolicy *v1alpha1.SyncPolicy
managedNs *unstructured.Unstructured
liveNs *unstructured.Unstructured
expected bool
expectedLabels map[string]string
expectedAnnotations map[string]string
}{
{
name: "liveNs is nil and syncPolicy is nil",
expected: false,
managedNs: nil,
liveNs: nil,
syncPolicy: nil,
},
{
name: "liveNs is nil and syncPolicy is not nil",
expected: false,
managedNs: nil,
liveNs: nil,
syncPolicy: &v1alpha1.SyncPolicy{
ManagedNamespaceMetadata: nil,
},
},
{
name: "liveNs is nil and syncPolicy has labels and annotations",
expected: false,
managedNs: nil,
liveNs: nil,
expectedLabels: map[string]string{"my-cool-label": "some-value"},
expectedAnnotations: map[string]string{"my-cool-annotation": "some-value"},
syncPolicy: &v1alpha1.SyncPolicy{
ManagedNamespaceMetadata: &v1alpha1.ManagedNamespaceMetadata{
Labels: map[string]string{"my-cool-label": "some-value"},
Annotations: map[string]string{"my-cool-annotation": "some-value"},
},
},
},
{
name: "namespace does not yet exist and managedNamespaceMetadata nil",
expected: true,
expectedLabels: map[string]string{},
expectedAnnotations: map[string]string{},
managedNs: createFakeNamespace("", "", map[string]string{}, map[string]string{}),
liveNs: nil,
syncPolicy: &v1alpha1.SyncPolicy{
ManagedNamespaceMetadata: nil,
},
},
{
name: "namespace does not yet exist and managedNamespaceMetadata not nil",
expected: true,
expectedAnnotations: map[string]string{"argocd.argoproj.io/sync-options": "ServerSideApply=true"},
managedNs: createFakeNamespace("", "", map[string]string{}, map[string]string{}),
liveNs: nil,
syncPolicy: &v1alpha1.SyncPolicy{
ManagedNamespaceMetadata: &v1alpha1.ManagedNamespaceMetadata{},
},
},
{
name: "namespace does not yet exist and managedNamespaceMetadata has empty labels map",
expected: true,
expectedLabels: map[string]string{},
expectedAnnotations: map[string]string{"argocd.argoproj.io/sync-options": "ServerSideApply=true"},
managedNs: createFakeNamespace("", "", map[string]string{}, map[string]string{}),
liveNs: nil,
syncPolicy: &v1alpha1.SyncPolicy{
ManagedNamespaceMetadata: &v1alpha1.ManagedNamespaceMetadata{
Labels: map[string]string{},
},
},
},
{
name: "namespace does not yet exist and managedNamespaceMetadata has empty annotations map",
expected: true,
expectedAnnotations: map[string]string{"argocd.argoproj.io/sync-options": "ServerSideApply=true"},
managedNs: createFakeNamespace("", "", map[string]string{}, map[string]string{}),
liveNs: nil,
syncPolicy: &v1alpha1.SyncPolicy{
ManagedNamespaceMetadata: &v1alpha1.ManagedNamespaceMetadata{
Annotations: map[string]string{},
},
},
},
{
name: "namespace does not yet exist and managedNamespaceMetadata has empty annotations and labels map",
expected: true,
expectedLabels: map[string]string{},
expectedAnnotations: map[string]string{"argocd.argoproj.io/sync-options": "ServerSideApply=true"},
managedNs: createFakeNamespace("", "", map[string]string{}, map[string]string{}),
liveNs: nil,
syncPolicy: &v1alpha1.SyncPolicy{
ManagedNamespaceMetadata: &v1alpha1.ManagedNamespaceMetadata{
Labels: map[string]string{},
Annotations: map[string]string{},
},
},
},
{
name: "namespace does not yet exist and managedNamespaceMetadata has labels",
expected: true,
expectedLabels: map[string]string{"my-cool-label": "some-value"},
expectedAnnotations: map[string]string{"argocd.argoproj.io/sync-options": "ServerSideApply=true"},
managedNs: createFakeNamespace("", "", map[string]string{}, map[string]string{}),
liveNs: nil,
syncPolicy: &v1alpha1.SyncPolicy{
ManagedNamespaceMetadata: &v1alpha1.ManagedNamespaceMetadata{
Labels: map[string]string{"my-cool-label": "some-value"},
Annotations: nil,
},
},
},
{
name: "namespace does not yet exist and managedNamespaceMetadata has annotations",
expected: true,
expectedAnnotations: map[string]string{"my-cool-annotation": "some-value", "argocd.argoproj.io/sync-options": "ServerSideApply=true"},
managedNs: createFakeNamespace("", "", map[string]string{}, map[string]string{}),
liveNs: nil,
syncPolicy: &v1alpha1.SyncPolicy{
ManagedNamespaceMetadata: &v1alpha1.ManagedNamespaceMetadata{
Labels: nil,
Annotations: map[string]string{"my-cool-annotation": "some-value"},
},
},
},
{
name: "namespace does not yet exist and managedNamespaceMetadata has annotations and labels",
expected: true,
expectedLabels: map[string]string{"my-cool-label": "some-value"},
expectedAnnotations: map[string]string{"my-cool-annotation": "some-value", "argocd.argoproj.io/sync-options": "ServerSideApply=true"},
managedNs: createFakeNamespace("", "", map[string]string{}, map[string]string{}),
liveNs: nil,
syncPolicy: &v1alpha1.SyncPolicy{
ManagedNamespaceMetadata: &v1alpha1.ManagedNamespaceMetadata{
Labels: map[string]string{"my-cool-label": "some-value"},
Annotations: map[string]string{"my-cool-annotation": "some-value"},
},
},
},
{
name: "namespace exists with no labels or annotations and managedNamespaceMetadata has labels",
expected: true,
expectedLabels: map[string]string{"my-cool-label": "some-value"},
expectedAnnotations: map[string]string{"argocd.argoproj.io/sync-options": "ServerSideApply=true"},
managedNs: createFakeNamespace("", "", map[string]string{}, map[string]string{}),
liveNs: createFakeNamespace("something", "1", map[string]string{}, map[string]string{}),
syncPolicy: &v1alpha1.SyncPolicy{
ManagedNamespaceMetadata: &v1alpha1.ManagedNamespaceMetadata{
Labels: map[string]string{"my-cool-label": "some-value"},
},
},
},
{
name: "namespace exists with no labels or annotations and managedNamespaceMetadata has annotations",
expected: true,
expectedAnnotations: map[string]string{"my-cool-annotation": "some-value", "argocd.argoproj.io/sync-options": "ServerSideApply=true"},
managedNs: createFakeNamespace("", "", map[string]string{}, map[string]string{}),
liveNs: createFakeNamespace("something", "1", map[string]string{}, map[string]string{}),
syncPolicy: &v1alpha1.SyncPolicy{
ManagedNamespaceMetadata: &v1alpha1.ManagedNamespaceMetadata{
Annotations: map[string]string{"my-cool-annotation": "some-value"},
},
},
},
{
name: "namespace exists with no labels or annotations and managedNamespaceMetadata has annotations and labels",
expected: true,
expectedLabels: map[string]string{"my-cool-label": "some-value"},
expectedAnnotations: map[string]string{"my-cool-annotation": "some-value", "argocd.argoproj.io/sync-options": "ServerSideApply=true"},
managedNs: createFakeNamespace("", "", map[string]string{}, map[string]string{}),
liveNs: createFakeNamespace("something", "1", map[string]string{}, map[string]string{}),
syncPolicy: &v1alpha1.SyncPolicy{
ManagedNamespaceMetadata: &v1alpha1.ManagedNamespaceMetadata{
Labels: map[string]string{"my-cool-label": "some-value"},
Annotations: map[string]string{"my-cool-annotation": "some-value"},
},
},
},
{
name: "namespace exists with labels and managedNamespaceMetadata has mismatching labels",
expected: true,
expectedAnnotations: map[string]string{"argocd.argoproj.io/sync-options": "ServerSideApply=true"},
expectedLabels: map[string]string{"my-cool-label": "some-value", "my-other-label": "some-other-value"},
managedNs: createFakeNamespace("", "", map[string]string{}, map[string]string{}),
liveNs: createFakeNamespace("something", "1", map[string]string{"my-cool-label": "some-value"}, map[string]string{}),
syncPolicy: &v1alpha1.SyncPolicy{
ManagedNamespaceMetadata: &v1alpha1.ManagedNamespaceMetadata{
Labels: map[string]string{"my-cool-label": "some-value", "my-other-label": "some-other-value"},
Annotations: map[string]string{},
},
},
},
{
name: "namespace exists with annotations and managedNamespaceMetadata has mismatching annotations",
expected: true,
expectedLabels: map[string]string{},
expectedAnnotations: map[string]string{"my-cool-annotation": "some-value", "argocd.argoproj.io/sync-options": "ServerSideApply=true"},
managedNs: createFakeNamespace("", "", map[string]string{}, map[string]string{}),
liveNs: createFakeNamespace("something", "1", map[string]string{}, map[string]string{"my-cool-annotation": "some-value", "my-other-annotation": "some-other-value"}),
syncPolicy: &v1alpha1.SyncPolicy{
ManagedNamespaceMetadata: &v1alpha1.ManagedNamespaceMetadata{
Labels: map[string]string{},
Annotations: map[string]string{"my-cool-annotation": "some-value"},
},
},
},
{
name: "namespace exists with annotations and labels managedNamespaceMetadata has mismatching annotations and labels",
expected: true,
expectedLabels: map[string]string{"my-cool-label": "some-value", "my-other-label": "some-other-value"},
expectedAnnotations: map[string]string{"my-cool-annotation": "some-value", "my-other-annotation": "some-other-value", "argocd.argoproj.io/sync-options": "ServerSideApply=true"},
managedNs: createFakeNamespace("", "", map[string]string{}, map[string]string{}),
liveNs: createFakeNamespace("something", "1", map[string]string{"my-cool-label": "some-value"}, map[string]string{"my-cool-annotation": "some-value"}),
syncPolicy: &v1alpha1.SyncPolicy{
ManagedNamespaceMetadata: &v1alpha1.ManagedNamespaceMetadata{
Labels: map[string]string{"my-cool-label": "some-value", "my-other-label": "some-other-value"},
Annotations: map[string]string{"my-cool-annotation": "some-value", "my-other-annotation": "some-other-value"},
},
},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
actual, err := syncNamespace(argo.NewResourceTracking(), common.LabelKeyAppInstance, argo.TrackingMethodAnnotation, "some-app", tt.syncPolicy)(tt.managedNs, tt.liveNs)
assert.NoError(t, err)
if tt.managedNs != nil {
assert.Equal(t, tt.expectedLabels, tt.managedNs.GetLabels())
assert.Equal(t, tt.expectedAnnotations, tt.managedNs.GetAnnotations())
}
assert.Equalf(t, tt.expected, actual, "syncNamespace(%v)", tt.syncPolicy)
})
}
}

View File

@@ -50,12 +50,12 @@ func TestPersistRevisionHistory(t *testing.T) {
}}
ctrl.appStateManager.SyncAppState(app, opState)
// Ensure we record spec.source into sync result
assert.Equal(t, app.Spec.Source, opState.SyncResult.Source)
assert.Equal(t, app.Spec.GetSource(), opState.SyncResult.Source)
updatedApp, err := ctrl.applicationClientset.ArgoprojV1alpha1().Applications(app.Namespace).Get(context.Background(), app.Name, v1.GetOptions{})
assert.Nil(t, err)
assert.Equal(t, 1, len(updatedApp.Status.History))
assert.Equal(t, app.Spec.Source, updatedApp.Status.History[0].Source)
assert.Equal(t, app.Spec.GetSource(), updatedApp.Status.History[0].Source)
assert.Equal(t, "abc123", updatedApp.Status.History[0].Revision)
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 55 KiB

View File

@@ -39,6 +39,31 @@ rm argocd-linux-amd64
You should now be able to run `argocd` commands.
## Mac (M1)
### Download With Curl
You can view the latest version of Argo CD at the link above or run the following command to grab the version:
```bash
VERSION=$(curl --silent "https://api.github.com/repos/argoproj/argo-cd/releases/latest" | grep '"tag_name"' | sed -E 's/.*"([^"]+)".*/\1/')
```
Replace `VERSION` in the command below with the version of Argo CD you would like to download:
```bash
curl -sSL -o argocd-darwin-arm64 https://github.com/argoproj/argo-cd/releases/download/$VERSION/argocd-darwin-arm64
```
Install the Argo CD CLI binary:
```bash
sudo install -m 555 argocd-darwin-arm64 /usr/local/bin/argocd
rm argocd-darwin-arm64
```
## Mac
### Homebrew

View File

@@ -0,0 +1,109 @@
# Authentication and Authorization
This document describes how authentication (authn) and authorization
(authz) are implemented in Argo CD. There is a clear distinction in
the code base of when and how these two security concepts are
enforced.
## Logical layers
The diagram bellow suggests 4 different logical layers (represented by
4 boxes: HTTP, gRPC, AuthN and AuthZ) inside Argo CD API server that
collaborate to provide authentication and authorization.
- **HTTP**: The HTTP layer groups the *logical elements* that
collaborate to handle HTTP requests. Every incoming request reaches
the same HTTP server at the same port (8080). This server will
analyze the request headers and dispatch to the proper internal
server: gRPC or standard HTTP.
- **gRPC**: The [gRPC][4] layer groups the logical elements responsible for
the gRPC implementation.
- **AuthN**: The AuthN represents the layer responsible for
authentication.
- **AuthZ**: The AuthZ represents the layer responsible for
authorization.
![Argo CD Architecture](../../assets/argocd-arch-authn-authz.jpg)
## Logical elements
The logical elements (identified by numbers) can represent an object,
a function or a component in the code base. Note that this particular
distinction is not represented in the diagram.
Incoming requests can reach Argo CD API server from the web UI as well
as from the `argocd` CLI. The responsibility of the represented
elements are described below with their respective numbers:
1. **Cmux**: Uses the [cmux][1] library to provide a connection
multiplexer capability making it possible to use the same port to
handle standard HTTP as well as gRPC requests. It is responsible
for inspecting incoming requests and dispatch to appropriate
internal servers. If the request version is `http1.x` it will
delegate to the *http mux*. If the request version is `http2` and
has the header `content-type: application/grpc`, it will delegate
to the *gRPC Server*.
1. **HTTP mux**: A [standard HTTP multiplexer][8] that will handle non
gRPC requests. It is responsible for serving a unified [REST
API][3] to the web UI exposing all gRPC and non-gRPC services.
1. **gRPC-gateway**: Uses the [grpc-gateway][2] library to translate
internal gRPC services and expose them as a [REST API][3]. The
great majority of API services in Argo CD are implemented in gRPC.
The grpc-gateway makes it possible to access gRPC services from the
web UI.
1. **Server**: The internal gRPC Server responsible for handling gRPC
requests.
1. **AuthN**: Is responsible for invoking the authentication logic. It
is registered as a gRPC interceptor which will automatically
trigger for every gRPC request.
1. **Session Manager**: Is the object responsible for managing Argo CD
API server session. It provides the functionality to verify the
validity of the authentication token provided in the request.
Depending on how Argo CD is configured it may or may not delegate
to an external AuthN provider to verify the token.
1. **AuthN Provider**: Describes the component that can be plugged in
Argo CD API server to provide the authentication functionality such
as the login and the token verification process.
1. **Service Method**: represents the method implementing the business
logic (core functionality) requested. An example of business logic
is: `List Applications`. Service methods are also responsible for
invoking the [RBAC][7] enforcement function to validate if the
authenticated user has permission to execute this method.
1. **RBAC**: Is a collection of functions to provide the capability to
verify if the user has permission to execute a specific action in
Argo CD. It does so by validating the incoming request action
against predefined [RBAC][7] rules that can be configured in Argo CD
API server as well as in Argo CD `Project` CRD.
1. **Casbin**: Uses the [Casbin][5] library to enforce [RBAC][7] rules.
1. **AuthN Middleware**: Is an [HTTP Middleware][6] configured to
invoke the logic to verify the token for HTTP services that are not
implemented as gRPC and requires authentication.
1. **HTTP Handler**: represents the http handlers responsible for
invoking the business logic (core functionality) requested. An
example of business logic is: `List Applications`. Http handlers
are also responsible for invoking the [RBAC][7] enforcement function to
validate if the authenticated user has permission to execute this
business logic.
[1]: https://github.com/soheilhy/cmux
[2]: https://github.com/grpc-ecosystem/grpc-gateway
[3]: https://en.wikipedia.org/wiki/Representational_state_transfer
[4]: https://grpc.io/
[5]: https://casbin.org/
[6]: https://github.com/golang/go/wiki/LearnServerProgramming#middleware
[7]: https://en.wikipedia.org/wiki/Role-based_access_control
[8]: https://pkg.go.dev/net/http#ServeMux

View File

@@ -1,15 +0,0 @@
Money given to the Argo CD project as part of the Internet Bug Bounty program is used in three ways:
1. To reward CVE patch contributors
2. To offer bounties on security enhancements (as announced by label/comment on Issues)
3. To sponsor security-relevant dependencies
If someones primary full-time job responsibility is to work on Argo CD, then their eligibility to receive this money is limited. (Determining this is up to the maintainers discretion. Someone who contributes an average of three commits per week during work hours probably meets the definition. A first-time contributor who uses Argo CD daily as an SRE does not.)
A full-time Argo CD author is not eligible to receive rewards for CVE patch contributions. This avoids any risk of the appearance that a full-time Argo CD author is incentivized to introduce CVEs.
A full-time Argo CD author is eligible to receive bounties for security enhancements if and only if the vast majority of the work is done in their free time (non-work hours). Busy work like resolving merge conflicts during work hours is acceptable (to avoid over-burdening the process).
An Argo CD dependency is eligible to receive donations if it is listed in the Argo CD SBOM or if it is a binary invoked by Argo CD (like Helm). The dependency is not eligible for donations if a full-time Argo CD author is the primary author of the dependency.
Offers and transfers of rewards, bounties, and donations will be made from time to time by the Argo CD maintainers, based on the current project needs and the amount of money available from IBB. The process should be lightweight and consensus-based for now. If necessary, a more structured system can be established based on experience gained from early rewards/bounties/donations

View File

@@ -65,12 +65,12 @@ make builder-image IMAGE_NAMESPACE=argoproj IMAGE_TAG=v1.0.0
## Public CD
Every commit to master is built and published to `ghcr.io/argoproj/argocd:<version>-<short-sha>`. The list of images is available at
Every commit to master is built and published to `ghcr.io/argoproj/argo-cd/argocd:<version>-<short-sha>`. The list of images is available at
https://github.com/argoproj/argo-cd/packages.
!!! note
GitHub docker registry [requires](https://github.community/t5/GitHub-Actions/docker-pull-from-public-GitHub-Package-Registry-fail-with-quot/m-p/32888#M1294) authentication to read
even publicly available packages. Follow the steps from Kubernetes [documentation](https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry)
to configure image pull secret if you want to use `ghcr.io/argoproj/argocd` image.
to configure image pull secret if you want to use `ghcr.io/argoproj/argo-cd/argocd` image.
The image is automatically deployed to the dev Argo CD instance: [https://cd.apps.argoproj.io/](https://cd.apps.argoproj.io/)

View File

@@ -103,7 +103,7 @@ Design documents are usually submitted as PR and use [this template](https://git
Our community regularly meets virtually to discuss issues, ideas and enhancements around Argo CD. We do invite you to join this virtual meetings if you want to bring up certain things (including your enhancement proposals), participate in our triaging or just want to get to know other contributors.
The current cadence of our meetings is weekly, every Thursday at 4pm UTC (9am Pacific, 12pm Eastern, 6pm Central European, 9:30pm Indian). We use Zoom to conduct these meetings.
The current cadence of our meetings is weekly, every Thursday at 4:15pm UTC (8:15am Pacific, 11:15am Eastern, 5:15pm Central European, 9:45pm Indian). We use Zoom to conduct these meetings.
* [Agenda document (Google Docs, includes Zoom link)](https://docs.google.com/document/d/1xkoFkVviB70YBzSEa4bDnu-rUZ1sIFtwKKG1Uw8XsY8)

View File

@@ -0,0 +1,112 @@
# Contributors Quick-Start
This guide is a starting point for first-time contributors running Argo CD locally for the first time.
It skips advanced topics such as codegen, which are covered in the [running locally guide](running-locally.md)
and the [toolchain guide](toolchain-guide.md).
## Getting Started
### Install Go
- Install version 1.18 or newer (Verify version by running `go version`)
- Get current value of `GOPATH` env:
```shell
go env | grep path
```
- Change directory into that path
```shell
cd <path>
```
### Clone the Argo CD repo
```shell
mkdir -p src/github.com/argoproj/ &&
cd src/github.com/argoproj &&
git clone https://github.com/argoproj/argo-cd.git
```
### Install Docker
<https://docs.docker.com/engine/install/>
### Install or Upgrade `kind` (Optional - Should work with any local cluster)
<https://kind.sigs.k8s.io/docs/user/quick-start/>
### Start Your Local Cluster
```shell
kind create cluster
```
### Install Argo CD
```shell
kubectl create namespace argocd &&
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/master/manifests/install.yaml
```
Set kubectl config to avoid specifying the namespace in every kubectl command.
All following commands in this guide assume the namespace is already set.
```shell
kubectl config set-context --current --namespace=argocd
```
### Install `yarn`
<https://classic.yarnpkg.com/lang/en/docs/install/>
### Install `goreman`
<https://github.com/mattn/goreman#getting-started>
### Run Argo CD
```shell
cd argo-cd
make start-local ARGOCD_GPG_ENABLED=false
```
- Navigate to <localhost:4000> to the ArgoCD UI on browser
- It may take a few minutes for the UI to be responsive
!!! note
If the UI is not working, check the logs from `make start-local`. The logs are `DEBUG` level by default. If the logs are
too noisy to find the problem, try editing log levels for the commands in the `Procfile` in the root of the Argo CD repo.
## Making Changes
### UI Changes
Modifying the User-Interface (by editing .tsx or .scss files) auto-reloads the changes on port 4000.
### Backend Changes
Modifying the API server, repo server, or a controller requires restarting the current `make start-local` session to reflect the changes.
### CLI Changes
Modifying the CLI requires restarting the current `make start-local` session to reflect the changes.
To test most CLI commands, you will need to log in.
First, get the auto-generated secret:
```shell
kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d; echo
```
Then log in using that password and username `admin`:
```shell
dist/argocd login localhost:8080
```
---
Congrats on making it to the end of this runbook! 🚀
For more on Argo CD, find us in Slack - <https://slack.cncf.io/> [#argo-contributors](https://cloud-native.slack.com/archives/C020XM04CUW)

View File

@@ -20,13 +20,15 @@ curl -sSfL https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/i
## Connect
Connect to one of the services, for example, to debug the main ArgoCD server run:
```shell
kubectl config set-context --current --namespace argocd
telepresence helm install # Installs telepresence into your cluster
telepresence connect # Starts the connection to your cluster
telepresence intercept argocd-server --port 8083:8083 --port 8080:8080 --env-file .envrc.remote --namespace argocd # Starts the interception
telepresence connect # Starts the connection to your cluster (bound to the current namespace)
telepresence intercept argocd-server --port 8080:http --env-file .envrc.remote # Starts the interception
```
* `--port` forwards traffic of remote ports 8080 and 8083 to the same ports locally
* `--port` forwards traffic of remote port http to 8080 locally (use `--port 8080:https` if argocd-server terminates TLS)
* `--env-file` writes all the environment variables of the remote pod into a local file, the variables are also set on the subprocess of the `--run` command
* `--namespace` specifies that the `argocd-server` is located in the `argocd` namespace
With this, any traffic that hits your argocd-server service in the cluster (e.g through a LB / ingress) will be forwarded to your laptop on port 8080. So that you can now start argocd-server locally to debug or test new code. If you launch argocd-server using the environment variables in `.envrc.remote`, he is able to fetch all the configmaps, secrets and so one from the cluster and transparently connect to the other microservices so that no further configuration should be neccesary and he behaves exactly the same as in the cluster.
List current status of Telepresence using:
```shell
@@ -63,11 +65,11 @@ Once a connection is established, use your favorite tools to start the server lo
* Run `./dist/argocd-server`
### VSCode
In VSCode use the integrated terminal to run the Telepresence command to connect. Then, to run argocd-server service use the following configuration.
Update the configuration file to point to kubeconfig file: `KUBECONFIG=` (required)
In VSCode use the following launch configuration to run argocd-server:
```json
{
"name": "Launch",
"name": "Launch argocd-server",
"type": "go",
"request": "launch",
"mode": "auto",
@@ -82,3 +84,4 @@ Update the configuration file to point to kubeconfig file: `KUBECONFIG=` (requir
}
}
```

View File

@@ -1,49 +1,78 @@
# Release Process And Cadence
Argo CD is being developed using the following process:
## Release Cycle
* Maintainers commit to work on set of features and enhancements and create GitHub milestone to track the work.
* We are trying to avoid delaying release and prefer moving the feature into the next release if we cannot complete it on time.
* The new release is published every **3 months**.
* Critical bug-fixes are cherry-picked into the release branch and delivered using patch releases as frequently as needed.
### Schedule
## Release Planning
These are the upcoming releases dates:
We are using GitHub milestones to perform release planning and tracking. Each release milestone includes two type of issues:
| Release | Release Planning Meeting | Release Candidate 1 | General Availability | Release Champion | Checklist |
|---------|--------------------------|-----------------------|----------------------|-------------------------------------------------------|---------------------------------------------------------------|
| v2.6 | Monday, Dec. 12, 2022 | Monday, Dec. 19, 2022 | Monday, Feb. 6, 2023 | [William Tam](https://github.com/wtam2018) | [checklist](https://github.com/argoproj/argo-cd/issues/11563) |
| v2.7 | Monday, Mar. 6, 2023 | Monday, Mar. 20, 2023 | Monday, May. 1, 2023 | [Pavel Kostohrys](https://github.com/pasha-codefresh) |
| v2.8 | Monday, Jun. 5, 2023 | Monday, Jun. 19, 2023 | Monday, Aug. 7, 2023 | [Keith Chong](https://github.keithchong)
| v2.9 | Monday, Sep. 4, 2023 | Monday, Sep. 18, 2023 | Monday, Nov. 6, 2023 |
* Issues that maintainers committed to working on. Maintainers decide which features they are committing to work on during the next release based on
their availability. Typically issues added offline by each maintainer and finalized during the contributors' meeting. Each such issue should be
assigned to maintainer who plans to implement and test it.
* Nice to have improvements contributed by community contributors. Nice to have issues are typically not critical, smallish enhancements that could
be contributed by community contributors. Maintainers are not committing to implement them but committing to review PR from the community.
Actual release dates might differ from the plan by a few days.
The milestone should have a clear description of the most important features as well as the expected end date. This should provide clarity to end-users
about what to expect from the next release and when.
### Release Process
In addition to the next milestone, we need to maintain a draft of the upcoming release milestone.
#### Minor Releases (e.g. 2.x.0)
## Community Contributions
A minor Argo CD release occurs four times a year, once every three months. Each General Availability (GA) release is
preceded by several Release Candidates (RCs). The first RC is released three weeks before the scheduled GA date. This
effectively means that there is a three-week feature freeze.
We receive a lot of contributions from our awesome community, and we're very grateful for that fact. However, reviewing and testing PRs is a lot of (unplanned) work and therefore, we cannot guarantee that contributions (especially large or complex ones) made by the community receive a timely review within a release's time frame. Maintainers may decide on their own to put work on a PR together with the contributor and in this case, the maintainer will self-assigned the PR and thereby committing to review, eventually merge and later test it on the release scope.
These are the approximate release dates:
## Release Testing
* The first Monday of February
* The first Monday of May
* The first Monday of August
* The first Monday of November
We need to make sure that each change, both from maintainers and community contributors, is tested well and have someone who is going to fix last-minute
bugs. In order to ensure it, each merged pull request must have an assigned maintainer before it gets merged. The assigned maintainer will be working on
testing the introduced changes and fixing of any introduced bugs.
Dates may be shifted slightly to accommodate holidays. Those shifts should be minimal.
We have a code freeze period two weeks before the release until the release branch is created. During code freeze no feature PR should be merged and it is ok
to merge bug fixes.
#### Patch Releases (e.g. 2.5.x)
Maintainers assigned to a PR that's been merged should drive testing and work on fixing last-minute issues. For tracking purposes after verifying PR the assigned
the maintainer should label it with a `verified` label.
Argo CD patch releases occur on an as-needed basis. Only the three most recent minor versions are eligible for patch
releases. Versions older than the three most recent minor versions are considered EOL and will not receive bug fixes or
security updates.
## Releasing
#### Minor Release Planning Meeting
The releasing procedure is described in [releasing](./releasing.md) document. Before closing the release milestone following should be verified:
Roughly two weeks before the RC date, there will be a meeting to discuss which features are planned for the RC. This meeting is
for contributors to advocate for certain features. Features which have at least one approver (besides the contributor)
who can assure they will review/merge by the RC date will be included in the release milestone. All other features will
be dropped from the milestone (and potentially shifted to the next one).
- [ ] All merged PRs and verified (verify and remove `needs-verification` label):
- [ ] Triage issues reported by `yarn audit` and ensure there are no exploitable security issues.
- [ ] Roadmap is updated based one current release changes
- [ ] Next release milestone is created
- [ ] Upcoming release milestone is updated
Since not everyone will be able to attend the meeting, there will be a meeting doc. Contributors can add their feature
to a table, and Approvers can add their name to the table. Features with a corresponding approver will remain in the
release milestone.
#### Release Champion
To help manage all the steps involved in a release, we will have a Release Champion. The Release Champion will be
responsible for a checklist of items for their release. The checklist is an issue template in the Argo CD repository.
The Release Champion can be anyone in the Argo CD community. Some tasks (like cherry-picking bug fixes and cutting
releases) require [Approver](https://github.com/argoproj/argoproj/blob/master/community/membership.md#community-membership)
membership. The Release Champion can delegate tasks when necessary and will be responsible for coordinating with the
Approver.
### Feature Acceptance Criteria
To be eligible for inclusion in a minor release, a new feature must meet the following criteria before the releases RC
date.
If it is a large feature that involves significant design decisions, that feature must be described in a Proposal, and
that Proposal must be reviewed and merged.
The feature PR must include:
* Tests (passing)
* Documentation
* If necessary, a note in the Upgrading docs for the planned minor release
* The PR must be reviewed, approved, and merged by an Approver.
If these criteria are not met by the RC date, the feature will be ineligible for inclusion in the RC series or GA for
that minor release. It will have to wait for the next minor release.

View File

@@ -117,6 +117,27 @@ The Docker container for the virtualized toolchain will use the following local
The following steps are required no matter whether you chose to use a virtualized or a local toolchain.
!!!note "Docker privileges"
If you opt in to use the virtualized toolchain, you will need to have the
appropriate privileges to interact with the Docker daemon. It is not
recommended to work as the root user, and if your user does not have the
permissions to talk to the Docker user, but you have `sudo` setup on your
system, you can set the environment variable `SUDO` to `sudo` in order to
have the build scripts make any calls to the `docker` CLI using sudo,
without affecting the other parts of the build scripts (which should be
executed with your normal user privileges).
You can either set this before calling `make`, like so for example:
```
SUDO=sudo make sometarget
```
Or you can opt to export this permanently to your environment, for example
```
export SUDO=sudo
```
### Clone the Argo CD repository from your personal fork on GitHub
* `mkdir -p ~/go/src/github.com/argoproj`

View File

@@ -78,10 +78,10 @@ The API server can then be accessed using https://localhost:8080
The initial password for the `admin` account is auto-generated and stored as
clear text in the field `password` in a secret named `argocd-initial-admin-secret`
in your Argo CD installation namespace. You can simply retrieve this password
using `kubectl`:
using the `argocd` CLI:
```bash
kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d; echo
argocd admin initial-password
```
!!! warning

View File

@@ -0,0 +1,220 @@
# Applications in any namespace
**Current feature state**: Beta
!!! warning
Please read this documentation carefully before you enable this feature. Misconfiguration could lead to potential security issues.
## Introduction
As of version 2.5, Argo CD supports managing `Application` resources in namespaces other than the control plane's namespace (which is usually `argocd`), but this feature has to be explicitly enabled and configured appropriately.
Argo CD administrators can define a certain set of namespaces where `Application` resources may be created, updated and reconciled in. However, applications in these additional namespaces will only be allowed to use certain `AppProjects`, as configured by the Argo CD administrators. This allows ordinary Argo CD users (e.g. application teams) to use patterns like declarative management of `Application` resources, implementing app-of-apps and others without the risk of a privilege escalation through usage of other `AppProjects` that would exceed the permissions granted to the application teams.
Some manual steps will need to be performed by the Argo CD administrator in order to enable this feature.
!!! note
This feature is considered beta as of now. Some of the implementation details may change over the course of time until it is promoted to a stable status. We will be happy if early adopters use this feature and provide us with bug reports and feedback.
## Prerequisites
### Cluster-scoped Argo CD installation
This feature can only be enabled and used when your Argo CD is installed as a cluster-wide instance, so it has permissions to list and manipulate resources on a cluster scope. It will *not* work with an Argo CD installed in namespace-scoped mode.
### Switch resource tracking method
Also, while technically not necessary, it is strongly suggested that you switch the application tracking method from the default `label` setting to either `annotation` or `annotation+label`. The reasonsing for this is, that application names will be a composite of the namespace's name and the name of the `Application`, and this can easily exceed the 63 characters length limit imposed on label values. Annotations have a notably greater length limit.
To enable annotation based resource tracking, refer to the documentation about [resource tracking methods](../../user-guide/resource_tracking/)
## Implementation details
### Overview
In order for an application to be managed and reconciled outside the Argo CD's control plane namespace, two prerequisites must match:
1. The `Application`'s namespace must be explicitly enabled using the `--application-namespaces` parameter for the `argocd-application-controller` and `argocd-server` workloads. This parameter controls the list of namespaces that Argo CD will be allowed to source `Application` resources from globally. Any namespace not configured here cannot be used from any `AppProject`.
1. The `AppProject` referenced by the `.spec.project` field of the `Application` must have the namespace listed in its `.spec.sourceNamespaces` field. This setting will determine whether an `Application` may use a certain `AppProject`. If an `Application` specifies an `AppProject` that is not allowed, Argo CD refuses to process this `Application`. As stated above, any namespace configured in the `.spec.sourceNamespaces` field must also be enabled globally.
`Applications` in different namespaces can be created and managed just like any other `Application` in the `argocd` namespace previously, either declaratively or through the Argo CD API (e.g. using the CLI, the web UI, the REST API, etc).
### Reconfigure Argo CD to allow certain namespaces
#### Change workload startup parameters
In order to enable this feature, the Argo CD administrator must reconfigure the `argocd-server` and `argocd-application-controller` workloads to add the `--application-namespaces` parameter to the container's startup command.
The `--application-namespaces` parameter takes a comma-separated list of namespaces where `Applications` are to be allowed in. Each entry of the list supports shell-style wildcards such as `*`, so for example the entry `app-team-*` would match `app-team-one` and `app-team-two`. To enable all namespaces on the cluster where Argo CD is running on, you can just specify `*`, i.e. `--application-namespaces=*`.
The startup parameters for both, the `argocd-server` and the `argocd-application-controller` can also be conveniently set up and kept in sync by specifying the `application.namespaces` settings in the `argocd-cmd-params-cm` ConfigMap _instead_ of changing the manifests for the respective workloads. For example:
```yaml
data:
application.namespaces: app-team-one, app-team-two
```
would allow the `app-team-one` and `app-team-two` namespaces for managing `Application` resources. After a change to the `argocd-cmd-params-cm` namespace, the appropriate workloads need to be restarted:
```bash
kubectl rollout restart -n argocd deployment argocd-server
kubectl rollout restart -n argocd statefulset argocd-application-controller
```
#### Adapt Kubernetes RBAC
We decided to not extend the Kubernetes RBAC for the `argocd-server` workload by default for the time being. If you want `Applications` in other namespaces to be managed by the Argo CD API (i.e. the CLI and UI), you need to extend the Kubernetes permissions for the `argocd-server` ServiceAccount.
We supply a `ClusterRole` and `ClusterRoleBinding` suitable for this purpose in the `examples/k8s-rbac/argocd-server-applications` directory. For a default Argo CD installation (i.e. installed to the `argocd` namespace), you can just apply them as-is:
```shell
kubectl apply -f examples/k8s-rbac/argocd-server-applications/
```
!!! note
At some later point in time, we may make this cluster role part of the default installation manifests.
### Allowing additional namespaces in an AppProject
Any user with Kubernetes access to the Argo CD control plane's namespace (`argocd`), especially those with permissions to create or update `Applications` in a declarative way, is to be considered an Argo CD admin.
This prevented unprivileged Argo CD users from declaratively creating or managing `Applications` in the past. Those users were constrained to using the API instead, subject to Argo CD RBAC which ensures only `Applications` in allowed `AppProjects` were created.
For an `Application` to be created outside the `argocd` namespace, the `AppProject` referred to in the `Application`'s `.spec.project` field must include the `Application`'s namespace in its `.spec.sourceNamespaces` field.
For example, consider the two following (incomplete) `AppProject` specs:
```yaml
kind: AppProject
apiVersion: argoproj.io/v1alpha1
metadata:
name: project-one
namespace: argocd
spec:
sourceNamespaces:
- namespace-one
```
and
```yaml
kind: AppProject
apiVersion: argoproj.io/v1alpha1
metadata:
name: project-two
namespace: argocd
spec:
sourceNamespaces:
- namespace-two
```
In order for an Application to set `.spec.project` to `project-one`, it would have to be created in either namespace `namespace-one` or `argocd`. Likewise, in order for an Application to set `.spec.project` to `project-two`, it would have to be created in either namespace `namespace-two` or `argocd`.
If an Application in `namespace-two` would set their `.spec.project` to `project-one` or an Application in `namespace-one` would set their `.spec.project` to `project-two`, Argo CD would consider this as a permission violation and refuse to reconcile the Application.
Also, the Argo CD API will enforce these constraints, regardless of the Argo CD RBAC permissions.
The `.spec.sourceNamespaces` field of the `AppProject` is a list that can contain an arbitrary amount of namespaces, and each entry supports shell-style wildcard, so that you can allow namespaces with patterns like `team-one-*`.
!!! warning
Do not add user controlled namespaces in the `.spec.sourceNamespaces` field of any privileged AppProject like the `default` project. Always make sure that the AppProject follows the principle of granting least required privileges. Never grant access to the `argocd` namespace within the AppProject.
!!! note
For backwards compatibility, Applications in the Argo CD control plane's namespace (`argocd`) are allowed to set their `.spec.project` field to reference any AppProject, regardless of the restrictions placed by the AppProject's `.spec.sourceNamespaces` field.
### Application names
For the CLI and UI, applications are now referred to and displayed as in the format `<namespace>/<name>`.
For backwards compatibility, if the namespace of the Application is the control plane's namespace (i.e. `argocd`), the `<namespace>` can be omitted from the application name when referring to it. For example, the application names `argocd/someapp` and `someapp` are semantically the same and refer to the same application in the CLI and the UI.
### Application RBAC
The RBAC syntax for Application objects has been changed from `<project>/<application>` to `<project>/<namespace>/<application>` to accomodate the need to restrict access based on the source namespace of the Application to be managed.
For backwards compatibility, Applications in the `argocd` namespace can still be refered to as `<project>/<application>` in the RBAC policy rules.
Wildcards do not make any distinction between project and application namespaces yet. For example, the following RBAC rule would match any application belonging to project `foo`, regardless of the namespace it is created in:
```
p, somerole, applications, get, foo/*, allow
```
If you want to restrict access to be granted only to `Applications` in project `foo` within namespace `bar`, the rule would need to be adapted as follows:
```
p, somerole, applications, get, foo/bar/*, allow
```
## Managing applications in other namespaces
### Declaratively
For declarative management of Applications, just create the Application from a YAML or JSON manifest in the desired namespace. Make sure that the `.spec.project` field refers to an AppProject that allows this namespace. For example, the following (incomplete) Application manifest creates an Application in the namespace `some-namespace`:
```yaml
kind: Application
apiVersion: argoproj.io/v1alpha1
metadata:
name: some-app
namespace: some-namespace
spec:
project: some-project
# ...
```
The project `some-project` will then need to specify `some-namespace` in the list of allowed source namespaces, e.g.
```yaml
kind: AppProject
apiVersion: argoproj.io/v1alpha1
metadata:
name: some-project
namespace: argocd
spec:
sourceNamespaces:
- some-namespace
```
### Using the CLI
You can use all existing Argo CD CLI commands for managing applications in other namespaces, exactly as you would use the CLI to manage applications in the control plane's namespace.
For example, to retrieve the `Application` named `foo` in the namespace `bar`, you can use the following CLI command:
```shell
argocd app get foo/bar
```
Likewise, to manage this application, keep referring to it as `foo/bar`:
```bash
# Create an application
argocd app create foo/bar ...
# Sync the application
argocd app sync foo/bar
# Delete the application
argocd app delete foo/bar
# Retrieve application's manifest
argocd app manifests foo/bar
```
As stated previously, for applications in the Argo CD's control plane namespace, you can omit the namespace from the application name.
### Using the UI
Similar to the CLI, you can refer to the application in the UI as `foo/bar`.
For example, to create an application named `bar` in the namespace `foo` in the web UI, set the application name in the creation dialogue's _Application Name_ field to `foo/bar`. If the namespace is omitted, the control plane's namespace will be used.
### Using the REST API
If you are using the REST API, the namespace for `Application` cannot be specified as the application name, and resources need to be specified using the optional `appNamespace` query parameter. For example, to work with the `Application` resource named `foo` in the namespace `bar`, the request would look like follows:
```bash
GET /api/v1/applications/foo?appNamespace=bar
```
For other operations such as `POST` and `PUT`, the `appNamespace` parameter must be part of the request's payload.
For `Application` resources in the control plane namespace, this parameter can be omitted.

View File

@@ -45,6 +45,9 @@ spec:
valueFiles:
- values-prod.yaml
# Ignore locally missing valueFiles when installing Helm chart. Defaults to false
ignoreMissingValueFiles: false
# Values file as block file
values: |
ingress:
@@ -61,6 +64,9 @@ spec:
hosts:
- mydomain.example.com
# Skip custom resource definition installation if chart contains custom resource definitions. Defaults to false
skipCrds: false
# Optional Helm version to template with. If omitted it will fall back to look at the 'apiVersion' in Chart.yaml
# and decide which Helm binary to use automatically. This field can be either 'v2' or 'v3'.
version: v2
@@ -108,6 +114,7 @@ spec:
# plugin specific config
plugin:
# NOTE: this field is deprecated in v2.5 and must be removed to use sidecar-based plugins.
# Only set the plugin name if the plugin is defined in argocd-cm.
# If the plugin is defined as a sidecar, omit the name. The plugin will be automatically matched with the
# Application according to the plugin's discovery rules.
@@ -116,10 +123,29 @@ spec:
env:
- name: FOO
value: bar
# Plugin parameters are new in v2.5.
parameters:
- name: string-param
string: example-string
- name: array-param
array: [item1, item2]
- name: map-param
map:
param-name: param-value
# Sources field specifies the list of sources for the application
sources:
- repoURL: https://github.com/argoproj/argocd-example-apps.git # Can point to either a Helm chart repo or a git repo.
targetRevision: HEAD # For Helm, this refers to the chart version.
path: guestbook # This has no meaning for Helm charts pulled directly from a Helm repo instead of git.
ref: my-repo # For Helm, acts as a reference to this source for fetching values files from this source. Has no meaning when under `source` field
# Destination cluster and namespace to deploy the application
destination:
# cluster API URL
server: https://kubernetes.default.svc
# or cluster name
# name: in-cluster
# The namespace will only be set for namespace-scoped resources that have not set a value for .metadata.namespace
namespace: guestbook
@@ -134,6 +160,15 @@ spec:
- CreateNamespace=true # Namespace Auto-Creation ensures that namespace specified as the application destination exists in the destination cluster.
- PrunePropagationPolicy=foreground # Supported policies are background, foreground and orphan.
- PruneLast=true # Allow the ability for resource pruning to happen as a final, implicit wave of a sync operation
managedNamespaceMetadata: # Sets the metadata for the application namespace. Only valid if CreateNamespace=true (see above), otherwise it's a no-op.
labels: # The labels to set on the application namespace
any: label
you: like
annotations: # The annotations to set on the application namespace
the: same
applies: for
annotations: on-the-namespace
# The retry feature is available since v1.7
retry:
limit: 5 # number of failed sync attempt retries; unlimited number of attempts if less than 0

Some files were not shown because too many files have changed in this diff Show More