You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(placement): close the deferred review items on the applier and the Grafana Secret check - #1028
Closes the four non-blocking review items deferred to #903 from the #914 reviews.
Changes
Item 4: a CA directory the applier can list but not search.pools._holds_files now requires search permission on each SSL_CERT_DIR directory, checked with the effective ids where the platform supports it, before it looks for a file there. A directory with mode 0600 or 0400 used to pass the start-up check, because listing works and DirEntry.is_file() reads the type from the listing. Every gateway call then failed with CERTIFICATE_VERIFY_FAILED. Such a directory is now refused before any call, with the same error as an unusable location. A directory the applier may search but not list is still left to OpenSSL, as before. The README sentence on refused locations now says "may search and finds a file in".
Item 1: the Grafana admin Secret check in the release namespace.sie-cluster.wiredSecretKeys now checks and evaluates kube-prometheus-stack.grafana.admin.existingSecret only when Grafana reads its admin username or password from that Secret. That is the same condition the Grafana chart and the NOTES use. Before this change, a value that Grafana never evaluates, for example with GF_SECURITY_DISABLE_INITIAL_ADMIN_CREATION set or with both admin values supplied through env, could still fail the render.
Items 2 and 3: no change.
Item 2: YAML 1.2 post-renderers rewrite unquoted scalars such as 0o-7 and 2001-12-14. The check models sigs.k8s.io/yaml, which Helm and kubectl use, and the API server rejects both rewritten forms, so the outcome fails closed.
Item 3: a Secret name that starts with NBSP or U+3000 only causes an extra refusal.
Neither item can let a wrong Secret through.
Tests
test_a_ca_location_the_applier_may_not_search_is_refused_before_any_call gains a listable-unsearchable case. It fails without the change to pools.py and passes with it.
test_a_grafana_admin_secret_that_grafana_never_reads_is_not_checked_in_the_release_namespace covers 3 env forms × 2 names the check refuses. All 6 cases fail without the template change and pass with it.
…e Grafana Secret check
Refuse an SSL_CERT_DIR directory the applier can list but not search,
before any gateway call, instead of failing every call with a TLS error.
Check and evaluate kube-prometheus-stack.grafana.admin.existingSecret in
the release namespace only when Grafana reads its admin Secret, as the
NOTES already do, so a name Grafana never evaluates no longer fails the
render.
Refs #903
Review was skipped as selected files did not have any reviewable changes.
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Team
Run ID: 47fd558f-577a-4ebe-bc48-15d7d7cd0693
Commits
Reviewing files that changed from the base of the PR and between 0b872e1 and 345989d.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
The changes make Grafana admin Secret validation conditional on Secret use. They also adjust CA directory permission handling, expand its test cases, and update the related credentials documentation.
The chart resolves and records Grafana admin Secret references only for credentials Grafana reads from a Secret. Render tests cover settings that bypass Secret-based passwords and existingSecret values that would otherwise fail validation.
CA Directory Search Checks
Layer / File(s)
Summary
CA directory permission handling packages/sie_placement/src/sie_placement/pools.py, packages/sie_placement/tests/test_cli.py, packages/sie_placement/README.md
_holds_files checks execute permission before scanning and handles scan errors. Tests cover unsearchable directories and an unsearchable parent. The documentation describes the refusal condition for searchable directories.
Possibly related PRs
superlinked/sie#914: Adds the CA-directory and Grafana Secret checks that this PR changes.
superlinked/sie#913: Covers related Grafana Secret validation and gateway CA handling.
superlinked/sie#911: Introduces related Secret-separation checks and applier CA handling.
Suggested reviewers:huronat
Merge Risk: Minimal · previous review 0b872
The change makes the Grafana admin Secret check run only when Grafana reads that Secret. It also refuses certificate directories the applier cannot search before any gateway call. No merge-blocking issues were found, and both changes come with targeted tests.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the 'fix(placement)' scope and two review items: the placement applier and the Grafana Secret check. Those two changes match the changeset. The title is a single line but uses a conven…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check
Explanation
The title names the 'fix(placement)' scope and two review items: the placement applier and the Grafana Secret check. Those two changes match the changeset. The title is a single line but uses a conventional-commit prefix and 'deferred review items', which is somewhat vague about the actual behavior change. It still refers to the real main changes, so it passes as partially related to the changeset.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Fix failing CI checks
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Team
Run ID: 919d8970-bc5d-4108-9770-c2c86535cdfe
Commits
Reviewing files that changed from the base of the PR and between d7be537 and 0b872e1.
Files selected for processing: 5
deploy/helm/sie-cluster/templates/_helpers.tpl
packages/sie_placement/README.md
packages/sie_placement/src/sie_placement/pools.py
packages/sie_placement/tests/test_cli.py
tools/ci/tests/test_helm_render.py
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
Already reviewed the last commit. Use @coderabbitai full review to rerun a review of the entire changeset.
Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes the four non-blocking review items deferred to #903 from the #914 reviews.
Changes
Item 4: a CA directory the applier can list but not search.
pools._holds_filesnow requires search permission on eachSSL_CERT_DIRdirectory, checked with the effective ids where the platform supports it, before it looks for a file there. A directory with mode0600or0400used to pass the start-up check, because listing works andDirEntry.is_file()reads the type from the listing. Every gateway call then failed withCERTIFICATE_VERIFY_FAILED. Such a directory is now refused before any call, with the same error as an unusable location. A directory the applier may search but not list is still left to OpenSSL, as before. The README sentence on refused locations now says "may search and finds a file in".Item 1: the Grafana admin Secret check in the release namespace.
sie-cluster.wiredSecretKeysnow checks and evaluateskube-prometheus-stack.grafana.admin.existingSecretonly when Grafana reads its admin username or password from that Secret. That is the same condition the Grafana chart and the NOTES use. Before this change, a value that Grafana never evaluates, for example withGF_SECURITY_DISABLE_INITIAL_ADMIN_CREATIONset or with both admin values supplied throughenv, could still fail the render.Items 2 and 3: no change.
0o-7and2001-12-14. The check modelssigs.k8s.io/yaml, which Helm and kubectl use, and the API server rejects both rewritten forms, so the outcome fails closed.Neither item can let a wrong Secret through.
Tests
test_a_ca_location_the_applier_may_not_search_is_refused_before_any_callgains alistable-unsearchablecase. It fails without the change topools.pyand passes with it.test_a_grafana_admin_secret_that_grafana_never_reads_is_not_checked_in_the_release_namespacecovers 3 env forms × 2 names the check refuses. All 6 cases fail without the template change and pass with it.Commands run:
pytest packages/sie_placement/tests: 1612 passed.pytest tools/ci/tests/test_helm_render.py: 714 passed.mise run lint: passed.mise run helm -- lint: passed.Closes #903.