refactor: look up OpenSearch admin password from credentials secret#60
refactor: look up OpenSearch admin password from credentials secret#60nilushancosta merged 1 commit intoopenchoreo:mainfrom
Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (10)
📝 WalkthroughWalkthroughThe PR updates observability Helm charts across two modules by switching from inline admin passwords to referenced Kubernetes credentials secrets, bumps chart versions (logs: 0.3.9→0.3.10; tracing: 0.3.7→0.3.8), removes RCA report index templates and ISM policies from the logs module, and updates documentation to reflect these changes. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@observability-logs-opensearch/helm/templates/opensearch-cluster/secrets.yaml`:
- Line 9: The template reads {{- $password := index $secret.data "password" |
b64dec }} without validating the key; change this to first capture the encoded
value (index $secret.data "password") and wrap it with Helm's required helper to
assert presence/non-empty, e.g. use required "clear error message" (index
$secret.data "password") and then b64dec the result to produce $password, and
apply the same pattern for the other password reference on line 18; this will
cause the install to fail fast with a clear message before generating
internal_users.yml.
In
`@observability-tracing-opensearch/helm/templates/opensearch-cluster/secrets.yaml`:
- Line 9: The template assumes the Secret key "password" exists and decodes it
directly; update the assignments that reference secret.data "password" (the
$password variables at the shown locations) to validate presence and
non-emptiness before b64dec so the template fails with a clear message instead
of producing an empty/invalid value—use Helm's required (or hasKey + required)
around the indexed value and only then pipe to b64dec, and apply the same change
to the other occurrence noted (line 18 equivalent).
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 6b1e871a-bdc5-4fac-b0c6-bc26a357907f
📒 Files selected for processing (10)
observability-logs-opensearch/README.mdobservability-logs-opensearch/helm/Chart.yamlobservability-logs-opensearch/helm/templates/opensearch-cluster/secrets.yamlobservability-logs-opensearch/helm/templates/opensearch-setup-logs/job.yamlobservability-logs-opensearch/helm/values.yamlobservability-logs-opensearch/init/setup-opensearch.shobservability-tracing-opensearch/README.mdobservability-tracing-opensearch/helm/Chart.yamlobservability-tracing-opensearch/helm/templates/opensearch-cluster/secrets.yamlobservability-tracing-opensearch/helm/values.yaml
💤 Files with no reviewable changes (3)
- observability-tracing-opensearch/helm/values.yaml
- observability-logs-opensearch/helm/templates/opensearch-setup-logs/job.yaml
- observability-logs-opensearch/helm/values.yaml
observability-logs-opensearch/helm/templates/opensearch-cluster/secrets.yaml
Outdated
Show resolved
Hide resolved
observability-tracing-opensearch/helm/templates/opensearch-cluster/secrets.yaml
Outdated
Show resolved
Hide resolved
Remove the openSearchCluster.adminPassword Helm value and instead use Helm's lookup function to read the password directly from the credentialsSecretName secret at install time. Also remove RCA report index templates and ISM policies from the logs setup script. Signed-off-by: Rashad Sirajudeen <rashad@wso2.com>
Summary
openSearchCluster.adminPasswordHelm value from both logs and tracing modules; use Helmlookupto read the password from the existing credentials secret at install time0.3.9→0.3.10, tracing0.3.7→0.3.8Summary by CodeRabbit
Documentation
Chores