Fix issue 637#640
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThis PR adds an Suggested reviewers
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@stemcell_builder/stages/bosh_monit/assets/monit-access-helper.sh`:
- Line 35: The current error echo "permit_monit_access: unable to resolve cgroup
v2 mount or path" is ambiguous; update the error handling where that string is
emitted to distinguish which check failed and include the actual variable values
(e.g., the cgroup v2 mount and path variables used in the script) in the log so
you can see whether the mount or the path is empty (or both); emit separate
messages like "permit_monit_access: cgroup v2 mount empty: <value>" and/or
"permit_monit_access: cgroup v2 path empty: <value>" or a combined message that
prints both variable values for diagnostics.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: c50ba2f7-fbdc-4bca-8e20-dbf11f177b42
📒 Files selected for processing (1)
stemcell_builder/stages/bosh_monit/assets/monit-access-helper.sh
|
FYI: @gberche-orange we look into prs after the AI feedback is resolved. |
1e4a114 was filtering on the cgroupv2 device to prevent a `cgroup_mount` variable with multiline content failing downsteam without clear errors. cilium-originating mount ``` cat /proc/self/mounts | grep cgroup2 # device mount_point fs_type dummy cgroup2 /sys/fs/cgroup/unified cgroup2 rw,nosuid,nodev,noexec,relatime 0 0 none /run/cilium/cgroupv2 cgroup2 rw,relatime 0 0 ``` however, in warden/docker stemcells, the device is cgroup, which introduced regression cloudfoundry#637 ``` cat /proc/self/mounts | grep cgroup2 # device mount_point fs_type dummy cgroup /sys/fs/cgroup cgroup2 rw,... ``` Applying suggestion by @colins in cloudfoundry#637 to instead rely on the chronological ordering of mount points, and select the canonical cgroup2 mount point first added by the kernel during boot process. https://man7.org/linux/man-pages/man5/proc_pid_mounts.5.html > /proc/self/mounts, lists the mounts of the process's own mount namespace. The format of this file is documented in [fstab(5)](https://man7.org/linux/man-pages/man5/fstab.5.html). https://man7.org/linux/man-pages/man5/fstab.5.html > The order of records in fstab is important because [fsck(8)](https://man7.org/linux/man-pages/man8/fsck.8.html), [mount(8)](https://man7.org/linux/man-pages/man8/mount.8.html), and [umount(8)](https://man7.org/linux/man-pages/man8/umount.8.html) > sequentially iterate through fstab doing their thing https://man7.org/linux/man-pages/man7/cgroups.7.html > Note that on many modern systems, systemd(1) automatically mounts > the cgroup2 filesystem at /sys/fs/cgroup/unified during the boot > process.
701ac72 to
3db5ff0
Compare
|
@beyhan thanks for the heads up. I've now rebased the PR to clear unrelated outdated bot reviews, and addressed latest bot review. |
Reverts #599 with #638, and harden cgroupv2 mounts detection by selecting the first mount
Hope this helps. Note that I'm unable to do further tests, and rely on suggested fix by @colins in #637
1e4a114 was filtering on the cgroupv2 device to prevent a
cgroup_mountvariable with multiline content failing downsteam without clear errors.cilium-originating mount
however, in warden/docker stemcells, the device is cgroup, which introduced regression #637
Applying suggestion by @colins in #637 to instead rely on the chronological ordering of mount points, and select the canonical cgroup2 mount point first added by the kernel during boot process.
https://man7.org/linux/man-pages/man5/proc_pid_mounts.5.html
https://man7.org/linux/man-pages/man5/fstab.5.html
https://man7.org/linux/man-pages/man7/cgroups.7.html