-
Notifications
You must be signed in to change notification settings - Fork 43
fix: gate RESOURCE_SERVER and local resource management on gateway presence #331
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,6 +34,17 @@ data: | |
|
|
||
| EDA_STATIC_URL: /api/eda/static/ | ||
|
|
||
| # Resource Server configuration | ||
| {% set _user_settings = (extra_settings | default([])) | map(attribute='setting') | map('upper') | list %} | ||
| {% if public_base_url | default('') | length == 0 %} | ||
| {% if 'EDA_RESOURCE_SERVER__URL' not in _user_settings %} | ||
| EDA_RESOURCE_SERVER__URL: "" | ||
| {% endif %} | ||
| {% if 'EDA_ALLOW_LOCAL_RESOURCE_MANAGEMENT' not in _user_settings %} | ||
| EDA_ALLOW_LOCAL_RESOURCE_MANAGEMENT: "True" | ||
| {% endif %} | ||
|
Comment on lines
+39
to
+45
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win Do not enable local management when a resource-server URL is supplied. When 🤖 Prompt for AI Agents |
||
| {% endif %} | ||
|
|
||
| # Custom user variables | ||
| {% for item in extra_settings | default([]) %} | ||
| {{ item.setting | upper }}: "{{ item.value }}" | ||
|
|
||
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.
The new block can end up emitting
EDA_ALLOW_LOCAL_RESOURCE_MANAGEMENTtwice in the rendered ConfigMap: every bundled standalone sample (dev/eda-cr/eda-k8s-ing.yml,eda-openshift-cr.yml,lightweight-eda.yml,eda-k8s-nodeport-cr.yml,eda-resource-quota-cr.yml) already sets this key viaextra_settings, and none of them setpublic_base_url, so both this block and theextra_settingsloop below fire for all of them.kubernetes.core'sk8smodule parses the rendered manifest withyaml.safe_load_all(), which silently keeps the last occurrence of a duplicate key. Harmless today only becauseextra_settingsrenders after this block and happens to win with the same value - it stops being harmless if the block order ever changes or a CR sets a differing value.Suggest guarding the new keys against ones already declared in
extra_settings. Also fixes the double-negative condition while we're in here (equivalent to the positive guard already used inroles/eda/tasks/deploy_eda.yml:20):