-
Notifications
You must be signed in to change notification settings - Fork 293
feat: Add configuration option to scope application listing / getting to particular namespace #1112
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
base: master
Are you sure you want to change the base?
feat: Add configuration option to scope application listing / getting to particular namespace #1112
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1112 +/- ##
==========================================
+ Coverage 63.49% 63.65% +0.15%
==========================================
Files 15 15
Lines 2326 2336 +10
==========================================
+ Hits 1477 1487 +10
Misses 758 758
Partials 91 91 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
I was unsure how to add tests for this change. I saw these tests, but I'm not sure how to set up something similar to assert that "if the client is configured with an |
@grahamalama thanks for the contribution. Can you please fix the DCO check failure? Is this PR also intended to address issue #1111 ? |
Signed-off-by: Graham Beckley <[email protected]>
Signed-off-by: Graham Beckley <[email protected]>
703dd62
to
700e3a5
Compare
@chengfang just pushed the DCO fix.
It could be I suppose! For me, my goal was to fix #902 specifically. But I think it'd addresses both. |
can we add tests with non-nil appNamespace, just for some basic sanity check? |
@grahamalama can you also update docs/install/reference.md to document the new flag? (https://argocd-image-updater.readthedocs.io/en/latest/install/reference/ |
@grahamalama can you also take a look at the comment on the related issue #1111 (comment). Although it covers a different issue (still related to this one), I think the comment about using listApp vs getApp is also revelant here. Some namespace may contain large number of apps and list operation in this namespace could still be a performance bottleneck. If we know image-updater is configured to 1 namespace, we should be able to just use getApp. |
Commented in #1111, and depending on the outcome of that conversation I'll update this PR accordingly. I will say though if the decision is to add some sort of caching option, I think that would be better suited for a separate PR. |
In #854, AIU made changes so that it scanned applications across all namespaces. This introduced a few regressions for some use cases, namely #902.
In this PR, I introduce a config option so that users can optionally scope the K8s client to a specific namespace (as was the case before #854). Since searching across all namespaces was recently introduced as the default, I opted to keep that the default.