-
Notifications
You must be signed in to change notification settings - Fork 253
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
k8sClient get resources across all namespaces (#601) #854
base: master
Are you sure you want to change the base?
k8sClient get resources across all namespaces (#601) #854
Conversation
Great! Maybe you can consider reusing the |
It does make sense to wanting to align the functionality to ArgoCD itself. AIU is effectively following that featureset, as we're seeing here with the 'app in any namespace' feature. If we go for this approach, a fair amount of change is needed;
|
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.
@jortkoopmans @wd I was thinking about keeping this PR focused on fixing the currently broken apps-in-any-namespace feature and adding wildcard support in a separate PR. WDYT?
I reviewed and tested the PR in regards to fixing the currently broken apps-in-any-namespace feature and changes look good. However, the unit tests still need to be fixed.
@ishitasequeira I'm good with that. I'm just trying to bring information from Argo here. |
@wd, It's a good callout for sure and something which can be looked into as a next step forward for the feature. @jortkoopmans, let me know if you need any help in fixing the unit tests. |
- Modify ks8Client functions to always get Application resources across all namespaces - Add required RBAC permissions Signed-off-by: Jort Koopmans <[email protected]>
6c9e2ee
to
4902053
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #854 +/- ##
==========================================
+ Coverage 75.47% 75.88% +0.41%
==========================================
Files 31 31
Lines 3144 3177 +33
==========================================
+ Hits 2373 2411 +38
+ Misses 636 633 -3
+ Partials 135 133 -2 ☔ View full report in Codecov by Sentry. |
Fix UpdateSpec to handle partial updates without specified appNamespace Fix tests to work with Applications across namespaces Signed-off-by: Jort Koopmans <[email protected]>
2748faa
to
d440337
Compare
- Error wrapping for improved reporting in higher-lvl code - Change UpdateSpec retry to stop trying, with exponential backoff - Add and enhance tests. Improve code coverage. Signed-off-by: Jort Koopmans <[email protected]>
Thank you for the feedback and guidance @wd @ishitasequeira . It turned out that some of the functions strictly require a namespace to be provided, I have modified several functions to deal with this correctly (and introduce some helper functions). Specifically:
For my use case, I only need AIU to monitor the Applications (ListApplications) across namespaces, since I use it exclusively to overwrite the sha256 image hashes (and not Get or Update the Application spec). This is probably why it worked for me previously (?). Subsequently I refactored and extended some of the tests. But feel free to amend or change this. Lastly, while testing I noticed that retrying on conflict is perpetual, I implemented maxRetries and exponential backoff to resolve that. |
Work in progress. Updating Applications using this branch works for me, when the RBAC permissions are configured. (#601)
However, there are several considerations;