Skip to content

Conversation

@kvaps
Copy link
Member

@kvaps kvaps commented Sep 10, 2025

Signed-off-by: Andrei Kvapil kvapss@gmail.com

Summary by CodeRabbit

  • Bug Fixes

    • Prevents LVM from scanning DRBD, dm-, and zvol devices, reducing conflicts and noisy logs.
    • Disables LVM backup and archive to avoid unnecessary disk writes and improve reliability in ephemeral environments.
  • Chores

    • Expands system configuration applied by the chart to include LVM settings with appropriate permissions, improving consistency across nodes.

Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
@coderabbitai
Copy link

coderabbitai bot commented Sep 10, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Adds a new Helm template snippet to create/overwrite /etc/lvm/lvm.conf with mode 0644, disabling LVM backups and setting a devices.global_filter. This is added alongside the existing file operation for /etc/cri/conf.d/20-customization.part. No public interfaces were changed.

Changes

Cohort / File(s) Summary of edits
Helm helpers: system file operations
charts/cozystack/templates/_helpers.tpl
Introduces an additional fileOperation (overwrite) to render /etc/lvm/lvm.conf (0644), setting backup { backup = 0; archive = 0; } and devices { global_filter = [...] }. Existing /etc/cri/conf.d/20-customization.part operation remains unchanged.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    actor U as User/Controller
    participant H as Helm (cozystack chart)
    participant N as Node Init
    participant F as Filesystem

    U->>H: helm install/upgrade
    H->>N: Rendered templates with file operations
    N->>F: Overwrite /etc/lvm/lvm.conf (0644)
    Note right of F: backup=0, archive=0<br/>devices.global_filter=...
    N->>F: (Existing) write /etc/cri/conf.d/20-customization.part
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I thump my paws—new config in the stack,
LVM now whispers, no backups on the track.
Filters set neat, dm- and zd away,
Charts hum softly, templated ballet.
A nibble of YAML, a hop, and we’re done—
Cozy stacks tightened, release 1:1.


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7a557a1 and 8fe258f.

⛔ Files ignored due to path filters (1)
  • pkg/generated/presets.go is excluded by !**/generated/**
📒 Files selected for processing (1)
  • charts/cozystack/templates/_helpers.tpl (1 hunks)
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch lvm-filter

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@kvaps kvaps merged commit 40cbf80 into main Sep 10, 2025
2 of 4 checks passed
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary of Changes

Hello @kvaps, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the system's LVM configuration to prevent it from inadvertently scanning or interacting with specific device types that are typically managed by other components or users. By applying a global filter, it aims to improve system stability and resource management by avoiding potential conflicts or unnecessary operations on these devices.

Highlights

  • LVM Configuration Update: Introduced a new configuration for LVM by overwriting /etc/lvm/lvm.conf to include specific global_filter settings.
  • Device Filtering: The global_filter is configured to exclude devices matching drbd, dm-, and zd patterns (e.g., DRBD, device mapper, and ZFS devices) from LVM's scanning process.
  • Backup Settings: The LVM configuration also explicitly disables backup and archive features by setting backup = 0 and archive = 0.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds a global filter to the LVM configuration to prevent it from scanning certain device types like DRBD, Device Mapper, and ZFS volumes. This is a good practice to avoid issues with LVM misinterpreting these devices. The implementation is correct in both the Helm chart template and the generated Go code. I've made a minor suggestion in both modified files to fix an indentation inconsistency for better readability.

archive = 0
}
devices {
global_filter = [ "r|^/dev/drbd.*|", "r|^/dev/dm-.*|", "r|^/dev/zd.*|" ]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The indentation for global_filter is inconsistent with the backup section. For improved readability and consistency, it should be indented by 8 spaces instead of 9.

        global_filter = [ "r|^/dev/drbd.*|", "r|^/dev/dm-.*|", "r|^/dev/zd.*|" ]

archive = 0
}
devices {
global_filter = [ "r|^/dev/drbd.*|", "r|^/dev/dm-.*|", "r|^/dev/zd.*|" ]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The indentation for global_filter within the string literal is inconsistent with the backup section in the YAML content. For improved readability and consistency, it should be indented by 8 spaces instead of 9.

Suggested change
global_filter = [ "r|^/dev/drbd.*|", "r|^/dev/dm-.*|", "r|^/dev/zd.*|" ]
global_filter = [ "r|^/dev/drbd.*|", "r|^/dev/dm-.*|", "r|^/dev/zd.*|" ]

NickVolynkin pushed a commit to cozystack/website that referenced this pull request Sep 10, 2025
…ices

Same change is already included in Talm:
cozystack/talm#76

Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
NickVolynkin pushed a commit to cozystack/website that referenced this pull request Sep 10, 2025
…ices

Same change is already included in Talm:
cozystack/talm#76

Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants