Commit Graph

31 Commits

Author SHA1 Message Date
Matthieu MOREL c6ebc19c1f
chore(lint): enable emptyStringTest rule from go-critic (#23400)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-06-15 20:25:12 +00:00
Michael Crenshaw 74582e9965
chore: embed trivial rand string function (#22177)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2025-03-05 16:34:16 -05:00
Michael Crenshaw b9131c1802
feat(cmp): pass empty env vars to plugins (#18720) (#22096)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2025-03-02 18:01:50 -05:00
github-actions[bot] 4d9835927d
Bump major version to 3 (#21410)
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: crenshaw-dev <350466+crenshaw-dev@users.noreply.github.com>
2025-01-10 16:14:00 -05:00
Matthieu MOREL 53bc19b5f2
chore: enable unused-parameter from revive (#21365)
* chore: enable unused-parameter from revive

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

* apply recommandations

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

---------

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-01-07 10:12:56 -05:00
Matthieu MOREL 9ea979bbcd
chore: enable use-any from revive (#21282)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-01-02 18:26:59 -05:00
Matthieu MOREL 8a6f53d044
chore: enable errorf of perfsprint linter (#21280)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-12-30 10:56:41 +02:00
James McShane 3988861edf
feat(cmp): parameter to enable git creds to be shared from repo server to the plugin (#15107)
Signed-off-by: jmcshane <james.mcshane@superorbital.io>
2024-10-31 13:35:08 -04:00
Michael Crenshaw 21fe286f6e
chore(refactor): move util function to util package (#19192)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-07-25 10:33:16 -04:00
Javier Solana e7760b5e93
feat: Allow return the client without performing a matchRepository (#18053)
* return the client without performing a matchRepository operation when the application'plugin be configured by its name

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

* add CheckPluginConfiguration pre-flight operation

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

* fix lint

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

* Missing comment

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

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

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

---------

Signed-off-by: Javier Solana <javier.solana@cabify.com>
Co-authored-by: Javier Solana <javier.solana@cabify.com>
2024-07-15 09:02:25 -04:00
pasha-codefresh 1aa898cbb4
feat: support log level in cmp plugin, possibility to trace generated manifest (#18851)
* feat: support log level in cmp plugin, and add possibility to trace generated manifest

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

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

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

---------

Signed-off-by: pashakostohrys <pavel@codefresh.io>
2024-06-30 15:49:07 -04:00
Matthieu MOREL 7cf5ed06d4
chore: enable gofumpt and whitespace linters (#18567)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-06-11 15:41:55 +00:00
Matthieu MOREL 33df2ce698
chore: enable goimports linter (#18564)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-06-10 09:18:12 -04:00
Matthieu MOREL 9fe1dbfcad
fix: enable misspell linter (#18412)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-05-28 12:51:04 +03:00
Mathias Petermann 752004c870
feat(cmp): Print stderr output from command even on success (#15921) (#15973)
* feat(cmp): Print stderr output from command even on success

Signed-off-by: Mathias Petermann <mathias.petermann@gmail.com>

* docs(cmp): Document logging from cmp sidecard for development purposes

Signed-off-by: Mathias Petermann <mathias.petermann@gmail.com>

---------

Signed-off-by: Mathias Petermann <mathias.petermann@gmail.com>
2023-10-23 09:59:56 -04:00
Ashin Sabu 389cf7521d
fix(cmp): send sigterm to cmp commands before sigkill to allow for potential cleanup (#9180) (#14955)
* fix: send sigterm to cmp commands before sigkill to allow for potential cleanup

Signed-off-by: Ashin Sabu <ashin.sabu@harness.io>

* fix: unit test for runCommand in cmpserver to test cleanup modified

Signed-off-by: Ashin Sabu <ashin.sabu@harness.io>

* fix: change unit test for plugin/runCommand to avoid bad trap along with lint fix

Signed-off-by: Ashin Sabu <ashin.sabu@harness.io>

---------

Signed-off-by: Ashin Sabu <ashin.sabu@harness.io>
2023-08-08 15:30:41 +00:00
Michael Crenshaw cec07ee1ce
fix(cmp): discover plugins relative to app path (#13940) (#13946)
* fix(cmp): discover plugins relative to app path (#13940)

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

* securejoin

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

* intuitive constant names

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>

* add missing import

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-06-15 21:17:04 +00:00
Michael Crenshaw af5bb44add
fix: remove false positive for no-discovery cmp; log string, not bytes (#13251)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2023-04-24 13:58:48 -04:00
Michael Crenshaw 95f9196317
fix: pass env when getting param announcement (#11812) (#11815)
* fix: pass env when getting param announcement (#11812)

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

* use same method as other methods

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

* better tests

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

* make sure env var tests are meaningful

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-03-22 14:55:09 -04:00
Alexander Matyushentsev 304a7428d6
feat: allow CMP plugins to preserve repo files mode (#12940)
* feat: allow CMP plugins to preserve repo files mode

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

* implement missing e2e test

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

---------

Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
2023-03-22 12:15:19 -04:00
Michael Crenshaw 3c058ea732
fix: log plugin commands in a better format (#12260)
* fix: log plugin commands in a better format

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>

---------

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2023-03-15 09:29:33 -04:00
Gergely Czuczy a10fde5c24
feat: Added warning on plugin command returning zero output (#12698)
Signed-off-by: Gergely Czuczy <gergely.czuczy@sap.com>
2023-03-02 11:36:23 -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
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
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
Pierre Crégut 61f48d56b1
feat: Add plugin call variables to sidecar plugin discovery (#9273) (#9319)
* fix: do not export repo-server environment to sidecar (#9393)

getPluginEnvs is both used for local plugins and sidecar plugins. For the later
do not include the environement variables of the repo-server in the supplied
variables.

Fixes: #9393
Signed-off-by: Pierre Crégut <pierre.cregut@orange.com>

* feat: Add plugin call variables to sidecar plugin discovery (#9273)

Gives access to variables declared in the call of the plugin in the application
manifest to the discover command run on the CMP server.

Variables are prefixed with ARGOCD_ENV_ to avoid security issues (plugin call
overiding important variables).

Fixes #9273

Signed-off-by: Pierre Crégut <pierre.cregut@orange.com>
2022-05-31 16:19:54 -04:00
Leonardo Luz Almeida 41db812474
feat: remove shared repo volume between repo-server and cmp-server (#8600)
feat: remove shared repo volume between repo-server and cmp-server (#8600)

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
2022-03-15 12:06:21 -07:00
Alexander Matyushentsev 580a6960fc
fix: argocd build fails on windows (#8319)
Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
2022-01-30 13:01:13 -08:00
Michael Crenshaw 96f95ca1c1
Use gRPC timeout for sidecar CMPs (#8131) (#8236)
Use gRPC timeout for sidecar CMPs (#8131) (#8236)

Signed-off-by: Michael Crenshaw <michael@crenshaw.dev>
2022-01-25 15:45:37 -08:00
Alexander Matyushentsev caa246a38d
refactor: allow using own config maps to register the cmp plugins instead of 'argocd-cmp-cm' (#7677)
Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
2021-11-10 14:57:14 -08:00
May Zhang 375e27bd7a
Feat: cmp server (#6585)
* feat: config management plugin enhancement (#6585)

Signed-off-by: kshamajain99 <kshamajain99@gmail.com>
Signed-off-by: May Zhang <may_zhang@intuit.com>
Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
2021-11-08 09:47:10 -08:00