-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(cmp): discover plugins relative to app path (#13940) #13946
fix(cmp): discover plugins relative to app path (#13940) #13946
Conversation
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
/cherry-pick release-2.7 |
/cherry-pick release-2.6 |
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #13946 +/- ##
=======================================
Coverage 49.56% 49.56%
=======================================
Files 256 256
Lines 43920 43927 +7
=======================================
+ Hits 21770 21774 +4
- Misses 19987 19990 +3
Partials 2163 2163
☔ View full report in Codecov by Sentry. |
Cherry-pick failed with |
Cherry-pick failed with |
…oproj#13946) * fix(cmp): discover plugins relative to app path (argoproj#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>
…oproj#13946) * fix(cmp): discover plugins relative to app path (argoproj#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>
…oproj#13946) (argoproj#14084) * fix(cmp): discover plugins relative to app path (argoproj#13940) * securejoin * intuitive constant names * comments * add missing import --------- Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> Signed-off-by: schakrad <58915923+schakrad@users.noreply.github.com>
…oproj#13946) * fix(cmp): discover plugins relative to app path (argoproj#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>
…oproj#13946) * fix(cmp): discover plugins relative to app path (argoproj#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>
According to our docs, CMP discovery was always meant to be relative to the repo root. That was a reasonable design, because discovery for other config management tools (e.g. Helm) is done at the repo root.
But those other tools have multiple outputs: the names of the directories which they can handle. CMP discovery only has a boolean output: "yes, I support that directory" or "no, I do not support that directory."
So, the actual implementation (in contradiction to the docs) answers that question at the app's path instead of the repo root. That's reasonable, because Argo CD needs to know "will this plugin work in this directory?" Since we only get a yes/no, we have to ask the question about a specific directory, instead of about the whole repo.
#13360 made one important fix: instead of just sending the app directory to the plugin, we send the whole repo. That makes sense, because stuff outside the app directory might be important.
But the PR made a mistake: it changed the discovery mechanism to evaluate discovery rules relative to the repo root instead of the app path.
This PR does two things:
This PR does not revert the changes from #13360 which makes the whole repo available to the plugin.
Fixes #13940